-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 build = spurious errors, prevent cargo from merging the same dependency with different features #4323
Comments
Can you gist the errors involved here or perhaps the manifests involved? This may be a case of buggy upstream crates? From a first read it's not clear that this is a bug in Cargo at least |
Not sure what you want, cargo new feature_merge && cd feature_merge && cargo add nmea && cargo add cexpr && cargo check it produces (if you run
if you remove
I try to reformulate: author of Somebody combines Is it job of |
In other words you have
these obviously mean that |
This should be a bug in The problem here is that, when using "simple errors", the type
BTW if you change all |
Thanks, I don't know this, is it described somewhere?
The problem for me as a user that it is very hard to find source of problem, It would be nice from |
Unfortunately it is currently some sort of "hidden rule" and is not documented loudly. This is a known problem. There was rust-lang/rfcs#1841 trying to enforce this on crates.io, but is eventually closed since banning a crate is too aggressive and prone to error. The idea behind is still valid though.
For now, you extract the information via $ cargo check -v
...
Compiling nom v3.2.0
Running `rustc --crate-name nom «snip» --cfg 'feature="default"' --cfg 'feature="memchr"' --cfg 'feature="std"' --cfg 'feature="stream"' «snip»` we know that the set of features enabled for nom is |
Thanks, I missed that Not usability frieandly, but shell tools should fix this complexity for me, |
Steps to reproduce:
I remove/add the dependency without any code modification and this influences the build result.
The source of problem is that
cexpr
depends onnom
like this:while
nmea
describes the dependency like this:even if change
nmea
's way to specify dependency to this:I still got compile time error.
This cause a very strange behavior that I desribed here:
you built
crate X
(cargo build
return OK), then you go tocrate Y
, add[dependecy.crate X] path = path/to/crate X
, runcargo build
and your build failed, you try to understand what is going on, go to
path/to/crate X
run
cargo build
and again all Ok.Any way to prevent such kind of errors?
Related SO questions 1 2
The text was updated successfully, but these errors were encountered: