IMPALA-9312: Better error handling for run_clang_tidy.sh

This turns a buildall.sh failure into a job failure and
dumps full output of the script.

Change-Id: I4a90e5b48f0d75b0a1c52cfe629c22bd37c70b26
Reviewed-on: http://gerrit.cloudera.org:8080/15090
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Quanlong Huang <huangquanlong@gmail.com>
diff --git a/bin/run_clang_tidy.sh b/bin/run_clang_tidy.sh
index a0e022a..22a80de 100755
--- a/bin/run_clang_tidy.sh
+++ b/bin/run_clang_tidy.sh
@@ -30,9 +30,12 @@
 set -euo pipefail
 
 echo "Compiling"
-if ! ./buildall.sh -skiptests -tidy -so -noclean 1>/dev/null 2>/dev/null
+TMP_BUILDALL_LOG=$(mktemp)
+if ! ./buildall.sh -skiptests -tidy -so -noclean &> "${TMP_BUILDALL_LOG}"
 then
-  echo "WARNING: compile failed" >&2
+  echo "buildall.sh failed, dumping output" >&2
+  cat "${TMP_BUILDALL_LOG}"
+  exit 1
 fi
 
 DIRS=$(ls -d "${IMPALA_HOME}/be/src/"*/ | grep -v gutil | grep -v kudu |\