aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-09-25 23:57:46 +0200
committereldritch horrors <pennae@lix.systems>2024-09-29 15:29:56 +0000
commitaa33c34c9be074c9452976aa96d71091325c83ea (patch)
treef27c04e2cf373c3e4a5201d68b18d9f86b29e95c /src/libstore/build
parentccd28626663d0024f04c31f121586f951b2283ab (diff)
libstore: merge ContinueImmediately and StillAlive
nothing needs to signal being still active but not actively pollable, only that immediate polling for the next goal work phase is in order. Change-Id: Ia43c1015e94ba4f5f6b9cb92943da608c4a01555
Diffstat (limited to 'src/libstore/build')
-rw-r--r--src/libstore/build/derivation-goal.cc2
-rw-r--r--src/libstore/build/drv-output-substitution-goal.cc2
-rw-r--r--src/libstore/build/goal.cc6
-rw-r--r--src/libstore/build/goal.hh2
-rw-r--r--src/libstore/build/substitution-goal.cc2
-rw-r--r--src/libstore/build/worker.cc3
6 files changed, 7 insertions, 10 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index f28285ad8..b4f3aaf6f 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -1751,7 +1751,7 @@ DerivationGoal::continueOrError(kj::Promise<Outcome<void, Goal::Finished>> p)
{
return p.then([](auto r) -> Result<WorkResult> {
if (r.has_value()) {
- return ContinueImmediately{};
+ return StillAlive{};
} else if (r.has_error()) {
return r.assume_error();
} else {
diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc
index 846268a3a..87a8b0c55 100644
--- a/src/libstore/build/drv-output-substitution-goal.cc
+++ b/src/libstore/build/drv-output-substitution-goal.cc
@@ -86,7 +86,7 @@ try {
});
state = &DrvOutputSubstitutionGoal::realisationFetched;
- return pipe.promise.then([]() -> Result<WorkResult> { return ContinueImmediately{}; });
+ return pipe.promise.then([]() -> Result<WorkResult> { return StillAlive{}; });
} catch (...) {
return {std::current_exception()};
}
diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc
index 957bc2aaf..cfdb6717c 100644
--- a/src/libstore/build/goal.cc
+++ b/src/libstore/build/goal.cc
@@ -17,7 +17,7 @@ try {
/* If we are polling goals that are waiting for a lock, then wake
up after a few seconds at most. */
co_await worker.aio.provider->getTimer().afterDelay(settings.pollInterval.get() * kj::SECONDS);
- co_return ContinueImmediately{};
+ co_return StillAlive{};
} catch (...) {
co_return std::current_exception();
}
@@ -45,11 +45,11 @@ try {
waiteeDone(dep);
if (dep->exitCode == ecFailed && !settings.keepGoing) {
- co_return result::success(ContinueImmediately{});
+ co_return result::success(StillAlive{});
}
}
- co_return result::success(ContinueImmediately{});
+ co_return result::success(StillAlive{});
} catch (...) {
co_return result::failure(std::current_exception());
}
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index 4436e44b1..17c3d85db 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -103,7 +103,6 @@ public:
struct Finished;
struct [[nodiscard]] StillAlive {};
- struct [[nodiscard]] ContinueImmediately {};
struct [[nodiscard]] Finished {
ExitCode exitCode;
BuildResult result;
@@ -116,7 +115,6 @@ public:
struct [[nodiscard]] WorkResult : std::variant<
StillAlive,
- ContinueImmediately,
Finished>
{
WorkResult() = delete;
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index d9d8f1a7d..cbbd9daf2 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -240,7 +240,7 @@ try {
});
state = &PathSubstitutionGoal::finished;
- return pipe.promise.then([]() -> Result<WorkResult> { return ContinueImmediately{}; });
+ return pipe.promise.then([]() -> Result<WorkResult> { return StillAlive{}; });
} catch (...) {
return {std::current_exception()};
}
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index 94a638725..b23b2800e 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -212,8 +212,7 @@ void Worker::handleWorkResult(GoalPtr goal, Goal::WorkResult how)
{
std::visit(
overloaded{
- [&](Goal::StillAlive) {},
- [&](Goal::ContinueImmediately) { wakeUp(goal); },
+ [&](Goal::StillAlive) { wakeUp(goal); },
[&](Goal::Finished & f) { goalFinished(goal, f); },
},
how