aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:37:31 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:45:34 -0500
commit81727f85cb567c4d5282c330d63a74ed84d12783 (patch)
tree5808cba3e02ff55657355562007ddd3a20892dfb /src/libstore/build
parent7e1cfa97c6b410ed25ae0d3c3f10274aae9f6758 (diff)
parent46e942ff9e65755689ee72f93846d7118e1b8d45 (diff)
Merge branch 'path-info' into ca-drv-exotic
Diffstat (limited to 'src/libstore/build')
-rw-r--r--src/libstore/build/local-derivation-goal.cc16
-rw-r--r--src/libstore/build/substitution-goal.cc6
2 files changed, 11 insertions, 11 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 85bab18ba..c7b3d9325 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -2421,26 +2421,26 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
}
};
- auto rewriteRefs = [&]() -> PathReferences<StorePath> {
+ auto rewriteRefs = [&]() -> StoreReferences {
/* In the CA case, we need the rewritten refs to calculate the
final path, therefore we look for a *non-rewritten
self-reference, and use a bool rather try to solve the
computationally intractable fixed point. */
- PathReferences<StorePath> res {
- .hasSelfReference = false,
+ StoreReferences res {
+ .self = false,
};
for (auto & r : references) {
auto name = r.name();
auto origHash = std::string { r.hashPart() };
if (r == *scratchPath) {
- res.hasSelfReference = true;
+ res.self = true;
} else if (auto outputRewrite = get(outputRewrites, origHash)) {
std::string newRef = *outputRewrite;
newRef += '-';
newRef += name;
- res.references.insert(StorePath { newRef });
+ res.others.insert(StorePath { newRef });
} else {
- res.references.insert(r);
+ res.others.insert(r);
}
}
return res;
@@ -2529,7 +2529,7 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
auto narHashAndSize = hashPath(htSHA256, actualPath);
ValidPathInfo newInfo0 { requiredFinalPath, narHashAndSize.first };
newInfo0.narSize = narHashAndSize.second;
- static_cast<PathReferences<StorePath> &>(newInfo0) = rewriteRefs();
+ newInfo0.references = rewriteRefs();
return newInfo0;
},
@@ -2554,7 +2554,7 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
wanted.to_string(SRI, true),
got.to_string(SRI, true)));
}
- if (static_cast<const PathReferences<StorePath> &>(newInfo0) != PathReferences<StorePath> {})
+ if (!newInfo.references.empty())
delayedException = std::make_exception_ptr(
BuildError("illegal path references in fixed-output derivation '%s'",
worker.store.printStorePath(drvPath)));
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index 307183505..36b0ea7a7 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -128,7 +128,7 @@ void PathSubstitutionGoal::tryNext()
}
if (info->path != storePath) {
- if (info->isContentAddressed(*sub) && info->references.empty() && !info->hasSelfReference) {
+ if (info->isContentAddressed(*sub) && info->references.empty()) {
auto info2 = std::make_shared<ValidPathInfo>(*info);
info2->path = storePath;
info = info2;
@@ -165,7 +165,7 @@ void PathSubstitutionGoal::tryNext()
/* To maintain the closure invariant, we first have to realise the
paths referenced by this one. */
- for (auto & i : info->references)
+ for (auto & i : info->references.others)
addWaitee(worker.makePathSubstitutionGoal(i));
if (waitees.empty()) /* to prevent hang (no wake-up event) */
@@ -187,7 +187,7 @@ void PathSubstitutionGoal::referencesValid()
return;
}
- for (auto & i : info->references)
+ for (auto & i : info->references.others)
assert(worker.store.isValidPath(i));
state = &PathSubstitutionGoal::tryToRun;