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

Inline buildDone from DerivationGoal into use sites

The basic idea is that while we have duplicated this function, we now
have one call-site in the local build case, and one call site in the
build hook case. This unlocks big opportunities to specialize each copy,
since they really shouldn't be doing the same things. By the time we are
are done, there should not be much duplication left.

See #12628 for further info.
This commit is contained in:
Las 2025-03-10 21:08:35 +00:00 committed by John Ericson
parent 1de97bbe2e
commit e87ba85705
3 changed files with 118 additions and 5 deletions

View file

@ -640,7 +640,7 @@ Goal::Co DerivationGoal::tryToBuild()
buildResult.startTime = time(0); // inexact
started();
co_await Suspend{};
co_return buildDone();
co_return hookDone();
case rpPostpone:
/* Not now; wait until at least one child finishes or
the wake-up timeout expires. */
@ -935,7 +935,7 @@ void appendLogTailErrorMsg(
}
Goal::Co DerivationGoal::buildDone()
Goal::Co DerivationGoal::hookDone()
{
trace("build done");

View file

@ -55,6 +55,13 @@ struct InitialOutput {
std::optional<InitialOutputStatus> known;
};
/** Used internally */
void runPostBuildHook(
Store & store,
Logger & logger,
const StorePath & drvPath,
const StorePathSet & outputPaths);
/** Used internally */
void appendLogTailErrorMsg(
Worker & worker,
@ -246,7 +253,7 @@ struct DerivationGoal : public Goal
Co gaveUpOnSubstitution();
Co tryToBuild();
virtual Co tryLocalBuild();
Co buildDone();
Co hookDone();
Co resolvedFinished();