libstore: remove ca derivation read support

we can now no longer read ca store derivations from disk.

Change-Id: I233edea597b550dd7e8c78a555b7f12760a993dd
This commit is contained in:
eldritch horrors
2025-05-20 13:27:04 +02:00
parent 8d5bc9ed48
commit 2cc420c1e5
3 changed files with 2 additions and 40 deletions
+2 -22
View File
@@ -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<std::string_view> { "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<std::string_view> { })) {
@@ -1,3 +0,0 @@
{
"hashAlgo": "r:sha256"
}
-15
View File
@@ -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")