Merge pull request #8406 from NixOS/fix-ca-attrs-false

Restore Nix 2.3 behaviour for {__impure,__contentAddressed} = false
This commit is contained in:
Eelco Dolstra 2023-05-30 11:59:14 +02:00 committed by GitHub
commit ecae62020b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1152,15 +1152,13 @@ drvName, Bindings * attrs, Value & v)
if (i->value->type() == nNull) continue; if (i->value->type() == nNull) continue;
} }
if (i->name == state.sContentAddressed) { if (i->name == state.sContentAddressed && state.forceBool(*i->value, noPos, context_below)) {
contentAddressed = state.forceBool(*i->value, noPos, context_below); contentAddressed = true;
if (contentAddressed)
experimentalFeatureSettings.require(Xp::CaDerivations); experimentalFeatureSettings.require(Xp::CaDerivations);
} }
else if (i->name == state.sImpure) { else if (i->name == state.sImpure && state.forceBool(*i->value, noPos, context_below)) {
isImpure = state.forceBool(*i->value, noPos, context_below); isImpure = true;
if (isImpure)
experimentalFeatureSettings.require(Xp::ImpureDerivations); experimentalFeatureSettings.require(Xp::ImpureDerivations);
} }