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.
The -y option is provided (for use with -s) to ignore the bountiful device-tree
warnings.
How to change from MAKEALL
==========================

View file

@ -338,16 +338,19 @@ class Builder:
def SetDisplayOptions(self, show_errors=False, show_sizes=False,
show_detail=False, show_bloat=False,
list_error_boards=False, show_config=False,
show_environment=False):
show_environment=False, filter_dtb_warnings=False):
"""Setup display options for the builder.
show_errors: True to show summarised error/warning info
show_sizes: Show size deltas
show_detail: Show size delta detail for each board if show_sizes
show_bloat: Show detail for each function
list_error_boards: Show the boards which caused each error/warning
show_config: Show config deltas
show_environment: Show environment deltas
Args:
show_errors: True to show summarised error/warning info
show_sizes: Show size deltas
show_detail: Show size delta detail for each board if show_sizes
show_bloat: Show detail for each function
list_error_boards: Show the boards which caused each error/warning
show_config: Show config 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_sizes = show_sizes
@ -356,6 +359,7 @@ class Builder:
self._list_error_boards = list_error_boards
self._show_config = show_config
self._show_environment = show_environment
self._filter_dtb_warnings = filter_dtb_warnings
def _AddTimestamp(self):
"""Add a new timestamp to the list and record the build period.
@ -556,8 +560,11 @@ class Builder:
"""
out_lines = []
for line in lines:
if not self.re_make_err.search(line):
out_lines.append(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)
return out_lines
def ReadFuncSizes(self, fname, fd):

View file

@ -114,6 +114,9 @@ def ParseArgs():
parser.add_option('-x', '--exclude', dest='exclude',
type='string', action='append',
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]

View file

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

View file

@ -214,13 +214,15 @@ class TestBuild(unittest.TestCase):
terminal.EchoPrintTestLines()
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
Args:
lines: Iterator containing the lines returned from the summary
list_error_boards: Adjust the check for output produced with the
--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):
"""Add a prefix to each line of a string
@ -301,8 +303,10 @@ class TestBuild(unittest.TestCase):
self.assertEqual(next(lines).text,
add_line_prefix('-', boards234, errors[1], col.GREEN))
self.assertEqual(next(lines).text,
add_line_prefix('w+', boards34, errors[2], col.YELLOW))
if not filter_dtb_warnings:
self.assertEqual(
next(lines).text,
add_line_prefix('w+', boards34, errors[2], col.YELLOW))
# Fifth commit
self.assertEqual(next(lines).text, '05: %s' % commits[4][1])
@ -317,8 +321,10 @@ class TestBuild(unittest.TestCase):
self.assertEqual(next(lines).text,
add_line_prefix('+', boards4, expect, col.RED))
self.assertEqual(next(lines).text,
add_line_prefix('w-', boards34, errors[2], col.CYAN))
if not filter_dtb_warnings:
self.assertEqual(
next(lines).text,
add_line_prefix('w-', boards34, errors[2], col.CYAN))
# Sixth commit
self.assertEqual(next(lines).text, '06: %s' % commits[5][1])
@ -357,7 +363,8 @@ class TestBuild(unittest.TestCase):
This does a line-by-line verification of the summary output.
"""
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):
"""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.
"""
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):
"""Test basic builder operation by building a branch"""