diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 9f529c753..564c12f9e 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -1005,6 +1005,8 @@ DerivationOutput DerivationOutput::fromJSON( // remaining to parse, will be mutated by parsers std::string_view s = hashAlgo; ContentAddressMethod method = ContentAddressMethod::parsePrefix(s); + if (method == TextIngestionMethod {}) + xpSettings.require(Xp::DynamicDerivations); auto hashType = parseHashType(s); return { std::move(method), std::move(hashType) }; }; diff --git a/src/libstore/tests/derivation.cc b/src/libstore/tests/derivation.cc index 48524a710..85e451b29 100644 --- a/src/libstore/tests/derivation.cc +++ b/src/libstore/tests/derivation.cc @@ -26,6 +26,14 @@ class CaDerivationTest : public DerivationTest } }; +class DynDerivationTest : public DerivationTest +{ + void SetUp() override + { + mockXpSettings.set("experimental-features", "dynamic-derivations ca-derivations"); + } +}; + class ImpureDerivationTest : public DerivationTest { void SetUp() override @@ -83,7 +91,7 @@ TEST_JSON(DerivationTest, caFixed, }), "drv-name", "output-name") -TEST_JSON(CaDerivationTest, caFixedText, +TEST_JSON(DynDerivationTest, caFixedText, R"({ "hashAlgo": "text:sha256", "hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f",