Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo can't find rustc-demangle in a local-registry #131

Closed
bdonlan opened this issue May 21, 2019 · 7 comments
Closed

cargo can't find rustc-demangle in a local-registry #131

bdonlan opened this issue May 21, 2019 · 7 comments

Comments

@bdonlan
Copy link

bdonlan commented May 21, 2019

if you declare a package with a (direct or indirect) dependency on rustc-demangle:

% cat Cargo.toml
[package]
name = "testcargo"
version = "0.1.0"
authors = ["Bryan Donlan <[email protected]>"]
edition = "2018"

[dependencies]
"rustc-demangle" = "0.1.13"

and then build a local-registry:

% cargo local-registry -s Cargo.toml local-registry
    Updating crates.io index
add this to your .cargo/config somewhere:

    [source.crates-io]
    registry = 'https://github.com/rust-lang/crates.io-index'
    replace-with = 'local-registry'

    [source.local-registry]
    local-registry = '/local/home/bdonlan/testcargo/local-registry'

and then enable the local registry by copying the above-cited lines into .cargo/config, then cargo check fails:

% cargo check
error: no matching package named `rustc-demangle` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `testcargo v0.1.0 (/local/home/bdonlan/testcargo)`

Contents of the local registry:

% ls -lR local-registry
local-registry:
total 24
drwxr-xr-x 3 bdonlan bdonlan  4096 May 21 20:41 index
-rw-r--r-- 1 bdonlan bdonlan 18721 May 21 20:41 rustc-demangle-0.1.14.crate

local-registry/index:
total 4
drwxr-xr-x 3 bdonlan bdonlan 4096 May 21 20:41 ru

local-registry/index/ru:
total 4
drwxr-xr-x 2 bdonlan bdonlan 4096 May 21 20:41 st

local-registry/index/ru/st:
total 4
-rw-r--r-- 1 bdonlan bdonlan 456 May 21 20:41 rustc-demangle
% cat local-registry/index/ru/st/rustc-demangle
{"name":"rustc-demangle","vers":"0.1.14","deps":[{"name":"compiler_builtins","req":"^0.1.2","features":[],"optional":true,"default_features":true,"target":null,"kind":null},{"name":"rustc-std-workspace-core","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":null}],"cksum":"ccc78bfd5acd7bf3e89cffcf899e5cb1a52d6fafa8dec2739ad70c9577a57288","features":{"rustc-dep-of-std":["compiler_builtins","core"]},"yanked":false}

Version information:

% cargo --version
cargo 1.34.0 (6789d8a0a 2019-04-01)

cargo local-registry has no --version, but was just now installed via cargo install cargo-local-registry.

@bdonlan
Copy link
Author

bdonlan commented May 21, 2019

This appears to only occur with rustc-demangle 0.1.14; using "rustc-demangle" = "=0.1.13" does not result in the same error.

@sebastianblunt
Copy link

Also encountered this issue, debug output:

