1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

Inline realisationFetched

Now that we are using coroutines, we don't need this to be a separate
method of `DrvOutputSubstitutionGoal`.
This commit is contained in:
John Ericson 2025-10-14 14:30:09 -04:00
parent 6420879728
commit 1121f0d8ec
2 changed files with 15 additions and 23 deletions

View file

@ -112,7 +112,21 @@ Goal::Co DrvOutputSubstitutionGoal::init()
if (failed) if (failed)
continue; continue;
co_return realisationFetched(std::move(waitees), outputInfo, sub); waitees.insert(worker.makePathSubstitutionGoal(outputInfo->outPath));
co_await await(std::move(waitees));
trace("output path substituted");
if (nrFailed > 0) {
debug("The output path of the derivation output '%s' could not be substituted", id.to_string());
co_return amDone(nrNoSubstituters > 0 ? ecNoSubstituters : ecFailed);
}
worker.store.registerDrvOutput({*outputInfo, id});
trace("finished");
co_return amDone(ecSuccess);
} }
/* None left. Terminate this goal and let someone else deal /* None left. Terminate this goal and let someone else deal
@ -130,26 +144,6 @@ Goal::Co DrvOutputSubstitutionGoal::init()
co_return amDone(substituterFailed ? ecFailed : ecNoSubstituters); co_return amDone(substituterFailed ? ecFailed : ecNoSubstituters);
} }
Goal::Co DrvOutputSubstitutionGoal::realisationFetched(
Goals waitees, std::shared_ptr<const UnkeyedRealisation> outputInfo, nix::ref<nix::Store> sub)
{
waitees.insert(worker.makePathSubstitutionGoal(outputInfo->outPath));
co_await await(std::move(waitees));
trace("output path substituted");
if (nrFailed > 0) {
debug("The output path of the derivation output '%s' could not be substituted", id.to_string());
co_return amDone(nrNoSubstituters > 0 ? ecNoSubstituters : ecFailed);
}
worker.store.registerDrvOutput({*outputInfo, id});
trace("finished");
co_return amDone(ecSuccess);
}
std::string DrvOutputSubstitutionGoal::key() std::string DrvOutputSubstitutionGoal::key()
{ {
return "a$" + std::string(id.to_string()); return "a$" + std::string(id.to_string());

View file

@ -32,8 +32,6 @@ public:
DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker); DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker);
Co init(); Co init();
Co
realisationFetched(Goals waitees, std::shared_ptr<const UnkeyedRealisation> outputInfo, nix::ref<nix::Store> sub);
void timedOut(Error && ex) override void timedOut(Error && ex) override
{ {