aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/derivation-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-14 12:32:26 +0200
committerjade <lix@jade.fyi>2024-08-19 09:13:44 +0000
commitb40369942cdb3e713c473515b9760f8a0d2ed3cc (patch)
tree8d49819ec6ddbc9d5dfef8aa6d04b8791e7b27e9 /src/libstore/build/derivation-goal.cc
parentfca523d66126ea1df7c3eda9ab1a2c9b7b1c7ba5 (diff)
libstore: make Worker::childStarted private
this can be a proper WorkResult now. childTerminated is unfortunately a lot more stubborn and won't be made private for quite a while yet. once we can get rid of the Worker poll loop that *should* be possible though Change-Id: I2218df202da5cb84e852f6a37e4c20367495b617
Diffstat (limited to 'src/libstore/build/derivation-goal.cc')
-rw-r--r--src/libstore/build/derivation-goal.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index a1f628afc..f31c3acd5 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -646,7 +646,7 @@ Goal::WorkResult DerivationGoal::inputsRealised(bool inBuildSlot)
return ContinueImmediately{};
}
-Goal::WorkResult DerivationGoal::started()
+void DerivationGoal::started()
{
auto msg = fmt(
buildMode == bmRepair ? "repairing outputs of '%s'" :
@@ -657,7 +657,6 @@ Goal::WorkResult DerivationGoal::started()
act = std::make_unique<Activity>(*logger, lvlInfo, actBuild, msg,
Logger::Fields{worker.store.printStorePath(drvPath), hook ? machineName : "", 1, 1});
mcRunningBuilds = std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds);
- return StillAlive{};
}
Goal::WorkResult DerivationGoal::tryToBuild(bool inBuildSlot)
@@ -735,13 +734,14 @@ Goal::WorkResult DerivationGoal::tryToBuild(bool inBuildSlot)
auto hookReply = tryBuildHook(inBuildSlot);
auto result = std::visit(
overloaded{
- [&](HookReply::Accept) -> std::optional<WorkResult> {
+ [&](HookReply::Accept & a) -> std::optional<WorkResult> {
/* Yes, it has started doing so. Wait until we get
EOF from the hook. */
actLock.reset();
buildResult.startTime = time(0); // inexact
state = &DerivationGoal::buildDone;
- return started();
+ started();
+ return WaitForWorld{std::move(a.fds), false};
},
[&](HookReply::Postpone) -> std::optional<WorkResult> {
/* Not now; wait until at least one child finishes or
@@ -1222,9 +1222,8 @@ HookReply DerivationGoal::tryBuildHook(bool inBuildSlot)
fds.insert(hook->fromHook.get());
fds.insert(hook->builderOut.get());
builderOutFD = &hook->builderOut;
- worker.childStarted(shared_from_this(), fds, false);
- return HookReply::Accept{};
+ return HookReply::Accept{std::move(fds)};
}