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:
parent
1de97bbe2e
commit
e87ba85705
3 changed files with 118 additions and 5 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue