diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-19 14:48:53 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-19 15:00:04 -0400 |
commit | 7103c6da705c8a18fef9e8f8d404e8d0ab5082ff (patch) | |
tree | 53a6fb861243b174292a5d0177fab364461d8de9 /src/libstore/derivations.cc | |
parent | aba8a8a83a89d577769a39a69e9b90e3ed0d4f82 (diff) |
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.
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r-- | src/libstore/derivations.cc | 13 |
1 files changed, 5 insertions, 8 deletions
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<std::string_view> { "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"); |