From 75f234d84b3eeb82447b73352353ca24993ed915 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 11 May 2025 01:51:08 +0200 Subject: [PATCH] libexpr: remove impure derivation creation support Change-Id: I58f481c188c6a6e99d226b4862508cef853b7571 --- lix/libexpr/primops.cc | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lix/libexpr/primops.cc b/lix/libexpr/primops.cc index 2fae74194..0a133f89d 100644 --- a/lix/libexpr/primops.cc +++ b/lix/libexpr/primops.cc @@ -811,7 +811,6 @@ drvName, Bindings * attrs, Value & v) NixStringContext context; bool contentAddressed = false; - bool isImpure = false; std::optional outputHash; std::string outputHashAlgo; std::optional ingestionMethod; @@ -873,8 +872,8 @@ drvName, Bindings * attrs, Value & v) } else if (i->name == state.ctx.s.impure && state.forceBool(*i->value, noPos, context_below)) { - isImpure = true; - experimentalFeatureSettings.require(Xp::ImpureDerivations); + state.ctx.errors.make("impure derivations are not supported in Lix") + .debugThrow(); } /* The `args' attribute is special: it supplies the @@ -1035,28 +1034,17 @@ drvName, Bindings * attrs, Value & v) drv.outputs.insert_or_assign("out", std::move(dof)); } - else if (contentAddressed || isImpure) { - if (contentAddressed && isImpure) - state.ctx.errors.make("derivation cannot be both content-addressed and impure") - .debugThrow(); - + else if (contentAddressed) { auto ht = parseHashTypeOpt(outputHashAlgo).value_or(HashType::SHA256); auto method = ingestionMethod.value_or(FileIngestionMethod::Recursive); for (auto & i : outputs) { drv.env[i] = hashPlaceholder(i); - if (isImpure) - drv.outputs.insert_or_assign(i, - DerivationOutput::Impure { - .method = method, - .hashType = ht, - }); - else - drv.outputs.insert_or_assign(i, - DerivationOutput::CAFloating { - .method = method, - .hashType = ht, - }); + drv.outputs.insert_or_assign(i, + DerivationOutput::CAFloating { + .method = method, + .hashType = ht, + }); } }