diff options
author | eldritch horrors <pennae@lix.systems> | 2024-08-30 19:01:30 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-08-30 19:01:30 +0200 |
commit | d75df91f74b6819f674f0733143fdf32580af183 (patch) | |
tree | 0b30c89b598b1163ceb310b68ffce1807cbfe858 /src/libstore/build/drv-output-substitution-goal.cc | |
parent | a385c5935aa7cfec4de47cfe5620bca2e0e0e55d (diff) |
libstore: add build result to Goal::Finished
it just makes sense to have it too, rather than just the pass/fail
information we keep so far. once we turn goals into something more
promise-shaped it'll also help detangle the current data flow mess
Change-Id: I915cf04d177cad849ea7a5833215d795326f1946
Diffstat (limited to 'src/libstore/build/drv-output-substitution-goal.cc')
-rw-r--r-- | src/libstore/build/drv-output-substitution-goal.cc | 10 |
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 369b2dd90..d7a7d257c 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -1,4 +1,5 @@ #include "drv-output-substitution-goal.hh" +#include "build-result.hh" #include "finally.hh" #include "worker.hh" #include "substitution-goal.hh" @@ -27,7 +28,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::init(bool inBuildSlot) /* If the derivation already exists, we’re done */ if (worker.store.queryRealisation(id)) { - return Finished{ecSuccess}; + return Finished{ecSuccess, std::move(buildResult)}; } subs = settings.useSubstitutes ? getDefaultSubstituters() : std::list<ref<Store>>(); @@ -56,7 +57,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::tryNext(bool inBuildSlot) /* Hack: don't indicate failure if there were no substituters. In that case the calling derivation should just do a build. */ - return Finished{substituterFailed ? ecFailed : ecNoSubstituters}; + return Finished{substituterFailed ? ecFailed : ecNoSubstituters, std::move(buildResult)}; } sub = subs.front(); @@ -133,7 +134,8 @@ Goal::WorkResult DrvOutputSubstitutionGoal::outPathValid(bool inBuildSlot) if (nrFailed > 0) { debug("The output path of the derivation output '%s' could not be substituted", id.to_string()); return Finished{ - nrNoSubstituters > 0 || nrIncompleteClosure > 0 ? ecIncompleteClosure : ecFailed + nrNoSubstituters > 0 || nrIncompleteClosure > 0 ? ecIncompleteClosure : ecFailed, + std::move(buildResult), }; } @@ -144,7 +146,7 @@ Goal::WorkResult DrvOutputSubstitutionGoal::outPathValid(bool inBuildSlot) Goal::WorkResult DrvOutputSubstitutionGoal::finished() { trace("finished"); - return Finished{ecSuccess}; + return Finished{ecSuccess, std::move(buildResult)}; } std::string DrvOutputSubstitutionGoal::key() |