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

Optional dependencies cannot enable features #1925

Closed
nox opened this issue Aug 21, 2015 · 3 comments
Closed

Optional dependencies cannot enable features #1925

nox opened this issue Aug 21, 2015 · 3 comments

Comments

@nox
Copy link
Contributor

nox commented Aug 21, 2015

In crate X, with an optional dependency A and a mandatory dependency B of X, the feature A associated to the former cannot enable a feature with the same name in B. This means an additional feature bearing a different name must be introduced, making things messy.

@nox
Copy link
Contributor Author

nox commented Aug 21, 2015

Use case:

I am adding SIMD optimisations to rust-encoding. I want the feature to be named "simd" and to enable the same feature in the internal crate encoding-types.

[features]
simd = ["encoding-types/enable-simd"]

[dependencies.simd]
git = "https://github.com/nox/simd"
rev = "438780ca236b1ed2caf032edebda9c9362eaabc6"
optional = true

This won't work because you can't have an optional dependency and a feature bear the same name.

@SimonSapin
Copy link
Contributor

I’ve also found it confusing that features and (optional?) dependencies share the same namespace.

@alexcrichton
Copy link
Member

Yeah for now you'll have to choose a separate feature name to activate features and dependencies, otherwise though this is covered by #1286 so I'm going to close in favor of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants