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

two separate but identical versions of a crate in dependency tree #61725

Closed
brenzi opened this issue Jun 10, 2019 · 2 comments
Closed

two separate but identical versions of a crate in dependency tree #61725

brenzi opened this issue Jun 10, 2019 · 2 comments

Comments

@brenzi
Copy link

brenzi commented Jun 10, 2019

I get the following funny behaviour:

> cargo tree  -i -p untrusted
error: There are multiple `untrusted` packages in your project, and the specification `untrusted` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  https://github.com/briansmith/untrusted#0.6.2
  https://github.com/briansmith/untrusted#0.6.2

As you see, the versions are identical but cargo seems not to realize that

This issue causes errors like

  --> /home/brenzi/.cargo/registry/src/github.com-1ecc6299db9ec823/libp2p-core-0.7.1/src/identity/rsa.rs:74:27
   |
74 |                           Input::from(msg),
   |                           ^^^^^^^^^^^^^^^^ expected struct `untrusted::Input`, found a different struct `untrusted::Input`
   |
   = note: expected type `untrusted::Input<'_>` (struct `untrusted::Input`)
              found type `untrusted::Input<'_>` (struct `untrusted::Input`)
note: Perhaps two different versions of crate `untrusted` are being used?

I assume this is caused by a patch statement in workspace Cargo.toml

...
[patch.crates-io]
untrusted = { git = "https://github.com/briansmith/untrusted" }
...

which is needed because otherwise two truly different versions of untrusted would collide.

Here's my repo showing this behaviour: https://github.com/scs/substraTEE-worker/tree/brenzi-ra

@brenzi
Copy link
Author

brenzi commented Jun 12, 2019

This is related to rust-lang/cargo#6961

And actually, I should've filed the issue with cargo, not with rust. Sorry

@Mark-Simulacrum
Copy link
Member

Closing, please refile as a Cargo issue if this is still a problem (or followup on rust-lang/cargo#6961).

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

2 participants