-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Features on dev-dependencies are added to the features on regular dependencies #10719
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
Comments
Switch to |
Yes, it does fix the issue in the declaring crate. But does it mean that if the error occurs in a dependency I'm out of luck (build still fails). Is my only option to ask the crate maintainer to update the crate? |
The |
I'm pretty sure it's not, I'm testing it right now. Having:
This produces a build error above when compiled for |
That really looked like a bug for a few mins there! I had steps to reproduce all written up, and was ready to reopen. Then I checked if what is on github matched what was in the published version of the crate here. [dependencies]
...
time = { default-features = false, version = "0.3", features = ["formatting", "macros", "parsing", "quickcheck"] So that is why the |
Wow, nice find! Thank @Eh2406 for your help. |
I've run into this problem a few times, and discovering the source is time consuming and difficult (often involves traversing the gigantic Anyway, the point I'm trying to make is that control over this behavior is confusing because it's not specified in a single place (the crate) and because it's controlled via the edition and(or?) the resolver. Also relevant: rust-lang/rust#90148 |
#10112 is the issue for linting for lack of |
Problem
If you have the same crate as a dependency both in
dependencies
anddev-dependencies
, but with different set of features, the features fromdev-dependencies
are always used when compiling the crate. Even when we use this crate from another one, it'sdev-dependencies
features are still being applied.Steps
simple_asn1
crate as an example. It hastime
crate as dependency:wasm32-unknown-unknown
target. You get an error fromgetrandom
crate:time
line (or just remove thequickcheck
feature). Compilation succeeds with no problem.The issue here is that
time/quickcheck
feature introduces arand
dependency that cannot be compiled forwasm32-unknown-unknown
target (without a special feature). But thistime/quickcheck
feature should not be used at all here.If we use
simple_asn1
crate as a dependency, thistime/quickcheck
feature is also being used, breaking compilation.Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: