[PATCH] buildman: Add flag to filter out missing binary blobs

Tom Rini trini at konsulko.com
Thu May 2 01:16:57 CEST 2024


When doing builds of a number of platforms and not intending to run the
resulting binaries, we have an option already to tell buildman to just
make fake binaries for linking only. Add another option to filter this
from the output, to make parsing build logs easier.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
Cc: Simon Glass <sjg at chromium.org>
---
 tools/buildman/builder.py | 13 ++++++++++++-
 tools/buildman/cmdline.py |  3 +++
 tools/buildman/control.py |  3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index f35175b4598d..d72dbc3e8bfb 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -368,6 +368,9 @@ class Builder:
         self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*')
         self._re_migration_warning = re.compile(r'^={21} WARNING ={22}\n.*\n=+\n',
                                                 re.MULTILINE | re.DOTALL)
+        self._re_missing_blobs = re.compile(r'Image.*is missing.*blobs.*\n.*\nSome images are invalid',
+                                                re.MULTILINE | re.DOTALL)
+
 
         self.thread_exceptions = []
         self.test_thread_exceptions = test_thread_exceptions
@@ -409,7 +412,8 @@ class Builder:
                           show_detail=False, show_bloat=False,
                           list_error_boards=False, show_config=False,
                           show_environment=False, filter_dtb_warnings=False,
-                          filter_migration_warnings=False, ide=False):
+                          filter_migration_warnings=False,
+                          filter_missing_blobs=False, ide=False):
         """Setup display options for the builder.
 
         Args:
@@ -424,6 +428,8 @@ class Builder:
                 compiler
             filter_migration_warnings: Filter out any warnings about migrating
                 a board to driver model
+            filter_missing_blobs: Filter out any warnings about missing binary
+                blobs
             ide: Create output that can be parsed by an IDE. There is no '+' prefix on
                 error lines and output on stderr stays on stderr.
         """
@@ -436,6 +442,7 @@ class Builder:
         self._show_environment = show_environment
         self._filter_dtb_warnings = filter_dtb_warnings
         self._filter_migration_warnings = filter_migration_warnings
+        self._filter_missing_blobs = filter_missing_blobs
         self._ide = ide
 
     def _add_timestamp(self):
@@ -672,6 +679,10 @@ class Builder:
             text = '\n'.join(lines)
             text = self._re_migration_warning.sub('', text)
             lines = text.splitlines()
+        if self._filter_missing_blobs:
+            text = '\n'.join(lines)
+            text = self._re_missing_blobs.sub('', text)
+            lines = text.splitlines()
         for line in lines:
             if self.re_make_err.search(line):
                 continue
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index 03211bd5aa5f..6e5263b40747 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -168,6 +168,9 @@ def add_after_m(parser):
     parser.add_argument('-Y', '--filter-migration-warnings', action='store_true',
           default=False,
           help='Filter out migration warnings from output')
+    parser.add_argument('--filter-missing-blobs', action='store_true',
+          default=False,
+          help='Filter out missing binary blob warnings from output')
 
 
 def parse_args():
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 8f6850c52113..cd6c47bd2993 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -539,7 +539,8 @@ def run_builder(builder, commits, board_selected, args):
     builder.set_display_options(
         args.show_errors, args.show_sizes, args.show_detail, args.show_bloat,
         args.list_error_boards, args.show_config, args.show_environment,
-        args.filter_dtb_warnings, args.filter_migration_warnings, args.ide)
+        args.filter_dtb_warnings, args.filter_migration_warnings,
+        args.filter_missing_blobs, args.ide)
     if args.summary:
         builder.show_summary(commits, board_selected)
     else:
-- 
2.34.1



More information about the U-Boot mailing list