-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Difficult to use the presence of an optional dependency to use an optional dependency in a non-optional dependency #4548
Comments
|
Something that might help this situation would be having the ability to specify additional feature lists like Alternatively: Permit a feature named serde to exist alongside an optional dependency called serde if and only if that feature also has "serde" in its feature list so that the optional serde crate is used. (That's kind of a complicated ruleset so I'm not sure if I like this idea) |
I wanted to provide a few more details on this. So with this project structure
|
@alexcrichton Yes, that RFC sounds great, but doesn't it break backwards compatibility? |
@Xaeroxe ok! In that case I'm going to close this in favor of that issue. Strictly interpreted it does indeed break backwards compatibility, but there's a number of possible solutions we could employ to avoid the breaking change. |
Phew! That issue title was a mouthful. So for context see this PR: rustgd/collision-rs#38
We want to export a feature called "serde" and only turn on the "serde" feature in cgmath if our "serde" feature is enabled. We were able to accomplish this with a few workarounds, but it was fairly non-obvious how to do what might become a common task.
In addition to this it was also discovered that proc-macro crate dependencies are silently ignored if placed under a dependency section using
target.'cfg(...)'.dependencies
I imagine this is due to needing the macro system to evaluate the cfg statement, but it's still annoying and behaves unexpectedly.The text was updated successfully, but these errors were encountered: