aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/ci/cirrus.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/secp256k1/ci/cirrus.sh')
-rwxr-xr-xsrc/secp256k1/ci/cirrus.sh44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/secp256k1/ci/cirrus.sh b/src/secp256k1/ci/cirrus.sh
index b85f012d3f..fb5854a777 100755
--- a/src/secp256k1/ci/cirrus.sh
+++ b/src/secp256k1/ci/cirrus.sh
@@ -5,10 +5,47 @@ set -x
export LC_ALL=C
+# Print relevant CI environment to allow reproducing the job outside of CI.
+print_environment() {
+ # Turn off -x because it messes up the output
+ set +x
+ # There are many ways to print variable names and their content. This one
+ # does not rely on bash.
+ for i in WERROR_CFLAGS MAKEFLAGS BUILD \
+ ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
+ EXPERIMENTAL ECDH RECOVERY SCHNORRSIG \
+ SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETEST\
+ EXAMPLES \
+ WRAPPER_CMD CC AR NM HOST
+ do
+ eval 'printf "%s %s " "$i=\"${'"$i"'}\""'
+ done
+ echo "$0"
+ set -x
+}
+print_environment
+
+# Start persistent wineserver if necessary.
+# This speeds up jobs with many invocations of wine (e.g., ./configure with MSVC) tremendously.
+case "$WRAPPER_CMD" in
+ *wine*)
+ # This is apparently only reliable when we run a dummy command such as "hh.exe" afterwards.
+ wineserver -p && wine hh.exe
+ ;;
+esac
+
env >> test_env.log
-$CC -v || true
-valgrind --version || true
+if [ -n "$CC" ]; then
+ # The MSVC compiler "cl" doesn't understand "-v"
+ $CC -v || true
+fi
+if [ "$WITH_VALGRIND" = "yes" ]; then
+ valgrind --version
+fi
+if [ -n "$WRAPPER_CMD" ]; then
+ $WRAPPER_CMD --version
+fi
./autogen.sh
@@ -63,6 +100,9 @@ then
make precomp
fi
+# Shutdown wineserver again
+wineserver -k || true
+
# Check that no repo files have been modified by the build.
# (This fails for example if the precomp files need to be updated in the repo.)
git diff --exit-code