Require (new) computed-derivations experimental feature for ! installable

This commit is contained in:
John Ericson 2022-04-01 03:57:51 +00:00
parent 9c6be01d5f
commit 6951b26ed0
4 changed files with 6 additions and 0 deletions

View file

@ -740,6 +740,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
result.push_back(std::make_shared<InstallableIndexedStorePath>( result.push_back(std::make_shared<InstallableIndexedStorePath>(
store, store,
DerivedPath::Built::parse(*store, s))); DerivedPath::Built::parse(*store, s)));
settings.requireExperimentalFeature(Xp::ComputedDerivations);
continue; continue;
} catch (BadStorePath &) { } catch (BadStorePath &) {
} catch (...) { } catch (...) {

View file

@ -13,6 +13,7 @@ std::map<ExperimentalFeature, std::string> stringifiedXpFeatures = {
{ Xp::RecursiveNix, "recursive-nix" }, { Xp::RecursiveNix, "recursive-nix" },
{ Xp::NoUrlLiterals, "no-url-literals" }, { Xp::NoUrlLiterals, "no-url-literals" },
{ Xp::FetchClosure, "fetch-closure" }, { Xp::FetchClosure, "fetch-closure" },
{ Xp::ComputedDerivations, "computed-derivations" },
}; };
const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name) const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name)

View file

@ -22,6 +22,7 @@ enum struct ExperimentalFeature
RecursiveNix, RecursiveNix,
NoUrlLiterals, NoUrlLiterals,
FetchClosure, FetchClosure,
ComputedDerivations, // RFC 92
}; };
/** /**

View file

@ -1,5 +1,8 @@
source common.sh source common.sh
enableFeatures "computed-derivations"
restartDaemon
drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath) drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath)
if nix build "$drv!not-an-output" --json; then if nix build "$drv!not-an-output" --json; then
fail "'not-an-output' should fail to build" fail "'not-an-output' should fail to build"