From 2cc420c1e5b335cb822cb996ef36ad01ef55ddef Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 16 May 2025 13:16:18 +0200 Subject: [PATCH] libstore: remove ca derivation read support we can now no longer read ca store derivations from disk. Change-Id: I233edea597b550dd7e8c78a555b7f12760a993dd --- lix/libstore/derivations.cc | 24 ++----------------- .../derivation/output-caFloating.json | 3 --- tests/unit/libstore/derivation.cc | 15 ------------ 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 tests/unit/libstore/data/libstore/derivation/output-caFloating.json diff --git a/lix/libstore/derivations.cc b/lix/libstore/derivations.cc index 9f02eba30..e437a2b2f 100644 --- a/lix/libstore/derivations.cc +++ b/lix/libstore/derivations.cc @@ -256,13 +256,7 @@ static DerivationOutput parseDerivationOutput( }, }; } else { - xpSettings.require(Xp::CaDerivations); - if (pathS != "") - throw FormatError("content-addressed derivation output should not specify output path"); - return DerivationOutput::CAFloating { - .method = std::move(method), - .hashType = std::move(hashType), - }; + throw UnimplementedError("ca derivations are not supported"); } } else { if (pathS == "") { @@ -923,19 +917,10 @@ static bool tryResolveInput( return actualPathOpt; }; - auto getPlaceholder = [&](const std::string & outputName) { - return DownstreamPlaceholder::unknownCaOutput(inputDrv, outputName); - }; - for (auto & outputName : inputNode) { auto actualPathOpt = getOutput(outputName); if (!actualPathOpt) return false; auto actualPath = *actualPathOpt; - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { - inputRewrites.emplace( - getPlaceholder(outputName).render(), - store.printStorePath(actualPath)); - } inputSrcs.insert(std::move(actualPath)); } @@ -1104,12 +1089,7 @@ DerivationOutput DerivationOutput::fromJSON( } else if (keys == (std::set { "hashAlgo" })) { - xpSettings.require(Xp::CaDerivations); - auto [method, hashType] = methodAlgo(); - return DerivationOutput::CAFloating { - .method = std::move(method), - .hashType = std::move(hashType), - }; + throw UnimplementedError("ca derivations are not supported"); } else if (keys == (std::set { })) { diff --git a/tests/unit/libstore/data/libstore/derivation/output-caFloating.json b/tests/unit/libstore/data/libstore/derivation/output-caFloating.json deleted file mode 100644 index 9115de851..000000000 --- a/tests/unit/libstore/data/libstore/derivation/output-caFloating.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "hashAlgo": "r:sha256" -} diff --git a/tests/unit/libstore/derivation.cc b/tests/unit/libstore/derivation.cc index 69fe7c484..21788ecf9 100644 --- a/tests/unit/libstore/derivation.cc +++ b/tests/unit/libstore/derivation.cc @@ -26,14 +26,6 @@ public: } }; -class CaDerivationTest : public DerivationTest -{ - void SetUp() override - { - mockXpSettings.experimentalFeatures.override(ExperimentalFeatures{} | Xp::CaDerivations); - } -}; - TEST_F(DerivationTest, BadATerm_version) { ASSERT_THROW( parseDerivation( @@ -110,13 +102,6 @@ TEST_JSON(DerivationTest, caFixedNAR, }), "drv-name", "output-name") -TEST_JSON(CaDerivationTest, caFloating, - (DerivationOutput::CAFloating { - .method = FileIngestionMethod::Recursive, - .hashType = HashType::SHA256, - }), - "drv-name", "output-name") - TEST_JSON(DerivationTest, deferred, DerivationOutput::Deferred { }, "drv-name", "output-name")