From 2c65b6c6a155829800f29980dc56f57e8c508eaf Mon Sep 17 00:00:00 2001 From: Rob Mohr Date: Thu, 29 Dec 2022 17:28:53 +0000 Subject: [PATCH] pw_presubmit: Drop extra lines from bazel summary Drop unnecessary lines from the bazel failure summary. Bug: b/262262623 Change-Id: I9e345389bf0eb12bde75dcb03a6b735df89c3678 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/125651 Reviewed-by: Alexei Frolov Pigweed-Auto-Submit: Rob Mohr Commit-Queue: Auto-Submit --- pw_presubmit/py/bazel_parser_test.py | 2 -- pw_presubmit/py/pw_presubmit/bazel_parser.py | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pw_presubmit/py/bazel_parser_test.py b/pw_presubmit/py/bazel_parser_test.py index 1b8ddbf41d..d35da71419 100644 --- a/pw_presubmit/py/bazel_parser_test.py +++ b/pw_presubmit/py/bazel_parser_test.py @@ -64,10 +64,8 @@ _REAL_TEST_SUMMARY = """ ERROR: /usr/local/google/home/mohrr/pigweed/pigweed/pw_kvs/BUILD.bazel:25:14: Compiling pw_kvs/entry.cc failed: (Exit 1): gcc failed: error executing command -# Configuration: 752863e407a197a5b9da05cfc572e7013efd6958e856cee61d2fa474ed... # Execution platform: @local_config_platform//:host -Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging pw_kvs/entry.cc:49:20: error: no member named 'Dat' in 'pw::Status' return Status::Dat aLoss(); ~~~~~~~~^ diff --git a/pw_presubmit/py/pw_presubmit/bazel_parser.py b/pw_presubmit/py/pw_presubmit/bazel_parser.py index 865e8a50e3..50282d1de6 100644 --- a/pw_presubmit/py/pw_presubmit/bazel_parser.py +++ b/pw_presubmit/py/pw_presubmit/bazel_parser.py @@ -42,6 +42,12 @@ def parse_bazel_stdout(bazel_stdout: Path) -> str: if line.strip().startswith(('(cd /', 'exec env')): continue + if line.strip().startswith('Use --sandbox_debug to see'): + continue + + if line.strip().startswith('# Configuration'): + continue + # An ":" line usually means compiler output is done # and useful compiler errors are complete. if re.match(r'^(?!ERROR)[A-Z]+:', line):