aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/local-derivation-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-07-26 19:24:38 +0200
committereldritch horrors <pennae@lix.systems>2024-08-02 13:52:15 +0000
commitdfcab1c3f09971cba6a198ba81158d1190975165 (patch)
tree36f4287da46b9fae2d864fb6c6d8c30a5240d46a /src/libstore/build/local-derivation-goal.cc
parent724b345eb985404065a930304b82112a80ee92d3 (diff)
libstore: return finishedness from Goal methods
this is the first step towards removing all result-related mutation of Goal state from goal implementations themselves, and into Worker state instead. once that is done we can treat all non-const Goal fields like private state of the goal itself, and make threading of goals possible Change-Id: I69ff7d02a6fd91a65887c6640bfc4f5fb785b45c
Diffstat (limited to 'src/libstore/build/local-derivation-goal.cc')
-rw-r--r--src/libstore/build/local-derivation-goal.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 2f1f338c1..fb5ccc6f1 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -161,7 +161,7 @@ void LocalDerivationGoal::killSandbox(bool getStats)
}
-void LocalDerivationGoal::tryLocalBuild()
+Goal::WorkResult LocalDerivationGoal::tryLocalBuild()
{
#if __APPLE__
additionalSandboxProfile = parsedDrv->getStringAttr("__sandboxProfile").value_or("");
@@ -172,7 +172,7 @@ void LocalDerivationGoal::tryLocalBuild()
state = &DerivationGoal::tryToBuild;
worker.waitForBuildSlot(shared_from_this());
outputLocks.unlock();
- return;
+ return StillAlive{};
}
assert(derivationType);
@@ -215,7 +215,7 @@ void LocalDerivationGoal::tryLocalBuild()
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
fmt("waiting for a free build user ID for '%s'", Magenta(worker.store.printStorePath(drvPath))));
worker.waitForAWhile(shared_from_this());
- return;
+ return StillAlive{};
}
}
@@ -250,15 +250,14 @@ void LocalDerivationGoal::tryLocalBuild()
outputLocks.unlock();
buildUser.reset();
worker.permanentFailure = true;
- done(BuildResult::InputRejected, {}, std::move(e));
- return;
+ return done(BuildResult::InputRejected, {}, std::move(e));
}
/* This state will be reached when we get EOF on the child's
log pipe. */
state = &DerivationGoal::buildDone;
- started();
+ return started();
}