diff options
author | eldritch horrors <pennae@lix.systems> | 2024-07-26 20:19:21 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-08-02 13:52:15 +0000 |
commit | e5177dddff13e7e5bb1bdecf28776822c6dba528 (patch) | |
tree | 16245e3f8424990787c0195449e3dde356db5259 /src/libstore/build/goal.hh | |
parent | dfcab1c3f09971cba6a198ba81158d1190975165 (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/goal.hh')
-rw-r--r-- | src/libstore/build/goal.hh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index db20b5cdb..adb3ab94b 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -105,10 +105,13 @@ struct Goal : public std::enable_shared_from_this<Goal> public: - struct StillAlive {}; - struct Finished {}; + struct [[nodiscard]] StillAlive {}; + struct [[nodiscard]] Finished { + ExitCode result; + std::unique_ptr<Error> ex; + }; - struct WorkResult : std::variant<StillAlive, Finished> + struct [[nodiscard]] WorkResult : std::variant<StillAlive, Finished> { WorkResult() = delete; using variant::variant; @@ -159,8 +162,6 @@ public: virtual std::string key() = 0; - Finished amDone(ExitCode result, std::optional<Error> ex = {}); - virtual void cleanup() { } /** |