Improve "BUILD FAILED" output

- "BUILD FAILED" is now printed in red instead of in highlight color.

- Print CPU architecture information after OS information.

- Do NOT print last 10 lines of the log anymore. Due to the verbosity of
  compilers, that rarely includes the actual error message, but users
  think it does and so they paste it in their GitHub reports instead of
  perusing the log file.
This commit is contained in:
Mislav Marohnić 2023-11-07 10:07:41 +01:00
parent c6f8eb38cf
commit 61e50df552
No known key found for this signature in database

View file

@ -220,18 +220,16 @@ osx_version() {
build_failed() {
{ echo
colorize 1 "BUILD FAILED"
echo " ($(os_information) using $(version))"
colorize '31;1' "BUILD FAILED"
echo " ($(os_information) on $(uname -m) using $(version))"
echo
if ! rmdir "${BUILD_PATH}" 2>/dev/null; then
echo "Inspect or clean up the working tree at ${BUILD_PATH}"
echo "You can inspect the build directory at ${BUILD_PATH}"
if [ -n "$(head -1 "$LOG_PATH" 2>/dev/null)" ]; then
colorize 33 "Results logged to ${LOG_PATH}"
printf "\n\n"
echo "Last 10 log lines:"
tail -n 10 "$LOG_PATH"
colorize 33 "See the full build log at ${LOG_PATH}"
printf "\n"
fi
fi
} >&3