1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-27 13:31:16 +02:00

buildman: Add an option to ignore device-tree warnings

Unfortunately the plague of device-tree warnings has not lifted. These
warnings infiltrate almost every build, adding noise and confusion.

Add a buildman option to ignore them. This option works only with the
summary option (-s). It does not affect the build process.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-04-09 15:08:52 -06:00
parent eb70a2c059
commit 174592b964
5 changed files with 52 additions and 23 deletions

View File

@@ -1124,6 +1124,9 @@ warnings will produce success (since 129 is changed to 0).
If there are both warnings and errors, errors win, so buildman returns 128. If there are both warnings and errors, errors win, so buildman returns 128.
The -y option is provided (for use with -s) to ignore the bountiful device-tree
warnings.
How to change from MAKEALL How to change from MAKEALL
========================== ==========================

View File

@@ -338,9 +338,10 @@ class Builder:
def SetDisplayOptions(self, show_errors=False, show_sizes=False, def SetDisplayOptions(self, show_errors=False, show_sizes=False,
show_detail=False, show_bloat=False, show_detail=False, show_bloat=False,
list_error_boards=False, show_config=False, list_error_boards=False, show_config=False,
show_environment=False): show_environment=False, filter_dtb_warnings=False):
"""Setup display options for the builder. """Setup display options for the builder.
Args:
show_errors: True to show summarised error/warning info show_errors: True to show summarised error/warning info
show_sizes: Show size deltas show_sizes: Show size deltas
show_detail: Show size delta detail for each board if show_sizes show_detail: Show size delta detail for each board if show_sizes
@@ -348,6 +349,8 @@ class Builder:
list_error_boards: Show the boards which caused each error/warning list_error_boards: Show the boards which caused each error/warning
show_config: Show config deltas show_config: Show config deltas
show_environment: Show environment deltas show_environment: Show environment deltas
filter_dtb_warnings: Filter out any warnings from the device-tree
compiler
""" """
self._show_errors = show_errors self._show_errors = show_errors
self._show_sizes = show_sizes self._show_sizes = show_sizes
@@ -356,6 +359,7 @@ class Builder:
self._list_error_boards = list_error_boards self._list_error_boards = list_error_boards
self._show_config = show_config self._show_config = show_config
self._show_environment = show_environment self._show_environment = show_environment
self._filter_dtb_warnings = filter_dtb_warnings
def _AddTimestamp(self): def _AddTimestamp(self):
"""Add a new timestamp to the list and record the build period. """Add a new timestamp to the list and record the build period.
@@ -556,7 +560,10 @@ class Builder:
""" """
out_lines = [] out_lines = []
for line in lines: for line in lines:
if not self.re_make_err.search(line): if self.re_make_err.search(line):
continue
if self._filter_dtb_warnings and self._re_dtb_warning.search(line):
continue
out_lines.append(line) out_lines.append(line)
return out_lines return out_lines

View File

@@ -114,6 +114,9 @@ def ParseArgs():
parser.add_option('-x', '--exclude', dest='exclude', parser.add_option('-x', '--exclude', dest='exclude',
type='string', action='append', type='string', action='append',
help='Specify a list of boards to exclude, separated by comma') help='Specify a list of boards to exclude, separated by comma')
parser.add_option('-y', '--filter-dtb-warnings', action='store_true',
default=False,
help='Filter out device-tree-compiler warnings from output')
parser.usage += """ [list of target/arch/cpu/board/vendor/soc to build] parser.usage += """ [list of target/arch/cpu/board/vendor/soc to build]

View File

@@ -350,11 +350,10 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
# We can't show function sizes without board details at present # We can't show function sizes without board details at present
if options.show_bloat: if options.show_bloat:
options.show_detail = True options.show_detail = True
builder.SetDisplayOptions(options.show_errors, options.show_sizes, builder.SetDisplayOptions(
options.show_detail, options.show_bloat, options.show_errors, options.show_sizes, options.show_detail,
options.list_error_boards, options.show_bloat, options.list_error_boards, options.show_config,
options.show_config, options.show_environment, options.filter_dtb_warnings)
options.show_environment)
if options.summary: if options.summary:
builder.ShowSummary(commits, board_selected) builder.ShowSummary(commits, board_selected)
else: else:

