-
Notifications
You must be signed in to change notification settings - Fork 7
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
Don't enable serde's std
feature
#108
Don't enable serde's std
feature
#108
Conversation
a738a01
to
1cd88aa
Compare
1cd88aa
to
1eaddb7
Compare
When we use the `serde?/std` syntax for the feature, we end up with a public dependency on `serde` even when it isn't enabled or used. It isn't compiled, but it feels wrong. We don't need the `std` feature from `serde`, so no need to enable it and someone that does will already have it enabled.
1eaddb7
to
02c7fdd
Compare
Interesting. In the case we did need Serde's std feature if Color's std was enabled, how would that be specified while bringing in Serde only with the serde feature enabled? I thought that was the intention behind this syntax. |
Not sure, actually! I wish we didn't have this feature at all, but we need it for Peniko for now (optional there too). |
What do you mean by this? I don't see
The Where are you seeing |
It shows up in the
It doesn't build, but is a bad look for when we're trying to make sure that we aren't using that stuff at all. |
That's interesting and frankly seems like a bug in Cargo. I might try looking more into it later, but for Color I guess it's fine to just not specify the |
It is indeed Cargo's fault, and the issue is tracked in cargo#10801. The issue comes from the fact that apparently Cargo has two different resolvers. One old dependency resolver, which is used to generate The dependency resolver will generate a union of dependencies that could be used under the assumption that every platform is targeted and all features are enabled. So we had The good news is that there are plenty of people who find this situation annoying and are complaining. The bad news is that a proposed potential solution includes a complete redesign of the Cargo dependency resolver and as of right now there isn't anyone doing that. |
When we use the
serde?/std
syntax for the feature, we end up with a public dependency onserde
even when it isn't enabled or used. It isn't compiled, but it feels wrong. We don't need thestd
feature fromserde
, so no need to enable it and someone that does will already have it enabled.