From 2f9a4a71aa93cf77b0facdcdf454f72549ff9edd Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 11 May 2025 01:51:08 +0200 Subject: [PATCH] libstore: drop support for reading impure derivations writing them is technically still supported because what makes a derivation impure is entirely specified by magically named data, but without derivationStrict being able to pass these through to libstore there is no way (besides reading existing files) to get any new impure derivations into an existing store. it will still be possible to garbage-collect existing impure derivations since the gc process does not need to read them as derivations, and we are not introducing any new kinds of unsupported-feature errors. Change-Id: I648f53129ce67ee2b48d0591219759812dd557da --- lix/libstore/derivations.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lix/libstore/derivations.cc b/lix/libstore/derivations.cc index 9553117cb..bc7eb51c6 100644 --- a/lix/libstore/derivations.cc +++ b/lix/libstore/derivations.cc @@ -276,13 +276,7 @@ static DerivationOutput parseDerivationOutput( xpSettings.require(Xp::DynamicDerivations); const auto hashType = parseHashType(hashAlgo); if (hashS == "impure") { - xpSettings.require(Xp::ImpureDerivations); - if (pathS != "") - throw FormatError("impure derivation output should not specify output path"); - return DerivationOutput::Impure { - .method = std::move(method), - .hashType = std::move(hashType), - }; + throw UnimplementedError("impure derivations are not supported"); } else if (hashS != "") { validatePath(pathS); auto hash = Hash::parseNonSRIUnprefixed(hashS, hashType); @@ -1332,12 +1326,7 @@ DerivationOutput DerivationOutput::fromJSON( } else if (keys == (std::set { "hashAlgo", "impure" })) { - xpSettings.require(Xp::ImpureDerivations); - auto [method, hashType] = methodAlgo(); - return DerivationOutput::Impure { - .method = std::move(method), - .hashType = hashType, - }; + throw UnimplementedError("impure derivations are not supported"); } else {