From 7103c6da705c8a18fef9e8f8d404e8d0ab5082ff Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 19 Apr 2023 14:48:53 -0400 Subject: Remove references from fixed output derivation ab syntax In other words, use a plain `ContentAddress` not `ContentAddressWithReferences` for `DerivationOutput::CAFixed`. Supporting fixed output derivations with (fixed) references would be a cool feature, but it is out of scope at this moment. --- src/libstore/derivations.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/libstore/derivations.cc') diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 564c12f9e..d56dc727b 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -38,7 +38,7 @@ StorePath DerivationOutput::CAFixed::path(const Store & store, std::string_view { return store.makeFixedOutputPathFromCA( outputPathName(drvName, outputName), - ca); + ContentAddressWithReferences::withoutRefs(ca)); } @@ -230,11 +230,9 @@ static DerivationOutput parseDerivationOutput(const Store & store, validatePath(pathS); auto hash = Hash::parseNonSRIUnprefixed(hashS, hashType); return DerivationOutput::CAFixed { - .ca = ContentAddressWithReferences::fromParts( + .ca = ContentAddress::fromParts( std::move(method), - std::move(hash), - // FIXME non-trivial fixed refs set - {}), + std::move(hash)), }; } else { experimentalFeatureSettings.require(Xp::CaDerivations); @@ -1020,10 +1018,9 @@ DerivationOutput DerivationOutput::fromJSON( else if (keys == (std::set { "path", "hashAlgo", "hash" })) { auto [method, hashType] = methodAlgo(); auto dof = DerivationOutput::CAFixed { - .ca = ContentAddressWithReferences::fromParts( + .ca = ContentAddress::fromParts( std::move(method), - Hash::parseNonSRIUnprefixed((std::string) json["hash"], hashType), - {}), + Hash::parseNonSRIUnprefixed((std::string) json["hash"], hashType)), }; if (dof.path(store, drvName, outputName) != store.parseStorePath((std::string) json["path"])) throw Error("Path doesn't match derivation output"); -- cgit v1.2.3