From 42ceebb4cdf10db373903c3c19c144130e51e1f6 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 12 Feb 2026 11:47:53 +0100 Subject: [PATCH] Filter known-benign warnings in run_and_print_on_failure The function already suppresses command output on success but shows lines matching Warning/Error. This caused ~350 lines of known-benign output per build from automake subdir-objects warnings and libtool install warnings. Filter these out so only actionable warnings are shown. Ticket: ENT-12619 Signed-off-by: Lars Erik Wik Co-Authored-By: Claude Opus 4.6 --- build-scripts/functions | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build-scripts/functions b/build-scripts/functions index d09b7cfd6..2ae2dceb5 100644 --- a/build-scripts/functions +++ b/build-scripts/functions @@ -754,10 +754,20 @@ run_and_print_on_failure() { # Filter output on Warnings/Errors and add two lines of context regex='([Ww]arning:|[Ee]rror:)' if grep_q -E "$regex" "$temp_output_file"; then - log_debug "Found warnings/errors in output from command:" "$@" - echo "--- Start of Warnings/Errors ---" - grep_c 2 -E "$regex" "$temp_output_file" - echo "--- End of Warnings/Errors ---" + # Known-benign patterns that are not actionable and should be suppressed: + # - automake subdir-objects: forward-compatibility notice, harmless + # - libtool install warnings: normal when using DESTDIR + # shellcheck disable=SC3043 + local benign='subdir-objects|libtool: warning: remember to run|libtool: warning:.*has not been installed|libtool: install:' + # shellcheck disable=SC3043 + local filtered + filtered=$(grep_c 2 -E "$regex" "$temp_output_file" | grep -v -E "$benign") || true + if [ -n "$filtered" ]; then + log_debug "Found warnings/errors in output from command:" "$@" + echo "--- Start of Warnings/Errors ---" + printf '%s\n' "$filtered" + echo "--- End of Warnings/Errors ---" + fi fi else # Print all output