1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Merge remote-tracking branch 'upstream/master' into path-info

This commit is contained in:
John Ericson 2021-10-01 17:12:54 +00:00
commit 13b6b64589
24 changed files with 632 additions and 100 deletions

View file

@ -208,10 +208,10 @@ StorePath Store::makeFixedOutputPathFromCA(const StorePathDescriptor & desc) con
{
// New template
return std::visit(overloaded {
[&](TextInfo ti) {
[&](const TextInfo & ti) {
return makeTextPath(desc.name, ti);
},
[&](FixedOutputInfo foi) {
[&](const FixedOutputInfo & foi) {
return makeFixedOutputPath(desc.name, foi);
}
}, desc.info);
@ -1150,13 +1150,13 @@ std::optional<StorePathDescriptor> ValidPathInfo::fullStorePathDescriptorOpt() c
return StorePathDescriptor {
.name = std::string { path.name() },
.info = std::visit(overloaded {
[&](TextHash th) {
[&](const TextHash & th) {
TextInfo info { th };
assert(!hasSelfReference);
info.references = references;
return ContentAddressWithReferences { info };
},
[&](FixedOutputHash foh) {
[&](const FixedOutputHash & foh) {
FixedOutputInfo info { foh };
info.references = static_cast<PathReferences<StorePath>>(*this);
return ContentAddressWithReferences { info };
@ -1218,11 +1218,11 @@ ValidPathInfo::ValidPathInfo(
, narHash(narHash)
{
std::visit(overloaded {
[this](TextInfo ti) {
[this](const TextInfo & ti) {
this->references = ti.references;
this->ca = TextHash { std::move(ti) };
},
[this](FixedOutputInfo foi) {
[this](const FixedOutputInfo & foi) {
*(static_cast<PathReferences<StorePath> *>(this)) = foi.references;
this->ca = FixedOutputHash { (FixedOutputHash) std::move(foi) };
},