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

error: failed to select a version for libc (required by appname): #826

Closed
CBSears opened this issue Jan 28, 2017 · 7 comments
Closed

error: failed to select a version for libc (required by appname): #826

CBSears opened this issue Jan 28, 2017 · 7 comments
Labels
A-meta Area: administrative question or tracking issue

Comments

@CBSears
Copy link

CBSears commented Jan 28, 2017

rustc 1.15.0-beta.3 (a035041ba 2017-01-07)
clap = "2.20.0"

I'm developing on OSX, latest and greatest.

I am only just starting to use clap. So I'm including essentially three lines in my project and I can't even get it to build. I'm not even calling clap.

In my Cargo.toml:

clap = "2.20.0"
libc = "0.2.20"

I've also tried libc 0.2.19 and 0.2.18 as well with the same error message. When I build my code:

% cargo clean; cargo build
Updating registry https://github.com/rust-lang/crates.io-index
error: failed to select a version for libc (required by appname):
all possible versions conflict with previously selected versions of libc
version 0.2.19 in use by libc v0.2.19
possible versions to select: 0.2.20

In particular, this line makes no sense to me:

version 0.2.19 in use by libc v0.2.19

My entire Cargo.toml is:

[package]
name = "appname"
version = "0.1.0"
authors = ["chris"]

build = "build.rs"

[dependencies]

time = "0.1"
clap = "2.20.0"
libc = "0.2.20"
rustc-serialize = "0.3"

@CBSears CBSears changed the title error: failed to select a version for libc (required by xxx): error: failed to select a version for libc (required by appname): Jan 28, 2017
@CBSears
Copy link
Author

CBSears commented Jan 28, 2017

The problem persisted after I commented out "extern crate clap;" and "clap = "2.20.0"
It went away after cargo update. But returned when I uncommented these lines.

@kbknapp
Copy link
Member

kbknapp commented Jan 29, 2017

Thanks for reporting this! I saw this mentioned on the subreddit as well. I'll do some tests and see where it lies, if it's as simple as bumping the pinned libc version I'll do that.

@kbknapp kbknapp added A-meta Area: administrative question or tracking issue P1: urgent labels Jan 29, 2017
@kbknapp
Copy link
Member

kbknapp commented Jan 29, 2017

Alright this should be fixed, I'm uploading the PR now

@CBSears
Copy link
Author

CBSears commented Jan 30, 2017 via email

@kbknapp
Copy link
Member

kbknapp commented Jan 30, 2017

To be honest I'm not 100% sure since cargo should allow for multiple versions of a dep to exist in the dep graph.

The way it went down is clap required exactly version 0.2.18 of libc, while one of claps deps required "up to" version 0.2.20 and cargo didn't like that for some reason.

I've relaxed claps version requirements and also updated that dep of claps (term_size-rs) so it shouldn't happen again. Now both of those crates require anything semver compatible with 0.2.20 and above.

@kbknapp
Copy link
Member

kbknapp commented Jan 30, 2017

As soon as #830 merges I'll put v2.20.1 on crates.io

@kbknapp
Copy link
Member

kbknapp commented Jan 30, 2017

Closed with #830

@kbknapp kbknapp closed this as completed Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: administrative question or tracking issue
Projects
None yet
Development

No branches or pull requests

2 participants