diff --git a/src/secp256k1/.cirrus.yml b/src/secp256k1/.cirrus.yml --- a/src/secp256k1/.cirrus.yml +++ b/src/secp256k1/.cirrus.yml @@ -22,21 +22,22 @@ CTIMETEST: yes BENCH: yes ITERS: 2 - # We only need the top commit - CIRRUS_CLONE_DEPTH: 1 + MAKEFLAGS: -j2 cat_logs_snippet: &CAT_LOGS on_failure: - debug_output_script: + cat_config_log_script: - cat config.log || true + cat_test_env_script: - cat test_env.log || true + cat_ci_env_script: - env task: timeout_in: 120m - name: "x86_64: Linux (Alpine Linux, Nix Shell)" + name: "x86_64: Linux (Debian stable)" container: - dockerfile: ci/linux-nixos.Dockerfile + dockerfile: ci/linux-debian.Dockerfile # Reduce number of CPUs to be able to do more builds in parallel. cpu: 1 # More than enough for our scripts. @@ -90,14 +91,14 @@ - env: CC: clang test_script: - - nix-shell ci/shell.nix --run ./ci/build_autotools.sh - - nix-shell ci/shell.nix --run ./ci/build_cmake.sh + - ./ci/build_autotools.sh + - ./ci/build_cmake.sh << : *CAT_LOGS task: - name: "i686: Linux (Alpine Linux, Nix Shell)" + name: "i686: Linux (Debian stable)" container: - dockerfile: ci/linux-nixos.Dockerfile + dockerfile: ci/linux-debian.Dockerfile cpu: 1 memory: 1G env: @@ -109,17 +110,17 @@ OPENSSL_TESTS: no matrix: - env: - CC: gcc + CC: i686-linux-gnu-gcc - env: - CC: clang + CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include matrix: - env: BIGNUM: gmp - env: BIGNUM: no test_script: - - nix-shell ci/shell-i686.nix --run ./ci/build_autotools.sh - - nix-shell ci/shell-i686.nix --run ./ci/build_cmake.sh + - ./ci/build_autotools.sh + - ./ci/build_cmake.sh << : *CAT_LOGS task: @@ -130,6 +131,8 @@ env: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 + # Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment... + MAKEFLAGS: -j13 matrix: << : *ENV_MATRIX matrix: @@ -181,9 +184,9 @@ << : *CAT_LOGS task: - name: "s390x (big-endian): Linux (Debian QEMU)" + name: "s390x (big-endian): Linux (Debian stable, QEMU)" container: - dockerfile: ci/linux-debian-s390-qemu.Dockerfile + dockerfile: ci/linux-debian.Dockerfile cpu: 1 memory: 1G env: diff --git a/src/secp256k1/ci/build_autotools.sh b/src/secp256k1/ci/build_autotools.sh --- a/src/secp256k1/ci/build_autotools.sh +++ b/src/secp256k1/ci/build_autotools.sh @@ -31,12 +31,6 @@ mkdir buildautotools pushd buildautotools -# Nix doesn't store GNU file in /usr/bin, see https://lists.gnu.org/archive/html/bug-libtool/2015-09/msg00000.html . -# The -i'' is necessary for macOS portability, see https://stackoverflow.com/a/4247319 . -if [ "${CIRRUS_CI}" = "true" ]; then - sed -i'' -e 's@/usr/bin/file@$(which file)@g' ../configure -fi - ../configure \ --enable-experimental=$EXPERIMENTAL \ --with-test-override-wide-multiply=$WIDEMUL \ @@ -63,7 +57,13 @@ } trap 'print_logs' ERR -make -j2 $AUTOTOOLS_TARGET +# We have set "-j" in MAKEFLAGS. +make $AUTOTOOLS_TARGET + +# Print information about binaries so that we can see that the architecture is correct +file *tests || true +file bench_* || true +file .libs/* || true if [ "$RUN_VALGRIND" = "yes" ]; then # the `--error-exitcode` is required to make the test fail if valgrind found diff --git a/src/secp256k1/ci/build_cmake.sh b/src/secp256k1/ci/build_cmake.sh --- a/src/secp256k1/ci/build_cmake.sh +++ b/src/secp256k1/ci/build_cmake.sh @@ -56,4 +56,9 @@ ninja $CMAKE_TARGET +# Print information about binaries so that we can see that the architecture is correct +file *tests || true +file *-bench || true +file libsecp256k1.* || true + popd diff --git a/src/secp256k1/ci/linux-debian-s390-qemu.Dockerfile b/src/secp256k1/ci/linux-debian-s390-qemu.Dockerfile deleted file mode 100644 --- a/src/secp256k1/ci/linux-debian-s390-qemu.Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:buster - -RUN dpkg --add-architecture s390x -RUN echo "deb http://deb.debian.org/debian buster-backports main" | tee -a /etc/apt/sources.list -RUN apt-get update -RUN apt-get install --no-install-recommends --no-upgrade -y automake libtool make ninja-build python3 -RUN apt-get install --no-install-recommends --no-upgrade -y gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6:s390x qemu-user -RUN apt-get install -t buster-backports --no-install-recommends --no-upgrade -y cmake diff --git a/src/secp256k1/ci/linux-debian.Dockerfile b/src/secp256k1/ci/linux-debian.Dockerfile new file mode 100644 --- /dev/null +++ b/src/secp256k1/ci/linux-debian.Dockerfile @@ -0,0 +1,14 @@ +FROM debian:stable + +RUN dpkg --add-architecture i386 +RUN dpkg --add-architecture s390x +RUN echo "deb http://deb.debian.org/debian buster-backports main" | tee -a /etc/apt/sources.list +RUN apt-get update + +# dkpg-dev: to make pkg-config work in cross-builds +RUN apt-get install --no-install-recommends --no-upgrade -y \ + automake default-jdk dpkg-dev libssl-dev libtool make ninja-build pkg-config python3 qemu-user valgrind \ + gcc clang libc6-dbg libgmp-dev \ + gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libgmp-dev:i386 \ + gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x +RUN apt-get install -t buster-backports --no-install-recommends --no-upgrade -y cmake diff --git a/src/secp256k1/ci/linux-nixos.Dockerfile b/src/secp256k1/ci/linux-nixos.Dockerfile deleted file mode 100644 --- a/src/secp256k1/ci/linux-nixos.Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM nixos/nix - -COPY ci/shell.nix /tmp -COPY ci/shell-i686.nix /tmp - -RUN nix-channel --remove nixpkgs -RUN nix-channel --add https://nixos.org/channels/nixos-20.09 nixpkgs -RUN nix-channel --update - -# Run dummy command "true" in the nix-shell just to get the packages prepared. -RUN nix-shell /tmp/shell.nix --command true -RUN nix-shell /tmp/shell-i686.nix --command true diff --git a/src/secp256k1/ci/shell-i686.nix b/src/secp256k1/ci/shell-i686.nix deleted file mode 100644 --- a/src/secp256k1/ci/shell-i686.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs ? (import {}).pkgsi686Linux }: - -with pkgs; - -mkShell { - buildInputs = [ - autoconf automake bash clang cmake file gcc gmp libtool ninja pkgconfig python3 valgrind - ]; - shellHook = '' - echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version) - ''; -} diff --git a/src/secp256k1/ci/shell.nix b/src/secp256k1/ci/shell.nix deleted file mode 100644 --- a/src/secp256k1/ci/shell.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs ? import {} }: - -with pkgs; - -mkShell { - buildInputs = [ - autoconf automake bash clang cmake file gcc gmp jdk11_headless libtool ninja openssl pkgconfig python3 valgrind - ]; - shellHook = '' - echo Running nix-shell with nixpkgs version: $(nix eval --raw nixpkgs.lib.version) - ''; -}