diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-03-31 19:42:09 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-03-31 23:09:42 +0300 |
commit | fb0d88b8b1e66e17e8a82144163c28dcfa4013d1 (patch) | |
tree | 7472ca890833f2d8c8c200379b285e3cfd0b5adb /bbot/worker/worker.cxx | |
parent | 83f1f8a93e57f6c70e6158f9200a7cbb323fa67a (diff) |
Fix operation status merge for shared logs in bbot worker
Diffstat (limited to 'bbot/worker/worker.cxx')
-rw-r--r-- | bbot/worker/worker.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index eb2609d..8a5c8d7 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -344,6 +344,15 @@ build (size_t argc, const char* argv[]) return rm.results.back (); }; + // Note that we don't consider the build system module configuring and + // testing during the "pre-step" as separate operations and share the + // operation logs with the "main" configure and test steps (see below). + // Thus, we save pointers to the added result objects for the subsequent + // use. + // + operation_result* configure_result (nullptr); + operation_result* test_result (nullptr); + dir_path rwd; // Root working directory. for (;;) // The "breakout" loop. @@ -614,14 +623,6 @@ build (size_t argc, const char* argv[]) bool module (pkg.compare (0, 10, "libbuild2-") == 0); dir_path module_dir ("build-module"); - // Note that we don't consider the module configuring and testing during - // this pre-step separate operations and share the operation logs with the - // "main" configure and test steps (see below). Thus, we save pointers to - // the added result objects for the subsequent use. - // - operation_result* configure_result (nullptr); - operation_result* test_result (nullptr); - rwd = current_directory (); if (module) @@ -1327,7 +1328,19 @@ build (size_t argc, const char* argv[]) } if (!rm.results.empty ()) + { rm.status |= rm.results.back ().status; // Merge last in case of a break. + + // Also merge statuses of the configure and test operations, which logs + // can potentially be shared across multiple steps and which results may + // not be the last in the list. + // + if (configure_result != nullptr) + rm.status |= configure_result->status; + + if (test_result != nullptr) + rm.status |= test_result->status; + } else assert (rm.status == result_status::abort); |