buildman: Fix IDE mode to show warnings

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>
This commit is contained in:
Simon Glass
2026-01-03 10:49:35 -07:00
parent 89bae548f1
commit 0cbcd78c79
2 changed files with 12 additions and 6 deletions

View File

@@ -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,

View File

@@ -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,