From d851706c236f7fcb846b63c84c052c4e4adacd51 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 19 Nov 2025 07:27:45 -0400 Subject: [PATCH] MT#55283 improve build test error output Change-Id: I66ad3dbb1d746ad81d55c4daf922f0cfaf6f7850 --- lib/common.Makefile | 2 +- utils/build_test_wrapper | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/common.Makefile b/lib/common.Makefile index 05786f3b8..06078bccb 100644 --- a/lib/common.Makefile +++ b/lib/common.Makefile @@ -71,6 +71,6 @@ t38.c ../daemon/t38.c: ../lib/spandsp_logging.h ../utils/const_str_hash "$<" $(CFLAGS) < "$<" > "$@" $(BUILD_TEST_ALTS): $(wildcard $(subst .h,-*,$(BUILD_TEST_ALTS))) - ../utils/build_test_wrapper "$@" 2> /dev/null + ../utils/build_test_wrapper "$@" .PHONY: all debug clean install diff --git a/utils/build_test_wrapper b/utils/build_test_wrapper index 47f500d52..ea101b0b5 100755 --- a/utils/build_test_wrapper +++ b/utils/build_test_wrapper @@ -7,13 +7,24 @@ if test "$MAKE" = ""; then fi echo "Looking for usable alternative for $TARGET" rm -f "$ROOT"-test +rm -f .stderr.$$ for x in "$ROOT"*.h; do echo "Trying build with $x" rm -f "$TARGET" (echo '/******** GENERATED FILE ********/'; cat "$x") > "$TARGET" - $MAKE "$ROOT"-test && break + $MAKE "$ROOT"-test 2>> .stderr.$$ && break echo "Failed build with $x" rm -f "$TARGET" done rm -f "$ROOT"-test -test -f "$TARGET" +if test -f "$TARGET"; then + rm -f .stderr.$$ + exit 0 +fi +echo "Failed to find usable build alternative for $TARGET" +echo "Collected stderr:" +echo "--------------------------" +cat .stderr.$$ +rm -f .stderr.$$ +echo "--------------------------" +exit 1