-
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
error: Package does not have these features #2851
Comments
This was likely due to #2821. In retrospect I'm not sure whether this should actually be allowed or not. On one hand you know when you're building a crate what the dependencies are, so it's not leaking information like before. On the other hand though you're just kinda poking around... Out of curiosity, what was the use case of this? |
cc @bennofs |
The particular use case that triggered this was CI testing; ensuring that the package builds and tests against a dependency when certain features are enabled, even though that feature isn't explicitly a feature of the main crate. Considering that |
That makes sense to me, and I agree that this is something we should fix. Thanks for the report! |
@bennofs would you mind taking a look? |
I agree with this report, specifying additional features for dependencies on the command line should definitely be allowed. I'll look it into this. |
Thanks @bennofs! |
@alexcrichton Do we want to support arbitrarily deep feature specifications on the command line? For example, |
@bennofs no I think we only want to allow |
allow enabling features for deps with --features Fixes #2851
Enabling a feature on a library must never break any crate that depends on it. Doing so should be considered as a bug. Your argument is more or less "I want to add tests in my library that test whether my dependencies are buggy". This is the most practical solution, but in my opinion it's the wrong way to fix the current situation. |
With: cargo run --features 'sic_image_engine/imageproc-ops' -- -i resources/1x1_a.png -o target/o.png It now works though; even on stable! yay! Seems that that is regarded as a feature: - rust-lang/cargo#2851 (comment)
This seems like a regression introduced recently... Specifying features through dependencies has worked for a long time, but is now broken:
The test case works as expected with
cargo 0.12.0-nightly (50dad37 2016-06-21)
The text was updated successfully, but these errors were encountered: