From b40369942cdb3e713c473515b9760f8a0d2ed3cc Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Wed, 14 Aug 2024 12:32:26 +0200 Subject: 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 --- src/libstore/build/derivation-goal.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstore/build/derivation-goal.cc') 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(*logger, lvlInfo, actBuild, msg, Logger::Fields{worker.store.printStorePath(drvPath), hook ? machineName : "", 1, 1}); mcRunningBuilds = std::make_unique>(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 { + [&](HookReply::Accept & a) -> std::optional { /* 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 { /* 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)}; } -- cgit v1.2.3