-
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
Platform specific dependencies documentation unclear #5005
Comments
Ok so it seems that I have to do: [target.'cfg(foo)'.dependencies.crates_a]
crate_a = "0.4.0"
default-features = false to disable the features of a platform-specific dependency. An example of this in the docs would have helped. |
Maybe related to this #1197 ? |
As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it. I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect? The team would be especially grateful if such a comment included details such as:
Thank you for contributing! (The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.) If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable! |
Yes.
Nothing. |
Unsure if this would be better in https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html or https://doc.rust-lang.org/cargo/reference/features.html#dependency-features Its also not quite clear to me what is needing documenting. That |
The doc has been improved since then, and this has been stale for a while. Given there is no response from the original author, I am going to close this. Feel free to open a new issue if there are still some confusions. |
See here: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
I depend on two platform specific crates, A and B:
Crate A has one feature "baz" enabled by default. I want to disable it by default, and then re-export it as my own feature baz.
IIUC I could do this to disable it by default:
After I disable all default features of crate A, I have no idea how to re-export them. The docs say I should do:
but what happens when I am on a target that is using crate_b and crate_a does not exist ? Is that still ok? EDIT: with the fix below it seems to "just work" but I am not sure if this is some behavior I can rely on. Like what happens when someone in a platform that uses
crate_b
enables the featurebaz
?The text was updated successfully, but these errors were encountered: