From 6951b26ed0a806c03ad73069ccc925ef6ac158e6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 1 Apr 2022 03:57:51 +0000 Subject: [PATCH] Require (new) computed-derivations experimental feature for ! installable --- src/libcmd/installables.cc | 1 + src/libutil/experimental-features.cc | 1 + src/libutil/experimental-features.hh | 1 + tests/build-explicit-output.sh | 3 +++ 4 files changed, 6 insertions(+) diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 1d44ffe84..ab13f11df 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -740,6 +740,7 @@ std::vector> SourceExprCommand::parseInstallables( result.push_back(std::make_shared( store, DerivedPath::Built::parse(*store, s))); + settings.requireExperimentalFeature(Xp::ComputedDerivations); continue; } catch (BadStorePath &) { } catch (...) { diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index e033a4116..c1e574c0d 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -13,6 +13,7 @@ std::map stringifiedXpFeatures = { { Xp::RecursiveNix, "recursive-nix" }, { Xp::NoUrlLiterals, "no-url-literals" }, { Xp::FetchClosure, "fetch-closure" }, + { Xp::ComputedDerivations, "computed-derivations" }, }; const std::optional parseExperimentalFeature(const std::string_view & name) diff --git a/src/libutil/experimental-features.hh b/src/libutil/experimental-features.hh index 3a254b423..58e082c72 100644 --- a/src/libutil/experimental-features.hh +++ b/src/libutil/experimental-features.hh @@ -22,6 +22,7 @@ enum struct ExperimentalFeature RecursiveNix, NoUrlLiterals, FetchClosure, + ComputedDerivations, // RFC 92 }; /** diff --git a/tests/build-explicit-output.sh b/tests/build-explicit-output.sh index fcb263913..0f2f428db 100644 --- a/tests/build-explicit-output.sh +++ b/tests/build-explicit-output.sh @@ -1,5 +1,8 @@ source common.sh +enableFeatures "computed-derivations" +restartDaemon + drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath) if nix build "$drv!not-an-output" --json; then fail "'not-an-output' should fail to build"