mbox series

[0/4] Add -W to treat warnings as errors

Message ID 20261013-warn-as-errors-v1-0-ab3658758ceb@bootlin.com
Headers show
Series Add -W to treat warnings as errors | expand

Message

Antonin Godard Oct. 13, 2026, 12:13 p.m. UTC
The purpose of this series is to implement the -W option to bitbake to
be able to treat warnings as errors and make the return value 1 in that
case. This is useful in environments that need to make sure the build
passed without warnings. Currently this is usually done by a
post-process task grepping the last log for warnings.

With knotty, the -W/--warnings-as-errors option will turn warning
messages to the red color (useful to know that the option is in use
during the build) and make the return value be 1 in case of warnings. An
additional summary line is displayed at the end to let the user know
that the option was in use for this execution of bitbake.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Antonin Godard (4):
      main: add an argument for showing warnings as errors
      msg: add a helper to show warnings in red color
      knotty: convert warnings to errors when -W is passed
      doc/bitbake-user-manual-intro.rst: refresh bitbake's help message

 .../bitbake-user-manual-intro.rst                  | 36 ++++++++++++----------
 lib/bb/main.py                                     |  3 ++
 lib/bb/msg.py                                      |  8 +++++
 lib/bb/ui/knotty.py                                | 14 +++++++++
 4 files changed, 45 insertions(+), 16 deletions(-)
---
base-commit: a17e8093fd4d5ed7792df86af8d2d63803dc42a4
change-id: 20260914-warn-as-errors-a9c87a0ad2d9