View File

@@ -214,13 +214,15 @@ class TestBuild(unittest.TestCase):
terminal.EchoPrintTestLines() terminal.EchoPrintTestLines()
return iter(terminal.GetPrintTestLines()) return iter(terminal.GetPrintTestLines())
def _CheckOutput(self, lines, list_error_boards): def _CheckOutput(self, lines, list_error_boards, filter_dtb_warnings):
"""Check for expected output from the build summary """Check for expected output from the build summary
Args: Args:
lines: Iterator containing the lines returned from the summary lines: Iterator containing the lines returned from the summary
list_error_boards: Adjust the check for output produced with the list_error_boards: Adjust the check for output produced with the
--list-error-boards flag --list-error-boards flag
filter_dtb_warnings: Adjust the check for output produced with the
--filter-dtb-warnings flag
""" """
def add_line_prefix(prefix, boards, error_str, colour): def add_line_prefix(prefix, boards, error_str, colour):
"""Add a prefix to each line of a string """Add a prefix to each line of a string
@@ -301,7 +303,9 @@ class TestBuild(unittest.TestCase):
self.assertEqual(next(lines).text, self.assertEqual(next(lines).text,
add_line_prefix('-', boards234, errors[1], col.GREEN)) add_line_prefix('-', boards234, errors[1], col.GREEN))
self.assertEqual(next(lines).text, if not filter_dtb_warnings:
self.assertEqual(
next(lines).text,
add_line_prefix('w+', boards34, errors[2], col.YELLOW)) add_line_prefix('w+', boards34, errors[2], col.YELLOW))
# Fifth commit # Fifth commit
@@ -317,7 +321,9 @@ class TestBuild(unittest.TestCase):
self.assertEqual(next(lines).text, self.assertEqual(next(lines).text,
add_line_prefix('+', boards4, expect, col.RED)) add_line_prefix('+', boards4, expect, col.RED))
self.assertEqual(next(lines).text, if not filter_dtb_warnings:
self.assertEqual(
next(lines).text,
add_line_prefix('w-', boards34, errors[2], col.CYAN)) add_line_prefix('w-', boards34, errors[2], col.CYAN))
# Sixth commit # Sixth commit
@@ -357,7 +363,8 @@ class TestBuild(unittest.TestCase):
This does a line-by-line verification of the summary output. This does a line-by-line verification of the summary output.
""" """
lines = self._SetupTest(show_errors=True) lines = self._SetupTest(show_errors=True)
self._CheckOutput(lines, list_error_boards=False) self._CheckOutput(lines, list_error_boards=False,
filter_dtb_warnings=False)
def testErrorBoards(self): def testErrorBoards(self):
"""Test output with --list-error-boards """Test output with --list-error-boards
@@ -365,7 +372,17 @@ class TestBuild(unittest.TestCase):
This does a line-by-line verification of the summary output. This does a line-by-line verification of the summary output.
""" """
lines = self._SetupTest(show_errors=True, list_error_boards=True) lines = self._SetupTest(show_errors=True, list_error_boards=True)
self._CheckOutput(lines, list_error_boards=True) self._CheckOutput(lines, list_error_boards=True,
filter_dtb_warnings=False)
def testFilterDtb(self):
"""Test output with --filter-dtb-warnings
This does a line-by-line verification of the summary output.
"""
lines = self._SetupTest(show_errors=True, filter_dtb_warnings=True)
self._CheckOutput(lines, list_error_boards=False,
filter_dtb_warnings=True)
def _testGit(self): def _testGit(self):
"""Test basic builder operation by building a branch""" """Test basic builder operation by building a branch"""