diff mbox series

[1/3] buildman: Write output even on fatal error

Message ID 20211020034325.1497038-1-sjg@chromium.org
State Accepted
Commit bafdeb45462683692e0ae217d4683b8062c59608
Delegated to: Tom Rini
Headers show
Series [1/3] buildman: Write output even on fatal error | expand

Commit Message

Simon Glass Oct. 20, 2021, 3:43 a.m. UTC
At present buildman does not write any output (to the 'out' and 'err)
files if the build terminates with a fatal error. This is to avoid adding
lots of spam to the logs.

However there are times when this is actually useful, such as when the
build fails for an obscure reason such as a Kconfig loop.

Update the logic to always write the output, so that the user gets a clue
as to what is happening.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/buildman/builderthread.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 48128cf6732..3e450e40670 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -300,16 +300,12 @@  class BuilderThread(threading.Thread):
             work_in_output: Use the output directory as the work directory and
                 don't write to a separate output directory.
         """
-        # Fatal error
-        if result.return_code < 0:
-            return
-
         # If we think this might have been aborted with Ctrl-C, record the
         # failure but not that we are 'done' with this board. A retry may fix
         # it.
-        maybe_aborted =  result.stderr and 'No child processes' in result.stderr
+        maybe_aborted = result.stderr and 'No child processes' in result.stderr
 
-        if result.already_done:
+        if result.return_code >= 0 and result.already_done:
             return
 
         # Write the output and stderr
@@ -332,6 +328,10 @@  class BuilderThread(threading.Thread):
         elif os.path.exists(errfile):
             os.remove(errfile)
 
+        # Fatal error
+        if result.return_code < 0:
+            return
+
         if result.toolchain:
             # Write the build result and toolchain information.
             done_file = self.builder.GetDoneFile(result.commit_upto,