aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/ci
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2023-09-04 12:51:20 -0400
committerPieter Wuille <pieter@wuille.net>2023-09-04 12:51:20 -0400
commit0e0fc18c3cf8c0aa4cca85c4294416463f157870 (patch)
tree9ea54b2a529bdcf5b380ac54e7894f9aac949eaa /src/secp256k1/ci
parent6f03c45f6bb5a6edaa3051968b6a1ca4f84d2ccb (diff)
parentc0da4f60e2145a9838c0c5d0a02592faf16d2d8d (diff)
downloadbitcoin-0e0fc18c3cf8c0aa4cca85c4294416463f157870.tar.xz
Update secp256k1 subtree to upstream release 0.4.0
Diffstat (limited to 'src/secp256k1/ci')
-rwxr-xr-xsrc/secp256k1/ci/ci.sh (renamed from src/secp256k1/ci/cirrus.sh)17
-rw-r--r--src/secp256k1/ci/linux-debian.Dockerfile72
2 files changed, 43 insertions, 46 deletions
diff --git a/src/secp256k1/ci/cirrus.sh b/src/secp256k1/ci/ci.sh
index 48a9783cc4..719e7851ef 100755
--- a/src/secp256k1/ci/cirrus.sh
+++ b/src/secp256k1/ci/ci.sh
@@ -13,7 +13,7 @@ print_environment() {
# does not rely on bash.
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
- EXPERIMENTAL ECDH RECOVERY SCHNORRSIG \
+ EXPERIMENTAL ECDH RECOVERY SCHNORRSIG ELLSWIFT \
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
EXAMPLES \
HOST WRAPPER_CMD \
@@ -31,18 +31,15 @@ print_environment() {
}
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*)
- # Make sure to shutdown wineserver whenever we exit.
- trap "wineserver -k || true" EXIT INT HUP
- wineserver -p
+env >> test_env.log
+
+# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang).
+case "${CC:-undefined}" in
+ *gcc*)
+ $CC -v 2>&1 | grep -q "gcc version" || exit 1;
;;
esac
-env >> test_env.log
-
if [ -n "${CC+x}" ]; then
# The MSVC compiler "cl" doesn't understand "-v"
$CC -v || true
diff --git a/src/secp256k1/ci/linux-debian.Dockerfile b/src/secp256k1/ci/linux-debian.Dockerfile
index dbb1dd2919..e719907e89 100644
--- a/src/secp256k1/ci/linux-debian.Dockerfile
+++ b/src/secp256k1/ci/linux-debian.Dockerfile
@@ -1,7 +1,18 @@
-FROM debian:stable
+FROM debian:stable-slim
SHELL ["/bin/bash", "-c"]
+WORKDIR /root
+
+# A too high maximum number of file descriptors (with the default value
+# inherited from the docker host) can cause issues with some of our tools:
+# - sanitizers hanging: https://github.com/google/sanitizers/issues/1662
+# - valgrind crashing: https://stackoverflow.com/a/75293014
+# This is not be a problem on our CI hosts, but developers who run the image
+# on their machines may run into this (e.g., on Arch Linux), so warn them.
+# (Note that .bashrc is only executed in interactive bash shells.)
+RUN echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> /root/.bashrc
+
RUN dpkg --add-architecture i386 && \
dpkg --add-architecture s390x && \
dpkg --add-architecture armhf && \
@@ -11,7 +22,7 @@ RUN dpkg --add-architecture i386 && \
# dkpg-dev: to make pkg-config work in cross-builds
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
RUN apt-get update && apt-get install --no-install-recommends -y \
- git ca-certificates wget \
+ git ca-certificates \
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
gcc clang llvm libclang-rt-dev libc6-dbg \
g++ \
@@ -22,13 +33,13 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross libc6-dbg:ppc64el \
gcc-mingw-w64-x86-64-win32 wine64 wine \
gcc-mingw-w64-i686-win32 wine32 \
- sagemath
-
-WORKDIR /root
+ python3
# Build and install gcc snapshot
ARG GCC_SNAPSHOT_MAJOR=14
-RUN wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \
+RUN apt-get update && apt-get install --no-install-recommends -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \
+ mkdir gcc && cd gcc && \
+ wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \
wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \
sha512sum --check --ignore-missing sha512.sum && \
# We should have downloaded exactly one tar.xz file
@@ -36,40 +47,29 @@ RUN wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --leve
[[ $(ls *.tar.xz | wc -l) -eq "1" ]] && \
tar xf *.tar.xz && \
mkdir gcc-build && cd gcc-build && \
- apt-get update && apt-get install --no-install-recommends -y libgmp-dev libmpfr-dev libmpc-dev flex && \
../*/configure --prefix=/opt/gcc-snapshot --enable-languages=c --disable-bootstrap --disable-multilib --without-isl && \
make -j $(nproc) && \
make install && \
- ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
+ cd ../.. && rm -rf gcc && \
+ ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot && \
+ apt-get autoremove -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-# Install clang snapshot
-RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
+# Install clang snapshot, see https://apt.llvm.org/
+RUN \
+ # Setup GPG keys of LLVM repository
+ apt-get update && apt-get install --no-install-recommends -y wget && \
+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
# Add repository for this Debian release
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
- # Install clang snapshot
- apt-get update && apt-get install --no-install-recommends -y clang && \
- # Remove just the "clang" symlink again
- apt-get remove -y clang && \
- # We should have exactly two clang versions now
- ls /usr/bin/clang* && \
- [[ $(ls /usr/bin/clang-?? | sort | wc -l) -eq "2" ]] && \
- # Create symlinks for them
- ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
- ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
+ apt-get update && \
+ # Determine the version number of the LLVM development branch
+ LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) && \
+ # Install
+ apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" && \
+ # Create symlink
+ ln -s "/usr/bin/clang-${LLVM_VERSION}" /usr/bin/clang-snapshot && \
+ # Clean up
+ apt-get autoremove -y wget && \
+ apt-get clean && rm -rf /var/lib/apt/lists/*
-# The "wine" package provides a convenience wrapper that we need
-RUN apt-get update && apt-get install --no-install-recommends -y \
- git ca-certificates wine64 wine python3-simplejson python3-six msitools winbind procps && \
-# Workaround for `wine` package failure to employ the Debian alternatives system properly.
- ln -s /usr/lib/wine/wine64 /usr/bin/wine64 && \
-# Set of tools for using MSVC on Linux.
- git clone https://github.com/mstorsjo/msvc-wine && \
- mkdir /opt/msvc && \
- python3 msvc-wine/vsdownload.py --accept-license --dest /opt/msvc Microsoft.VisualStudio.Workload.VCTools && \
-# Since commit 2146cbfaf037e21de56c7157ec40bb6372860f51, the
-# msvc-wine effectively initializes the wine prefix when running
-# the install.sh script.
- msvc-wine/install.sh /opt/msvc && \
-# Wait until the wineserver process has exited before closing the session,
-# to avoid corrupting the wine prefix.
- while (ps -A | grep wineserver) > /dev/null; do sleep 1; done