[Concept,v2,03/29] buildman: Fix IDE mode to show warnings

Message ID 20260103200510.3605009-4-sjg@u-boot.org
State New
Headers
Series Malloc debugging and test/py improvements |

Commit Message

Simon Glass Jan. 3, 2026, 8:04 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

When IDE mode is enabled (-I), warnings are not shown because:

1. The process_result() function only shows output in verbose mode,
   not IDE mode

2. When there are warnings (stderr output), the build is considered
   "failed" and retried. The retry finds the object files already up
   to date from the first build, so make does not recompile them and
   produces no warnings. The second result (with empty stderr) then
   overwrites the first, losing the warnings.

Fix this by:
- Adding IDE mode handling in process_result() to write stderr directly
- Changing the retry logic to only retry on actual failures
  (return_code != 0), not on warnings

Fixes: 6a30a2666008 ("buildman: Support running from an IDE")
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

(no changes since v1)

 tools/buildman/builder.py       | 14 ++++++++++----
 tools/buildman/builderthread.py |  4 ++--
 2 files changed, 12 insertions(+), 6 deletions(-)
  

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index c2f0b4e409e..e218aa4184a 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -575,7 +575,10 @@  class Builder:
                 self.already_done += 1
             if result.kconfig_reconfig:
                 self.kconfig_reconfig += 1
-            if self._verbose:
+            if self._ide:
+                if result.stderr:
+                    sys.stderr.write(result.stderr)
+            elif self._verbose:
                 terminal.print_clear()
                 boards_selected = {target : result.brd}
                 self.reset_result_summary(boards_selected)
@@ -1440,9 +1443,12 @@  class Builder:
 
         # For the IDE mode, print out all the output
         if self._ide:
-            outcome = board_dict[target]
-            for line in outcome.err_lines:
-                sys.stderr.write(line)
+            for target in board_dict:
+                if target not in board_selected:
+                    continue
+                outcome = board_dict[target]
+                for line in outcome.err_lines:
+                    sys.stderr.write(line)
 
         # Display results by arch
         elif any((ok_boards, warn_boards, err_boards, unknown_boards, new_boards,
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 9449485a4cb..3d1b656531d 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -769,7 +769,7 @@  class BuilderThread(threading.Thread):
                         force_build or self.builder.force_build,
                         self.builder.force_build_failures,
                         job.work_in_output, job.adjust_cfg, job.fragments)
-                failed = result.return_code or result.stderr
+                failed = result.return_code
                 did_config = do_config
                 if failed and not do_config and not self.mrproper:
                     # If our incremental build failed, try building again
@@ -826,7 +826,7 @@  class BuilderThread(threading.Thread):
                         self.mrproper, self.builder.config_only, True,
                         self.builder.force_build_failures, job.work_in_output,
                         job.adjust_cfg, job.fragments)
-            failed = result.return_code or result.stderr
+            failed = result.return_code
             if failed and not self.mrproper:
                 result, request_config = self.run_commit(None, brd, work_dir,
                             True, self.builder.fallback_mrproper,