Skip to content

Add -W to treat warnings as errors

Antonin Godard bitbake-devel yocto-docs 1 version In review

Get series with b4
b4 am [email protected] change-id 20260914-warn-as-errors-a9c87a0ad2d9

Versions newest first

  1. v1 Latest4 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4main: add an argument for showing warnings as errorslib/bb/main.py+3 -00 replies
2/4msg: add a helper to show warnings in red colorlib/bb/msg.py+8 -00 replies
3/4knotty: convert warnings to errors when -W is passedlib/bb/ui/knotty.py+14 -011 replies
4/4doc/bitbake-user-manual-intro.rst: refresh bitbake's help messagedoc/bitbake-user-manual/bitbake-user-manual-intro.rst+20 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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.

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