Commit
7cd50f29d5cbf8deb64d00318b39c281119c0e03 makes the binaries
use libtool's "executable wrappers", which will transparently relink
the executables if they think that's needed. The test for that is
somewhat flawed: if the mtimes match, the binary might or might not
get relinked. In practise, this causes relinks on gitbuilder all the
time.
As of earlier commit
5a0bc6b78f2e40ec9255a1ea49f77ef9ea4690a6, we
started sanitizing the environment passed to the clitests. This meant
we also stripped away CCACHE_DIR and other settings, needed to
properly relink the binaries. Re-add CCACHE_DIR, CC, CXX to clitests
environment.
To handle the case where CCACHE_DIR etc are not set in the first
place, we need an extra wrapper script. Otherwise, ccache might see an
empty string as the env value, and naturally couldn't access a
directory by that name.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
if ! env --ignore-environment \
PATH="$BUILDDIR_ABS/..:$SRCDIR_ABS/..:$PATH" \
CEPH_CONF=/dev/null \
+ CCACHE_DIR="$CCACHE_DIR" \
+ CC="$CC" \
+ CXX="$CXX" \
+ "$SRCDIR/run-cli-tests-maybe-unset-ccache" \
"$CRAM_BIN" -v "$@" --error-dir="$BUILDDIR/cli/$toolname" -- "$tool"/*.t; then
FAILED=1
fi
--- /dev/null
+#!/bin/sh
+set -e
+
+# ccache breaks if it sees CCACHE_DIR="", yet due to clumsiness of
+# /usr/bin/env, it's hard to avoid setting env vars for the parent;
+# unset them if they're empty
+
+if [ -z "$CCACHE_DIR" ]; then
+ unset CCACHE_DIR
+fi
+
+if [ -z "$CC" ]; then
+ unset CC
+fi
+
+if [ -z "$CXX" ]; then
+ unset CXX
+fi
+
+exec "$@"