Skip to content

Commit fca2325

Browse files
authored
Merge pull request #2112 from larsewi/filter-known-benign-warnings
ENT-12619: Filter known-benign warnings in run_and_print_on_failure
2 parents 326bf73 + 42ceebb commit fca2325

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)