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

Allow using crate features that only exist in an override #2582

Closed
bluss opened this issue Apr 15, 2016 · 1 comment · Fixed by #9681
Closed

Allow using crate features that only exist in an override #2582

bluss opened this issue Apr 15, 2016 · 1 comment · Fixed by #9681
Labels
A-features Area: features — conditional compilation A-overrides Area: general issues with overriding dependencies (patch, replace, paths)

Comments

@bluss
Copy link
Member

bluss commented Apr 15, 2016

For example:

[dependencies]
num-complex = { version = "*", features = ["newfeature"] }

This is not allowed by cargo if newfeature doesn't exist upstream, even if there is an override that has the new crate feature flag.

However, the feature flag can still be enabled manually cargo build --features=num-complex/newfeature.

If this worked as expected (using Cargo.toml), it would make it easier to test the new feature using a whole chain / group of crates that depend on it.

@alexcrichton
Copy link
Member

Yeah activating new features in path overrides currently isn't supported (intentionally) because the DAG needs to be resolved before path dependencies are loaded. I'm... a little surprised the --features flag works...

In any case, the freshly-landed [replace] mechanism is intended to replace this in Cargo.toml, and I hope to at some point "fix path overrides" to be more clear about this. For example a path override should be able to specify new features.

@alexcrichton alexcrichton added the A-overrides Area: general issues with overriding dependencies (patch, replace, paths) label Apr 15, 2016
@alexcrichton alexcrichton added the A-features Area: features — conditional compilation label Jun 22, 2017
@bors bors closed this as completed in 9535dc3 Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation A-overrides Area: general issues with overriding dependencies (patch, replace, paths)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants