X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbinutils-gdb%2Fbuild.sh;h=3d7c561a477f60e75105289a7c2f9ca803a8fe5a;hb=9246f142afaceec835664f0d5b1c78cb5cf0f92b;hp=fd07122f5040d639319f94638e1b6b103d78809f;hpb=593cd35e7499321c2c882cf779c82d698563f8e9;p=lttng-ci.git diff --git a/scripts/binutils-gdb/build.sh b/scripts/binutils-gdb/build.sh index fd07122..3d7c561 100755 --- a/scripts/binutils-gdb/build.sh +++ b/scripts/binutils-gdb/build.sh @@ -17,6 +17,44 @@ set -exu +mktemp_compat() { + case "$platform" in + macos*) + # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many + # other systems. Use the final positional argument to force the + # tempfile or tempdir to be created inside $TMPDIR, which must + # already exist. + if [ -n "${TMPDIR}" ] ; then + mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX" + else + mktemp "${@}" + fi + ;; + *) + mktemp "${@}" + ;; + esac +} + +print_header() { + set +x + + local message=" $1 " + local message_len + local padding_len + + message_len="${#message}" + padding_len=$(( (80 - (message_len)) / 2 )) + + printf '\n'; printf -- '#%.0s' {1..80}; printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' $(seq 1 $padding_len); printf '%s' "$message"; printf -- '#%.0s' $(seq 1 $padding_len); printf '\n' + printf -- '-%.0s' {1..80}; printf '\n' + printf -- '#%.0s' {1..80}; printf '\n\n' + + set -x +} + failed_configure() { # Assume we are in the configured build directory echo "#################### BEGIN config.log ####################" @@ -200,6 +238,8 @@ macos-*) esac # Print build env details +print_header "Build environment details" +print_hardware || true print_os || true print_tooling || true @@ -262,7 +302,7 @@ case "$build" in echo "Out of tree build" # Create and enter a temporary build directory - builddir=$(mktemp -d) + builddir=$(mktemp_compat -d) cd "$builddir" "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure @@ -300,7 +340,7 @@ esac $MAKE -C gdb/testsuite site.exp # shellcheck disable=SC2016 echo 'set gdb_test_timeout [expr 5 * $timeout]' >> gdb/testsuite/site.exp -$MAKE -C gdb --keep-going check -j "$($NPROC)" RUNTESTFLAGS="$RUNTESTFLAGS" FORCE_PARALLEL="1" || true +$MAKE -C gdb --keep-going check RUNTESTFLAGS="$RUNTESTFLAGS" || true # Copy the dejagnu test results for archiving before cleaning the build dir mkdir "${WORKSPACE}/results"