Using unstable features. #240
tkaitchuck
started this conversation in
General
Replies: 1 comment
-
See also: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a follow up to the discussion here:
SergioBenitez/version_check#23
and here:
#238
CC: alexcrichton, dtolnay, RalfJung, SergioBenitez
There has been a lot of back and forth on this issue, and everyone seems to agree that: "If everyone always followed theses rules there wouldn't be any issues" the problem is nobody agrees on which set of rules, and thus nobody is happy.
To make this a bit concrete imagine the following scenario:
There is an application called "SuperParserCli" it depends on "SuperParser", which in turn depends on "SimdyQuote", which depends on "HashBrown" which depends on "aHash". "SuperParserCli" also depends on "tracing-log" which also uses "aHash". There is a second app "WebChat" which depends on "tracing-log" and "actix-web" which also depends on "aHash".
There are three different classes of developers building these crates. The library developers, the app developers, and the compiler developers. They have different needs and requirements.
The application developer wants:
The library developer wants:
The compiler developers want:
Suppose we propose the rule:
How would this affect "SuperParserCli" and "WebChat"?
The problem here is the library developer wants to know if a feature should be on or not, and is just guessing that everyone wants the feature on if possible. But this guess can be wrong. Ultimately the process building the binary should be providing that information. So suppose instead we propose the rules:
How would this affect "SuperParserCli" and "WebChat"?
aHash
even though they don't actually depend on it, just to enable a feature flag. There really isn't a way to work out how to do this without going through all of their transitive dependencies and seeing which ones they want to turn on the flag for.This is much worse. Its creating a ton of churn in the ecosystem at multiple levels introducing breaking changes for updates that don't need to be breaking or even a change at all. Clearly the assumption: "feature exists == feature on" has serious drawbacks, so there needs to be a way for enabling and disabling features to be done at compilation time.
Right now the only option is on Stable all features stabilized at or below that version are enabled and on nightly all features that have been developed as of that version are enabled. Those might be good defaults, but perhaps it would be more helpful if these could be set by config flag.
For example if there were a flag for "run with features that tagged for release at or below 1.74" this would allow:
Beta Was this translation helpful? Give feedback.
All reactions