-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Using crates.io libc triggers unstable libc warning #21771
Comments
A rule of thumb is to always use the version shipped with the compiler unless you know you need the version from crates.io (e.g. crossbuilding). The warning is expected since libc in crate is the same thing that is shipped with the rust compiler. |
So that suggests to me that the version shipped with the compiler shouldn't be used. |
cc @alexcrichton, who has worked on the libc for crates.io |
Working on a fix, thanks for the report! I've also seen this recently and I've been baffled. |
Previously if --extern was specified it would not override crates in the standard distribution, leading to issues like rust-lang#21771. This commit alters the behavior such that if --extern is passed then it will always override any other choice of crates and no previous match will be used (unless it is the same path as --extern). Closes rust-lang#21771
@nagisa You shouldn't work with the explicitely-deprecated compiler-shipped libraries. |
Previously if --extern was specified it would not override crates in the standard distribution, leading to issues like rust-lang#21771. This commit alters the behavior such that if --extern is passed then it will always override any other choice of crates and no previous match will be used (unless it is the same path as --extern). Closes rust-lang#21771
I note that this is still the case for 1.12 stable, which seems alarming... |
@stevedonovan can you share your exact code? I can't reproduce. |
Sorry, I forgot to actually add libc to my crate that imported a crate needing libc, hence the issue! That makes sense, so I'm happy. |
Ah, great! |
With the crates.io distribution of libc (#20606) in my Cargo.toml:
I still get a warning on
extern crate libc
:Am I linking to the wrong crate? How do you choose the version from cargo over the version included in rustc?
The text was updated successfully, but these errors were encountered: