Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

edolstra
Copy link
Member

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.

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.
Copy link
Member

@Hoverbear Hoverbear left a 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!

@Kloenk
Copy link
Member

Kloenk commented Jun 25, 2020

I don't think all experimental features should be enabled automatically. Maybe we should include nix-command in the default settings for experimental-features?

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;
Copy link
Member

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

@colemickens
Copy link
Member

Are there other experimental features now besides nix-command and flakes? This seems to undo most of the (friction|awareness) that was added by --experimental-features in the first place.

Is "nix gave warnings in >=2.4" going to be enough cover for making breaking changes, as needed and desired? I was actually excited to see the required explicit opt-in, despite the hassle, as it gave me hope that Nix devs would feel free to improve upon the v2 nix cli.

@edolstra
Copy link
Member Author

Let's keep this unchanged for now.

@edolstra edolstra closed this Jul 13, 2020
@Ericson2314
Copy link
Member

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!

@domenkozar
Copy link
Member

On the other hand, maintaining tutorials of any kind is going to be really painful, because now Nix 2.3 rejects --experimental-features flag while Nix 2.4 requires it.

@edolstra
Copy link
Member Author

We could backport the experimental-features flag to 2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants