aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/substitution-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-10-20 22:55:00 +0200
committereldritch horrors <pennae@lix.systems>2024-10-23 11:55:12 +0000
commitb8cc54df0a7748e1af5b2f0acbf548c5bcab6f56 (patch)
tree69d3aaa50f44383cc6449c8a82f3325d6b66679e /src/libstore/build/substitution-goal.cc
parent67f1aafd610c028b160f2f2ac805e671ed7073de (diff)
libstore: return relevant store path in goal result
we now do not need the goal pointers any more to process worker results. Change-Id: I1a021b862ca666bcd23fee9f38973e90e6f94a72
Diffstat (limited to 'src/libstore/build/substitution-goal.cc')
-rw-r--r--src/libstore/build/substitution-goal.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index e0ca23a86..2d0c594ac 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -3,6 +3,7 @@
#include "nar-info.hh"
#include "signals.hh"
#include "finally.hh"
+#include <boost/outcome/try.hpp>
#include <kj/array.h>
#include <kj/vector.h>
@@ -54,7 +55,7 @@ try {
/* If the path already exists we're done. */
if (!repair && worker.store.isValidPath(storePath)) {
- return {done(ecSuccess, BuildResult::AlreadyValid)};
+ co_return done(ecSuccess, BuildResult::AlreadyValid);
}
if (settings.readOnlyMode)
@@ -62,9 +63,11 @@ try {
subs = settings.useSubstitutes ? getDefaultSubstituters() : std::list<ref<Store>>();
- return tryNext();
+ BOOST_OUTCOME_CO_TRY(auto result, co_await tryNext());
+ result.storePath = storePath;
+ co_return result;
} catch (...) {
- return {std::current_exception()};
+ co_return result::failure(std::current_exception());
}