X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbinutils-gdb%2Fbuild.sh;h=3d7c561a477f60e75105289a7c2f9ca803a8fe5a;hb=9246f142afaceec835664f0d5b1c78cb5cf0f92b;hp=765888c2fc08f1748de3cb0421c865f858bc2645;hpb=f0f8dde07d6e6e9a5da51ba4c59289a4cd96392e;p=lttng-ci.git diff --git a/scripts/binutils-gdb/build.sh b/scripts/binutils-gdb/build.sh index 765888c..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 @@ -207,6 +247,10 @@ if use_ccache; then ccache -c fi +# This job has been seen generating cores in /tmp, filling and and causing +# problems. Remove any leftover core from a previous job. +rm /tmp/core.* || true + # Enter the source directory cd "$SRCDIR" @@ -258,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 @@ -271,7 +315,7 @@ esac $MAKE -j "$($NPROC)" V=1 MAKEINFO=true # Install in the workspace -$MAKE install DESTDIR="$WORKSPACE" +$MAKE install DESTDIR="$WORKSPACE" MAKEINFO=true case "$platform" in macos-*) @@ -293,7 +337,10 @@ esac # Run tests, don't fail now, we know that "make check" is going to fail, # since some tests don't pass. -$MAKE -C gdb --keep-going check -j "$($NPROC)" RUNTESTFLAGS="$RUNTESTFLAGS" FORCE_PARALLEL="1" || true +$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 RUNTESTFLAGS="$RUNTESTFLAGS" || true # Copy the dejagnu test results for archiving before cleaning the build dir mkdir "${WORKSPACE}/results" @@ -943,7 +990,7 @@ grep --extended-regexp --regexp="^(FAIL|XPASS|UNRESOLVED|DUPLICATE|ERROR):" "${W # For informational purposes: check if some known failure lines did not appear # in the gdb.sum. echo "Known failures that don't appear in gdb.sum:" -while read line; do +while read -r line; do if ! grep --silent --fixed-strings "$line" "${WORKSPACE}/results/gdb.sum"; then echo "$line" fi