diff options
author | eldritch horrors <pennae@lix.systems> | 2024-10-20 22:55:00 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-10-22 15:32:36 +0000 |
commit | 1d9d40b2a663464f1e6800d6de8df61433507423 (patch) | |
tree | 7711eaea1c95d2b8ccef4eb581dcef9d5f20fd0a /src/libstore/build/worker.hh | |
parent | 343aca3a2794922915903491a0be6f01c9dc6ced (diff) |
libstore: move failingExitStatus into worker results
we already have a results type for the entire worker call, we may as
well put this bit of info in there. we do keep the assumption of the
old code that the field will only be read if some goals have failed;
fixing that is a very different mess, and not immediately necessary.
Change-Id: If3fc32649dcd88e1987cdd1758c6c5743e3b35ac
Diffstat (limited to 'src/libstore/build/worker.hh')
-rw-r--r-- | src/libstore/build/worker.hh | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh index 1a913ca16..e80981876 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/build/worker.hh @@ -86,7 +86,32 @@ class Worker : public WorkerBase { public: using Targets = std::map<GoalPtr, kj::Promise<Result<Goal::WorkResult>>>; - using Results = std::map<GoalPtr, Goal::WorkResult>; + struct Results { + std::map<GoalPtr, Goal::WorkResult> goals; + + /** + * The exit status in case of failure. + * + * In the case of a build failure, returned value follows this + * bitmask: + * + * ``` + * 0b1100100 + * ^^^^ + * |||`- timeout + * ||`-- output hash mismatch + * |`--- build failure + * `---- not deterministic + * ``` + * + * In other words, the failure code is at least 100 (0b1100100), but + * might also be greater. + * + * Otherwise (no build failure, but some other sort of failure by + * assumption), this returned value is 1. + */ + unsigned int failingExitStatus; + }; private: @@ -248,29 +273,6 @@ public: */ Results run(std::function<Targets (GoalFactory &)> req); - /*** - * The exit status in case of failure. - * - * In the case of a build failure, returned value follows this - * bitmask: - * - * ``` - * 0b1100100 - * ^^^^ - * |||`- timeout - * ||`-- output hash mismatch - * |`--- build failure - * `---- not deterministic - * ``` - * - * In other words, the failure code is at least 100 (0b1100100), but - * might also be greater. - * - * Otherwise (no build failure, but some other sort of failure by - * assumption), this returned value is 1. - */ - unsigned int failingExitStatus(); - /** * Check whether the given valid path exists and has the right * contents. |