> RUST_LOG=debug cargo check
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_root - is root /private/tmp/workspace2/Cargo.toml
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_members - /private/tmp/workspace2/foo/Cargo.toml
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_members - /private/tmp/workspace2/Cargo.toml
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_root - trying /private/tmp/workspace2/Cargo.toml
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_root - found!
[2019-06-08T18:21:08Z DEBUG cargo::core::workspace] find_root - is root /private/tmp/workspace2/Cargo.toml
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer autocfg v0.1.4
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer backtrace v0.3.30
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer backtrace-sys v0.1.28
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer cc v1.0.37
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer cfg-if v0.1.9
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer failure v0.1.5
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer failure_derive v0.1.5
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer foo v0.1.0 (/private/tmp/workspace2/foo)
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer libc v0.2.58
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer proc-macro2 v0.4.30
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer quote v0.6.12
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer rustc-demangle v0.1.15
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer syn v0.15.35
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer synstructure v0.10.2
[2019-06-08T18:21:08Z DEBUG cargo::ops::resolve] attempting to prefer unicode-xid v0.1.0
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/missing  /private/tmp/workspace2/foo
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] loading source /private/tmp/workspace2/foo
[2019-06-08T18:21:08Z DEBUG cargo::sources::config] loading: /private/tmp/workspace2/foo
[2019-06-08T18:21:08Z DEBUG cargo::core::resolver] initial activation: foo v0.1.0 (/private/tmp/workspace2/foo)
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/missing  registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] loading source registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::config] loading: registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::config] following pointer to local-registry
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] skipping update due to locked registry
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z INFO  cargo::sources::registry::index] failed to parse `rustc-demangle` registry package: Feature `rustc-dep-of-std` includes `core` which is neither a dependency nor another feature
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] falling back to an update
[2019-06-08T18:21:08Z INFO  cargo::sources::registry::index] failed to parse `rustc-demangle` registry package: Feature `rustc-dep-of-std` includes `core` which is neither a dependency nor another feature
[2019-06-08T18:21:08Z DEBUG cargo::core::resolver] no candidates found
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] attempting query without update
[2019-06-08T18:21:08Z DEBUG cargo::sources::registry] falling back to an update
[2019-06-08T18:21:08Z INFO  cargo::sources::registry::index] failed to parse `rustc-demangle` registry package: Feature `rustc-dep-of-std` includes `core` which is neither a dependency nor another feature
[2019-06-08T18:21:08Z DEBUG cargo::core::registry] load/match    registry `https://github.com/rust-lang/crates.io-index`
[2019-06-08T18:21:08Z DEBUG cargo] exit_with_error; err=CliError { error: Some(ErrorMessage { msg: "no matching package named `rustc-demangle` found\nlocation searched: registry `https://github.com/rust-lang/crates.io-index`\nrequired by package `backtrace v0.3.30`\n    ... which is depended on by `failure v0.1.5`\n    ... which is depended on by `foo v0.1.0 (/private/tmp/workspace2/foo)`" }), unknown: false, exit_code: 101 }
error: no matching package named `rustc-demangle` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `backtrace v0.3.30`
    ... which is depended on by `failure v0.1.5`
    ... which is depended on by `foo v0.1.0 (/private/tmp/workspace2/foo)`

@FlyingWombat
Copy link

same error here

@ChrisGreenaway
Copy link
Collaborator

ChrisGreenaway commented Jun 18, 2019

So the key error appears to be:
failed to parse `rustc-demangle` registry package: Feature `rustc-dep-of-std` includes `core` which is neither a dependency nor another feature

@ChrisGreenaway
Copy link
Collaborator

The following was added to rustc-demangle from 0.1.13 to 0.1.14:

[dependencies]
core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' }
compiler_builtins = { version = '0.1.2', optional = true }

[features]
rustc-dep-of-std = ['core', 'compiler_builtins']

@ChrisGreenaway
Copy link
Collaborator

I think this is closely related to: rust-lang/cargo#5993

@ChrisGreenaway
Copy link
Collaborator

So if I generate the local registry, with a project using rustc-demangle version 0.1.15 then I get the following in the registry/index/ru/st/rustc-demangle file:

{"name":"rustc-demangle","vers":"0.1.15","deps":[{"name":"compiler_builtins","req":"^0.1.2","features":[],"optional":true,"default_features":true,"target":null,"kind":null},{"name":"rustc-std-workspace-core","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":null}],"cksum":"a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af","features":{"rustc-dep-of-std":["compiler_builtins","core"]},"yanked":false}

Which is different from what crates.io has for that version at https://github.com/rust-lang/crates.io-index/blob/master/ru/st/rustc-demangle:

{"name":"rustc-demangle","vers":"0.1.15","deps":[{"name":"compiler_builtins","req":"^0.1.2","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal"},{"name":"core","req":"^1.0.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","package":"rustc-std-workspace-core"}],"cksum":"a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af","features":{"rustc-dep-of-std":["core","compiler_builtins"]},"yanked":false,"links":null}

ChrisGreenaway added a commit that referenced this issue Jul 29, 2019
…endencies

Fixes issue #131 - handle renamed dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants