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

maybe suggest running cargo update if there's a previously selected version conflict #5484

Open
mozkeeler opened this issue May 4, 2018 · 7 comments
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@mozkeeler
Copy link

I added a new dependency to a project, ran cargo build and got this:

    error: failed to select a version for `libc`
    all possible versions conflict with previously selected versions of `libc`
    required by package `dlopen_derive v0.1.0`
        ... which is depended on by `dlopen v0.1.0`
        ... which is depended on by `ooppkcs11rs v0.0.1 (file:///home/keeler/src/ooppkcs11rs)`
      previously selected package `libc v0.2.23`
        ... which is depended on by `ipc-channel v0.10.0`
        ... which is depended on by `ooppkcs11rs v0.0.1 (file:///home/keeler/src/ooppkcs11rs)`
      possible versions to select: 0.2.40, 0.2.39, 0.2.38, 0.2.37, 0.2.36, 0.2.35, 0.2.34, 0.2.33, 0.2.32, 0.2.31, 0.2.30, 0.2.29 

My assumption was this was because ipc-channel didn't support libc >0.2.23, but there's no such restriction in ipc-channel's Cargo.toml, so this was just confusing. I ended up removing Cargo.lock and rebuilding, and this worked. A colleague later told me cargo update is the real way to fix this.

@alexcrichton
Copy link
Member

cc @Eh2406

@Eh2406
Copy link
Contributor

Eh2406 commented May 5, 2018

Ya we can definitely do better. @alexcrichton Is there an easy way to tell if a dependency is pind by a lock file, if so we should definitely add it to the output. Ore is there some way to trigger a thing like we do for #5180 ?

@alexcrichton
Copy link
Member

@Eh2406 yeah you can use precise in general and if it's Some the dependency likely came from a lock file

@Eh2406
Copy link
Contributor

Eh2406 commented May 6, 2018

I added a note reminding myself to try that in our rework of the wording of these are messages.

On a different note, isn't this exactly the situation #5180 what's supposed to solve? If not how hard would it be to expand that to work here?

@mozkeeler by the way, what version of cargo gave you that message?

@mozkeeler
Copy link
Author

@Eh2406 well, the version I have now is cargo 0.26.0 (41480f5cc 2018-02-26) but I may have updated it as part of trying to figure this out... (although I don't think even doing that helped until I removed Cargo.lock...)

@Eh2406
Copy link
Contributor

Eh2406 commented May 7, 2018

@mozkeeler Thanks for the info! That explains it, #5180 merged after 0.26.0 branched. Sorry for the noize.

@Eh2406 Eh2406 added the A-dependency-resolution Area: dependency resolution and the resolver label Sep 23, 2019
@Ekleog
Copy link
Contributor

Ekleog commented Dec 19, 2019

FWIW, this is something I just bumped into. Even without checking whether the dependency comes from Cargo.lock, maybe just adding “sometimes this error can be fixed by running cargo update” would be a good first step?

@epage epage added A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-diagnostics Area: Error and warning messages generated by Cargo itself. S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

5 participants