aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/substitution-goal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build/substitution-goal.cc')
-rw-r--r--src/libstore/build/substitution-goal.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index c4b0de78d..ac646c3a5 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -85,7 +85,10 @@ void SubstitutionGoal::tryNext()
subs.pop_front();
if (ca) {
- subPath = sub->makeFixedOutputPathFromCA(storePath.name(), *ca);
+ subPath = sub->makeFixedOutputPathFromCA({
+ .name = std::string { storePath.name() },
+ .info = caWithoutRefs(*ca),
+ });
if (sub->storeDir == worker.store.storeDir)
assert(subPath == storePath);
} else if (sub->storeDir != worker.store.storeDir) {
@@ -115,7 +118,7 @@ void SubstitutionGoal::tryNext()
}
if (info->path != storePath) {
- if (info->isContentAddressed(*sub) && info->references.empty()) {
+ if (info->isContentAddressed(*sub) && info->references.empty() && !info->hasSelfReference) {
auto info2 = std::make_shared<ValidPathInfo>(*info);
info2->path = storePath;
info = info2;
@@ -153,8 +156,7 @@ void SubstitutionGoal::tryNext()
/* To maintain the closure invariant, we first have to realise the
paths referenced by this one. */
for (auto & i : info->references)
- if (i != storePath) /* ignore self-references */
- addWaitee(worker.makeSubstitutionGoal(i));
+ addWaitee(worker.makeSubstitutionGoal(i));
if (waitees.empty()) /* to prevent hang (no wake-up event) */
referencesValid();
@@ -174,8 +176,7 @@ void SubstitutionGoal::referencesValid()
}
for (auto & i : info->references)
- if (i != storePath) /* ignore self-references */
- assert(worker.store.isValidPath(i));
+ assert(worker.store.isValidPath(i));
state = &SubstitutionGoal::tryToRun;
worker.wakeUp(shared_from_this());