1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 16:10:59 +01:00

Make ValidPathInfo have plain StorePathSet references like before

This change can wait for another PR.
This commit is contained in:
John Ericson 2023-01-14 16:38:43 -05:00
parent 056cc1c1b9
commit b3d91239ae
24 changed files with 109 additions and 166 deletions

View file

@ -2523,7 +2523,10 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
auto narHashAndSize = hashPath(htSHA256, actualPath);
ValidPathInfo newInfo0 { requiredFinalPath, narHashAndSize.first };
newInfo0.narSize = narHashAndSize.second;
newInfo0.references = rewriteRefs();
auto refs = rewriteRefs();
newInfo0.references = std::move(refs.others);
if (refs.self)
newInfo0.references.insert(newInfo0.path);
return newInfo0;
},
@ -2774,12 +2777,12 @@ void LocalDerivationGoal::checkOutputs(const std::map<std::string, ValidPathInfo
auto i = outputsByPath.find(worker.store.printStorePath(path));
if (i != outputsByPath.end()) {
closureSize += i->second.narSize;
for (auto & ref : i->second.referencesPossiblyToSelf())
for (auto & ref : i->second.references)
pathsLeft.push(ref);
} else {
auto info = worker.store.queryPathInfo(path);
closureSize += info->narSize;
for (auto & ref : info->referencesPossiblyToSelf())
for (auto & ref : info->references)
pathsLeft.push(ref);
}
}
@ -2819,7 +2822,7 @@ void LocalDerivationGoal::checkOutputs(const std::map<std::string, ValidPathInfo
auto used = recursive
? getClosure(info.path).first
: info.referencesPossiblyToSelf();
: info.references;
if (recursive && checks.ignoreSelfRefs)
used.erase(info.path);

View file

@ -165,8 +165,9 @@ void PathSubstitutionGoal::tryNext()
/* To maintain the closure invariant, we first have to realise the
paths referenced by this one. */
for (auto & i : info->references.others)
addWaitee(worker.makePathSubstitutionGoal(i));
for (auto & i : info->references)
if (i != storePath) /* ignore self-references */
addWaitee(worker.makePathSubstitutionGoal(i));
if (waitees.empty()) /* to prevent hang (no wake-up event) */
referencesValid();
@ -187,8 +188,9 @@ void PathSubstitutionGoal::referencesValid()
return;
}
for (auto & i : info->references.others)
assert(worker.store.isValidPath(i));
for (auto & i : info->references)
if (i != storePath) /* ignore self-references */
assert(worker.store.isValidPath(i));
state = &PathSubstitutionGoal::tryToRun;
worker.wakeUp(shared_from_this());