From 590920eed2fbac2ef2d19dc2299d0dbcb279d24d Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 29 Oct 2023 21:50:35 +0000 Subject: [PATCH 1/3] Make the flakes experimental feature stable --- .github/workflows/ci.yml | 2 +- doc/manual/src/contributing/hacking.md | 3 +- src/libcmd/common-eval-args.cc | 2 - src/libcmd/installables.cc | 3 -- src/libexpr/primops/fetchTree.cc | 8 +-- src/libfetchers/github.cc | 5 -- src/libfetchers/indirect.cc | 5 -- src/libfetchers/path.cc | 5 -- src/libfetchers/registry.cc | 2 +- src/libflake/flake-settings.hh | 9 ++-- src/libflake/flake/flake.cc | 7 --- src/libutil/config.cc | 6 +-- src/libutil/config.hh | 2 +- src/libutil/experimental-features.cc | 7 ++- src/nix/flake.cc | 6 --- src/nix/main.cc | 1 - src/nix/nix.md | 6 +-- src/nix/repl.md | 2 +- tests/functional/ca/selfref-gc.sh | 2 +- tests/functional/common/init.sh | 3 +- tests/functional/config.sh | 4 +- tests/functional/experimental-features.sh | 60 +++++++++++------------ tests/functional/repl.sh | 6 +-- tests/nixos/github-flakes.nix | 2 +- tests/nixos/sourcehut-flakes.nix | 2 +- tests/nixos/tarball-flakes.nix | 2 +- tests/unit/libutil/config.cc | 4 +- 27 files changed, 59 insertions(+), 107 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bd09c8eb..832aa3ff0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: with: flakehub: true - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix --experimental-features 'nix-command flakes' flake check -L + - run: nix --experimental-features 'nix-command' flake check -L vm_tests: needs: tests diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index c128515e9..fc2d72217 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -14,10 +14,9 @@ The following instructions assume you already have some version of Nix installed ## Building Nix with flakes -This section assumes you are using Nix with the [`flakes`] and [`nix-command`] experimental features enabled. +This section assumes you are using Nix with the experimental feature [`nix-command`] enabled. See the [Building Nix](#building-nix) section for equivalent instructions using stable Nix interfaces. -[`flakes`]: @docroot@/contributing/experimental-features.md#xp-feature-flakes [`nix-command`]: @docroot@/contributing/experimental-features.md#xp-nix-command To build all dependencies and start a shell in which all environment variables are set up so that those dependencies can be found: diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc index 62745b681..92e7bd678 100644 --- a/src/libcmd/common-eval-args.cc +++ b/src/libcmd/common-eval-args.cc @@ -22,7 +22,6 @@ EvalSettings evalSettings { { "flake", [](ref store, std::string_view rest) { - experimentalFeatureSettings.require(Xp::Flakes); // FIXME `parseFlakeRef` should take a `std::string_view`. auto flakeRef = parseFlakeRef(std::string { rest }, {}, true, false); debug("fetching flake search path element '%s''", rest); @@ -229,7 +228,6 @@ SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * bas } else if (hasPrefix(s, "flake:")) { - experimentalFeatureSettings.require(Xp::Flakes); auto flakeRef = parseFlakeRef(std::string(s.substr(6)), {}, true, false); auto storePath = flakeRef.resolve(state.store).fetchTree(state.store).first; return state.rootPath(CanonPath(state.store->toRealPath(storePath))); diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 6835c512c..eb7048d39 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -394,9 +394,6 @@ void completeFlakeRefWithFragment( void completeFlakeRef(AddCompletions & completions, ref store, std::string_view prefix) { - if (!experimentalFeatureSettings.isEnabled(Xp::Flakes)) - return; - if (prefix == "") completions.add("."); diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index 567b73f9a..50935a61a 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -163,15 +163,11 @@ static void fetchTree( } input = fetchers::Input::fromAttrs(std::move(attrs)); } else { - if (!experimentalFeatureSettings.isEnabled(Xp::Flakes)) - state.error( - "passing a string argument to 'fetchTree' requires the 'flakes' experimental feature" - ).atPos(pos).debugThrow(); input = fetchers::Input::fromURL(url); } } - if (!state.settings.pureEval && !input.isDirect() && experimentalFeatureSettings.isEnabled(Xp::Flakes)) + if (!state.settings.pureEval && !input.isDirect()) input = lookupInRegistries(state.store, input).first; if (state.settings.pureEval && !input.isLocked()) { @@ -383,7 +379,6 @@ static RegisterPrimOp primop_fetchTree({ - `"mercurial"` *input* can also be a [URL-like reference](@docroot@/command-ref/new-cli/nix3-flake.md#flake-references). - The additional input types and the URL-like syntax requires the [`flakes` experimental feature](@docroot@/contributing/experimental-features.md#xp-feature-flakes) to be enabled. > **Example** > @@ -420,7 +415,6 @@ static RegisterPrimOp primop_fetchTree({ > ``` )", .fun = prim_fetchTree, - .experimentalFeature = Xp::FetchTree, }); static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v, diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index ddb41e63f..d878fb895 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -299,11 +299,6 @@ struct GitArchiveInputScheme : InputScheme input.getNarHash().has_value()); } - std::optional experimentalFeature() const override - { - return Xp::Flakes; - } - std::optional getFingerprint(ref store, const Input & input) const override { if (auto rev = input.getRev()) diff --git a/src/libfetchers/indirect.cc b/src/libfetchers/indirect.cc index ba5078631..e271eabc6 100644 --- a/src/libfetchers/indirect.cc +++ b/src/libfetchers/indirect.cc @@ -102,11 +102,6 @@ struct IndirectInputScheme : InputScheme throw Error("indirect input '%s' cannot be fetched directly", input.to_string()); } - std::optional experimentalFeature() const override - { - return Xp::Flakes; - } - bool isDirect(const Input & input) const override { return false; } }; diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index 68958d559..29ca25ce6 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -174,11 +174,6 @@ struct PathInputScheme : InputScheme return std::nullopt; } } - - std::optional experimentalFeature() const override - { - return Xp::Flakes; - } }; static auto rPathInputScheme = OnStartup([] { registerInputScheme(std::make_unique()); }); diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc index 52cbac5e0..d69934173 100644 --- a/src/libfetchers/registry.cc +++ b/src/libfetchers/registry.cc @@ -156,7 +156,7 @@ struct RegistrySettings : Config When empty, disables the global flake registry. )", - {}, true, Xp::Flakes}; + {}, true}; }; RegistrySettings registrySettings; diff --git a/src/libflake/flake-settings.hh b/src/libflake/flake-settings.hh index f97c175e8..4f986aefd 100644 --- a/src/libflake/flake-settings.hh +++ b/src/libflake/flake-settings.hh @@ -22,8 +22,7 @@ struct FlakeSettings : public Config "use-registries", "Whether to use flake registries to resolve flake references.", {}, - true, - Xp::Flakes}; + true}; Setting acceptFlakeConfig{ this, @@ -31,8 +30,7 @@ struct FlakeSettings : public Config "accept-flake-config", "Whether to accept nix configuration from a flake without prompting.", {}, - true, - Xp::Flakes}; + true}; Setting commitLockFileSummary{ this, @@ -43,8 +41,7 @@ struct FlakeSettings : public Config empty, the summary is generated based on the action performed. )", {"commit-lockfile-summary"}, - true, - Xp::Flakes}; + true}; }; // TODO: don't use a global variable. diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index 6f47b5992..21acb93ee 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -343,8 +343,6 @@ LockedFlake lockFlake( const FlakeRef & topRef, const LockFlags & lockFlags) { - experimentalFeatureSettings.require(Xp::Flakes); - FlakeCache flakeCache; auto useRegistries = lockFlags.useRegistries.value_or(flakeSettings.useRegistries); @@ -744,8 +742,6 @@ void callFlake(EvalState & state, const LockedFlake & lockedFlake, Value & vRes) { - experimentalFeatureSettings.require(Xp::Flakes); - auto [lockFileStr, keyMap] = lockedFlake.lockFile.to_string(); auto overrides = state.buildBindings(lockedFlake.nodePaths.size()); @@ -837,7 +833,6 @@ static RegisterPrimOp r2({ ``` )", .fun = prim_getFlake, - .experimentalFeature = Xp::Flakes, }); static void prim_parseFlakeRef( @@ -881,7 +876,6 @@ static RegisterPrimOp r3({ ``` )", .fun = prim_parseFlakeRef, - .experimentalFeature = Xp::Flakes, }); @@ -938,7 +932,6 @@ static RegisterPrimOp r4({ ``` )", .fun = prim_flakeRefToString, - .experimentalFeature = Xp::Flakes, }); } diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 907ca7fc1..8abf4bc23 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -341,11 +341,9 @@ template<> std::set BaseSetting res; for (auto & s : tokenizeString(str)) { - if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature) { + if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature) res.insert(thisXpFeature.value()); - if (thisXpFeature.value() == Xp::Flakes) - res.insert(Xp::FetchTree); - } else + else warn("unknown experimental feature '%s'", s); } return res; diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 1952ba1b8..a30d1b1ec 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -386,7 +386,7 @@ struct ExperimentalFeatureSettings : Config { Example: ``` - experimental-features = nix-command flakes + experimental-features = nix-command ``` The following experimental features are available: diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index 1c080e372..8ecf1e92b 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -74,8 +74,9 @@ constexpr std::array xpFeatureDetails .tag = Xp::Flakes, .name = "flakes", .description = R"( - Enable flakes. See the manual entry for [`nix - flake`](@docroot@/command-ref/new-cli/nix3-flake.md) for details. + *Enabled for Determinate Nix Installer users since 2.19* + + See the manual entry for [`nix flake`](@docroot@/command-ref/new-cli/nix3-flake.md) for details. )", .trackingUrl = "https://github.com/NixOS/nix/milestone/27", }, @@ -83,6 +84,8 @@ constexpr std::array xpFeatureDetails .tag = Xp::FetchTree, .name = "fetch-tree", .description = R"( + *Enabled for Determinate Nix Installer users since 2.24* + Enable the use of the [`fetchTree`](@docroot@/language/builtins.md#builtins-fetchTree) built-in function in the Nix language. `fetchTree` exposes a generic interface for fetching remote file system trees from different types of remote sources. diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 84c659023..a86e36206 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -1462,12 +1462,6 @@ struct CmdFlake : NixMultiCommand #include "flake.md" ; } - - void run() override - { - experimentalFeatureSettings.require(Xp::Flakes); - NixMultiCommand::run(); - } }; static auto rCmdFlake = registerCommand("flake"); diff --git a/src/nix/main.cc b/src/nix/main.cc index c90bb25a7..85be80da4 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -412,7 +412,6 @@ void mainWrapped(int argc, char * * argv) if (argc == 2 && std::string(argv[1]) == "__dump-language") { experimentalFeatureSettings.experimentalFeatures = { - Xp::Flakes, Xp::FetchClosure, Xp::DynamicDerivations, Xp::FetchTree, diff --git a/src/nix/nix.md b/src/nix/nix.md index 4464bef37..2f59db3af 100644 --- a/src/nix/nix.md +++ b/src/nix/nix.md @@ -69,11 +69,9 @@ That is, Nix will operate on the default flake output attribute of the flake in ### Flake output attribute > **Warning** \ -> Flake output attribute installables depend on both the -> [`flakes`](@docroot@/contributing/experimental-features.md#xp-feature-flakes) -> and +> Flake output attribute installables depend on the > [`nix-command`](@docroot@/contributing/experimental-features.md#xp-feature-nix-command) -> experimental features, and subject to change without notice. +> experimental feature, and subject to change without notice. Example: `nixpkgs#hello` diff --git a/src/nix/repl.md b/src/nix/repl.md index 32c08e24b..e608dabf6 100644 --- a/src/nix/repl.md +++ b/src/nix/repl.md @@ -36,7 +36,7 @@ R""( Loading Installable ''... Added 1 variables. - # nix repl --extra-experimental-features 'flakes' nixpkgs + # nix repl nixpkgs Loading Installable 'flake:nixpkgs#'... Added 5 variables. diff --git a/tests/functional/ca/selfref-gc.sh b/tests/functional/ca/selfref-gc.sh index 248778894..588515db5 100755 --- a/tests/functional/ca/selfref-gc.sh +++ b/tests/functional/ca/selfref-gc.sh @@ -4,7 +4,7 @@ source common.sh requireDaemonNewerThan "2.4pre20210626" -enableFeatures "ca-derivations nix-command flakes" +enableFeatures "ca-derivations nix-command" export NIX_TESTS_CA_BY_DEFAULT=1 cd .. diff --git a/tests/functional/common/init.sh b/tests/functional/common/init.sh index d33ad5d57..482d62cc4 100755 --- a/tests/functional/common/init.sh +++ b/tests/functional/common/init.sh @@ -12,7 +12,7 @@ if isTestOnNixOS; then ! test -e "$test_nix_conf" cat > "$test_nix_conf_dir/nix.conf" < "$NIX_CONF_DIR"/nix.conf.extra <"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr + $gatedSetting = true +" expect 1 nix config show $gatedSetting 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr [[ $(cat "$TEST_ROOT/stdout") = '' ]] -grepQuiet "Ignoring setting 'accept-flake-config' because experimental feature 'flakes' is not enabled" "$TEST_ROOT/stderr" -grepQuiet "error: could not find setting 'accept-flake-config'" "$TEST_ROOT/stderr" +grepQuiet "error: could not find setting '$gatedSetting'" "$TEST_ROOT/stderr" -# 'flakes' experimental-feature is disabled after, ignore and warn -NIX_CONFIG=' - accept-flake-config = true +# Experimental feature is disabled after, ignore and warn. +NIX_CONFIG=" + $gatedSetting = true experimental-features = nix-command -' expect 1 nix config show accept-flake-config 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr +" expect 1 nix config show $gatedSetting 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr [[ $(cat "$TEST_ROOT/stdout") = '' ]] -grepQuiet "Ignoring setting 'accept-flake-config' because experimental feature 'flakes' is not enabled" "$TEST_ROOT/stderr" -grepQuiet "error: could not find setting 'accept-flake-config'" "$TEST_ROOT/stderr" +grepQuiet "error: could not find setting '$gatedSetting'" "$TEST_ROOT/stderr" -# 'flakes' experimental-feature is enabled before, process -NIX_CONFIG=' - experimental-features = nix-command flakes - accept-flake-config = true -' nix config show accept-flake-config 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr +# Experimental feature is enabled before, process. +NIX_CONFIG=" + experimental-features = nix-command $xpFeature + $gatedSetting = true +" nix config show $gatedSetting 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr grepQuiet "true" "$TEST_ROOT/stdout" -grepQuietInverse "Ignoring setting 'accept-flake-config'" "$TEST_ROOT/stderr" -# 'flakes' experimental-feature is enabled after, process -NIX_CONFIG=' - accept-flake-config = true - experimental-features = nix-command flakes -' nix config show accept-flake-config 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr +# Experimental feature is enabled after, process. +NIX_CONFIG=" + $gatedSetting = true + experimental-features = nix-command $xpFeature +" nix config show $gatedSetting 1>"$TEST_ROOT"/stdout 2>"$TEST_ROOT"/stderr grepQuiet "true" "$TEST_ROOT/stdout" -grepQuietInverse "Ignoring setting 'accept-flake-config'" "$TEST_ROOT/stderr" +grepQuietInverse "Ignoring setting '$gatedSetting'" "$TEST_ROOT/stderr" function exit_code_both_ways { - expect 1 nix --experimental-features 'nix-command' "$@" 1>/dev/null - nix --experimental-features 'nix-command flakes' "$@" 1>/dev/null + expect 1 nix --experimental-features 'nix-command ' "$@" 1>/dev/null + nix --experimental-features "nix-command $xpFeature" "$@" 1>/dev/null # Also, the order should not matter expect 1 nix "$@" --experimental-features 'nix-command' 1>/dev/null - nix "$@" --experimental-features 'nix-command flakes' 1>/dev/null + nix "$@" --experimental-features "nix-command $xpFeature" 1>/dev/null } -exit_code_both_ways show-config --flake-registry 'https://no' +exit_code_both_ways config show --auto-allocate-uids # Double check these are stable nix --experimental-features '' --help 1>/dev/null diff --git a/tests/functional/repl.sh b/tests/functional/repl.sh index 86cd6f458..40035785f 100755 --- a/tests/functional/repl.sh +++ b/tests/functional/repl.sh @@ -140,9 +140,9 @@ EOF testReplResponse ' foo + baz ' "3" \ - ./flake ./flake\#bar --experimental-features 'flakes' + ./flake ./flake\#bar -# Test the `:reload` mechansim with flakes: +# Test the `:reload` mechanism with flakes: # - Eval `./flake#changingThing` # - Modify the flake # - Re-eval it @@ -153,7 +153,7 @@ sleep 1 # Leave the repl the time to eval 'foo' sed -i 's/beforeChange/afterChange/' flake/flake.nix echo ":reload" echo "changingThing" -) | nix repl ./flake --experimental-features 'flakes') +) | nix repl ./flake) echo "$replResult" | grepQuiet -s beforeChange echo "$replResult" | grepQuiet -s afterChange diff --git a/tests/nixos/github-flakes.nix b/tests/nixos/github-flakes.nix index 221045009..9a1ed749c 100644 --- a/tests/nixos/github-flakes.nix +++ b/tests/nixos/github-flakes.nix @@ -143,7 +143,7 @@ in virtualisation.additionalPaths = [ pkgs.hello pkgs.fuse ]; virtualisation.memorySize = 4096; nix.settings.substituters = lib.mkForce [ ]; - nix.extraOptions = "experimental-features = nix-command flakes"; + nix.extraOptions = "experimental-features = nix-command"; networking.hosts.${(builtins.head nodes.github.networking.interfaces.eth1.ipv4.addresses).address} = [ "channels.nixos.org" "api.github.com" "github.com" ]; security.pki.certificateFiles = [ "${cert}/ca.crt" ]; diff --git a/tests/nixos/sourcehut-flakes.nix b/tests/nixos/sourcehut-flakes.nix index 04f3590e1..4eeab42db 100644 --- a/tests/nixos/sourcehut-flakes.nix +++ b/tests/nixos/sourcehut-flakes.nix @@ -104,7 +104,7 @@ in virtualisation.memorySize = 4096; nix.settings.substituters = lib.mkForce [ ]; nix.extraOptions = '' - experimental-features = nix-command flakes + experimental-features = nix-command flake-registry = https://git.sr.ht/~NixOS/flake-registry/blob/master/flake-registry.json ''; environment.systemPackages = [ pkgs.jq ]; diff --git a/tests/nixos/tarball-flakes.nix b/tests/nixos/tarball-flakes.nix index 84cf377ec..2a21d8738 100644 --- a/tests/nixos/tarball-flakes.nix +++ b/tests/nixos/tarball-flakes.nix @@ -51,7 +51,7 @@ in virtualisation.additionalPaths = [ pkgs.hello pkgs.fuse ]; virtualisation.memorySize = 4096; nix.settings.substituters = lib.mkForce [ ]; - nix.extraOptions = "experimental-features = nix-command flakes"; + nix.extraOptions = "experimental-features = nix-command"; }; }; diff --git a/tests/unit/libutil/config.cc b/tests/unit/libutil/config.cc index 886e70da5..f3dc2876a 100644 --- a/tests/unit/libutil/config.cc +++ b/tests/unit/libutil/config.cc @@ -191,7 +191,7 @@ namespace nix { "description", {}, true, - Xp::Flakes, + Xp::CaDerivations, }; setting.assign("value"); @@ -203,7 +203,7 @@ namespace nix { "description": "description\n", "documentDefault": true, "value": "value", - "experimentalFeature": "flakes" + "experimentalFeature": "ca-derivations" } })#"_json); } From 16c8f9016b9438e7445acd65445d89b424dd57dc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Jul 2024 16:42:37 +0200 Subject: [PATCH 2/3] Remove unneeded --experimental-features --- .github/workflows/ci.yml | 2 +- src/libflake/flake-settings.hh | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 832aa3ff0..d8c5439bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: with: flakehub: true - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix --experimental-features 'nix-command' flake check -L + - run: nix flake check -L vm_tests: needs: tests diff --git a/src/libflake/flake-settings.hh b/src/libflake/flake-settings.hh index 4f986aefd..a601e120c 100644 --- a/src/libflake/flake-settings.hh +++ b/src/libflake/flake-settings.hh @@ -17,12 +17,7 @@ struct FlakeSettings : public Config FlakeSettings(); Setting useRegistries{ - this, - true, - "use-registries", - "Whether to use flake registries to resolve flake references.", - {}, - true}; + this, true, "use-registries", "Whether to use flake registries to resolve flake references.", {}, true}; Setting acceptFlakeConfig{ this, From 50d7ce6c6a2a98d949aa0b2147c9ce9f22a9f2e6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Jul 2024 16:49:46 +0200 Subject: [PATCH 3/3] Actually remove the "flakes" experimental feature To avoid annoying warnings, this is now a "stabilized" feature. --- src/libutil/config.cc | 4 +++- src/libutil/experimental-features.cc | 18 +++++++----------- src/libutil/experimental-features.hh | 3 ++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 8abf4bc23..9946bed78 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -341,8 +341,10 @@ template<> std::set BaseSetting res; for (auto & s : tokenizeString(str)) { - if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature) + if (auto thisXpFeature = parseExperimentalFeature(s)) res.insert(thisXpFeature.value()); + else if (stabilizedFeatures.count(s)) + debug("experimental feature '%s' is now stable", s); else warn("unknown experimental feature '%s'", s); } diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index 8ecf1e92b..b54a0cdc5 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -70,16 +70,6 @@ constexpr std::array xpFeatureDetails )", .trackingUrl = "https://github.com/NixOS/nix/milestone/42", }, - { - .tag = Xp::Flakes, - .name = "flakes", - .description = R"( - *Enabled for Determinate Nix Installer users since 2.19* - - See the manual entry for [`nix flake`](@docroot@/command-ref/new-cli/nix3-flake.md) for details. - )", - .trackingUrl = "https://github.com/NixOS/nix/milestone/27", - }, { .tag = Xp::FetchTree, .name = "fetch-tree", @@ -302,12 +292,18 @@ constexpr std::array xpFeatureDetails static_assert( []() constexpr { for (auto [index, feature] : enumerate(xpFeatureDetails)) - if (index != (size_t)feature.tag) + if (index != (size_t) feature.tag) return false; return true; }(), "array order does not match enum tag order"); +/** + * A set of previously experimental features that are now considered + * stable. We don't warn if users have these in `experimental-features`. + */ +std::set stabilizedFeatures{"flakes"}; + const std::optional parseExperimentalFeature(const std::string_view & name) { using ReverseXpMap = std::map; diff --git a/src/libutil/experimental-features.hh b/src/libutil/experimental-features.hh index 1da2a3ff5..f195c232c 100644 --- a/src/libutil/experimental-features.hh +++ b/src/libutil/experimental-features.hh @@ -19,7 +19,6 @@ enum struct ExperimentalFeature { CaDerivations, ImpureDerivations, - Flakes, FetchTree, NixCommand, GitHashing, @@ -38,6 +37,8 @@ enum struct ExperimentalFeature VerifiedFetches, }; +extern std::set stabilizedFeatures; + /** * Just because writing `ExperimentalFeature::CaDerivations` is way too long */