diff options
author | Simon Glass <sjg@chromium.org> | 2021-04-07 17:07:59 +1200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-13 07:01:25 +0000 |
commit | ee4257735632f5453b9377f9f60f5c68f6917537 (patch) | |
tree | c57d43667535c249791811ba859b9466befecf68 /zephyr/zmake | |
parent | ca160a3394c952f0732f66eb113b9735b5655ed2 (diff) | |
download | chrome-ec-ee4257735632f5453b9377f9f60f5c68f6917537.tar.gz |
zephyr: zmake: Ensure all output is produced
At present if one process finishes with an error the output of other
processes may be truncated, since zmake exits immediately. This can be
confusing since running repeatedly gives different output.
Fix it by waiting until all processes are complete before exiting.
BUG=b:184298184
BRANCH=none
TEST=(cd zephyr/zmake/ && python3 -m pytest .)
Change-Id: Ib6c3dd5966c2b381d811c84e3c1c5b5f5fc3cf9a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2801173
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/zmake')
-rw-r--r-- | zephyr/zmake/tests/test_zmake.py | 9 | ||||
-rw-r--r-- | zephyr/zmake/zmake/zmake.py | 13 |
2 files changed, 20 insertions, 2 deletions
diff --git a/zephyr/zmake/tests/test_zmake.py b/zephyr/zmake/tests/test_zmake.py index acd9409585..f6067513cb 100644 --- a/zephyr/zmake/tests/test_zmake.py +++ b/zephyr/zmake/tests/test_zmake.py @@ -105,3 +105,12 @@ def test_filter_info(): 'Running /usr/bin/ninja -C /tmp/z/vol/build-rw', 'SRAM: 48632 B 62 KB 76.60%', } + + +def test_filter_debug(): + """Test what appears on the DEBUG level""" + recs, _ = do_test_with_log_level(logging.DEBUG) + # The RO version has three extra lines: the SUCCESS asterisks + # Both versions add the first 'Building' line above, with the temp dir + expect = 321 + 318 + 2 + assert len(recs) == expect diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py index daed8e1af1..fca71154d2 100644 --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -277,9 +277,18 @@ class Zmake: True if all if OK False if an error was found (so that zmake should exit) """ + # Let all output be produced before exiting + bad = None for proc in procs: - if proc.wait(): - raise OSError(get_process_failure_msg(proc)) + if proc.wait() and not bad: + bad = proc + if bad: + # Just show the first bad process for now. Both builds likely + # produce the same error anyway. If they don't, the user can + # still take action on the errors/warnings provided. Showing + # multiple 'Execution failed' messages is not very friendly + # since it exposes the fragmented nature of the build. + raise OSError(get_process_failure_msg(bad)) if (fail_on_warnings and any(w.has_written(logging.WARNING) or |