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
Warn when experimental features are used #3744
Conversation
If you use an experimental feature not listed in the 'experimental-features' setting, you now get a warning rather than a fatal error. This makes things like the 'nix' command a bit less obnoxious. However, if you set 'allow-experimental-features = false', it's still a fatal error. This is primarily for CI systems where use of experimental features in the daemon could go unnoticed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a big fan of this change!
I don't think all experimental features should be enabled automatically. Maybe we should include |
throw Error("experimental Nix feature '%1%' is disabled; use '--experimental-features %1%' to override", name); | ||
if (!isExperimentalFeatureEnabled(name)) { | ||
if (allowExperimentalFeatures) { | ||
static Sync<std::unordered_set<std::string>> warned; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this requires #include <unordered_set>
for PRECOMPILE_HEADERS=0
Are there other experimental features now besides Is " |
Let's keep this unchanged for now. |
Yes, I can imagine people complaining "but the warning was burried in a huge log, and I had no idea I was using an unstable feature". Thanks for not doing this! |
On the other hand, maintaining tutorials of any kind is going to be really painful, because now Nix 2.3 rejects |
We could backport the experimental-features flag to 2.3. |
If you use an experimental feature not listed in the
experimental-features
setting, you now get a warning rather than a fatal error. This makes things like the 'nix' command a bit less obnoxious.However, if you set
allow-experimental-features = false
, it's still a fatal error. This is primarily for CI systems where use of experimental features in the daemon could go unnoticed.