aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/drv-output-substitution-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-07-26 20:19:21 +0200
committereldritch horrors <pennae@lix.systems>2024-08-02 13:52:15 +0000
commite5177dddff13e7e5bb1bdecf28776822c6dba528 (patch)
tree16245e3f8424990787c0195449e3dde356db5259 /src/libstore/build/drv-output-substitution-goal.cc
parentdfcab1c3f09971cba6a198ba81158d1190975165 (diff)
libstore: move Goal::amDone to Worker
we still mutate goal state to store the results of any given goal run, but now we also have that information in Worker and could in theory do something else with it. we could return a map of goal to goal results, which would also let us better diagnose failures of subgoals (at all). Change-Id: I1df956bbd9fa8cc9485fb6df32918d68dda3ff48
Diffstat (limited to 'src/libstore/build/drv-output-substitution-goal.cc')
-rw-r--r--src/libstore/build/drv-output-substitution-goal.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc
index 4d10543cd..62e86e1cc 100644
--- a/src/libstore/build/drv-output-substitution-goal.cc
+++ b/src/libstore/build/drv-output-substitution-goal.cc
@@ -26,7 +26,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::init()
/* If the derivation already exists, we’re done */
if (worker.store.queryRealisation(id)) {
- return amDone(ecSuccess);
+ return Finished{ecSuccess};
}
subs = settings.useSubstitutes ? getDefaultSubstituters() : std::list<ref<Store>>();
@@ -60,7 +60,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::tryNext()
/* Hack: don't indicate failure if there were no substituters.
In that case the calling derivation should just do a
build. */
- return amDone(substituterFailed ? ecFailed : ecNoSubstituters);
+ return Finished{substituterFailed ? ecFailed : ecNoSubstituters};
}
sub = subs.front();
@@ -137,7 +137,9 @@ Goal::WorkResult DrvOutputSubstitutionGoal::outPathValid()
if (nrFailed > 0) {
debug("The output path of the derivation output '%s' could not be substituted", id.to_string());
- return amDone(nrNoSubstituters > 0 || nrIncompleteClosure > 0 ? ecIncompleteClosure : ecFailed);
+ return Finished{
+ nrNoSubstituters > 0 || nrIncompleteClosure > 0 ? ecIncompleteClosure : ecFailed
+ };
}
worker.store.registerDrvOutput(*outputInfo);
@@ -147,7 +149,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::outPathValid()
Goal::WorkResult DrvOutputSubstitutionGoal::finished()
{
trace("finished");
- return amDone(ecSuccess);
+ return Finished{ecSuccess};
}
std::string DrvOutputSubstitutionGoal::key()