From 1d9d40b2a663464f1e6800d6de8df61433507423 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 20 Oct 2024 22:55:00 +0200 Subject: 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 --- src/libstore/build/worker.hh | 50 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'src/libstore/build/worker.hh') 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>>; - using Results = std::map; + struct Results { + std::map 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 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. -- cgit v1.2.3