Skip to content

Commit 42ceebb

Browse files
larsewiclaude
andcommitted
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 <lars.erik.wik@northern.tech> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66ec754 commit 42ceebb

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

build-scripts/functions

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,20 @@ run_and_print_on_failure() {
754754
# Filter output on Warnings/Errors and add two lines of context
755755
regex='([Ww]arning:|[Ee]rror:)'
756756
if grep_q -E "$regex" "$temp_output_file"; then
757-
log_debug "Found warnings/errors in output from command:" "$@"
758-
echo "--- Start of Warnings/Errors ---"
759-
grep_c 2 -E "$regex" "$temp_output_file"
760-
echo "--- End of Warnings/Errors ---"
757+
# Known-benign patterns that are not actionable and should be suppressed:
758+
# - automake subdir-objects: forward-compatibility notice, harmless
759+
# - libtool install warnings: normal when using DESTDIR
760+
# shellcheck disable=SC3043
761+
local benign='subdir-objects|libtool: warning: remember to run|libtool: warning:.*has not been installed|libtool: install:'
762+
# shellcheck disable=SC3043
763+
local filtered
764+
filtered=$(grep_c 2 -E "$regex" "$temp_output_file" | grep -v -E "$benign") || true
765+
if [ -n "$filtered" ]; then
766+
log_debug "Found warnings/errors in output from command:" "$@"
767+
echo "--- Start of Warnings/Errors ---"
768+
printf '%s\n' "$filtered"
769+
echo "--- End of Warnings/Errors ---"
770+
fi
761771
fi
762772
else
763773
# Print all output

0 commit comments

Comments
 (0)