From fb0d88b8b1e66e17e8a82144163c28dcfa4013d1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 31 Mar 2020 19:42:09 +0300 Subject: Fix operation status merge for shared logs in bbot worker --- bbot/worker/worker.cxx | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'bbot/worker') 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); -- cgit v1.1