Skip to content

Commit

Permalink
ci: Switch all Linux builds to Debian
Browse files Browse the repository at this point in the history
The experiment of using Nix Shell was not really successful. Most
notably, Nix uses a bunch of wrapper scripts around compilers, which
make the build much less "pure". This may be useful but it's exactly
not what we want for CI. In particular, this resulted in gcc being used
for the "clang" builds because a wrapper script redefined the CC env
variable.

This now builds a single docker image (Debian) for all architectures
that we test in CI on Linux.
  • Loading branch information
real-or-random committed Mar 2, 2021
1 parent 7d3497c commit f24e122
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 52 deletions.
20 changes: 10 additions & 10 deletions .cirrus.yml
Expand Up @@ -33,9 +33,9 @@ cat_logs_snippet: &CAT_LOGS
- env

task:
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.
Expand Down Expand Up @@ -82,13 +82,13 @@ task:
- env:
CC: clang
test_script:
- nix-shell ci/shell.nix --run ./ci/cirrus.sh
- ./ci/cirrus.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:
Expand All @@ -99,16 +99,16 @@ task:
SCHNORRSIG: yes
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/cirrus.sh
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
Expand Down Expand Up @@ -168,9 +168,9 @@ task:
<< : *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:
Expand Down
4 changes: 0 additions & 4 deletions ci/cirrus.sh
Expand Up @@ -12,10 +12,6 @@ valgrind --version || true

./autogen.sh

# 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 .
sed -i'' -e 's@/usr/bin/file@$(which file)@g' configure

./configure \
--enable-experimental="$EXPERIMENTAL" \
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
Expand Down
6 changes: 0 additions & 6 deletions ci/linux-debian-s390-qemu.Dockerfile

This file was deleted.

12 changes: 12 additions & 0 deletions ci/linux-debian.Dockerfile
@@ -0,0 +1,12 @@
FROM debian:stable

RUN dpkg --add-architecture i386
RUN dpkg --add-architecture s390x
RUN apt-get update

# dkpg-dev: to make pkg-config work in cross-builds
RUN apt-get install --no-install-recommends --no-upgrade -y \
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
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
12 changes: 0 additions & 12 deletions ci/linux-nixos.Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions ci/mkshell.nix

This file was deleted.

4 changes: 0 additions & 4 deletions ci/shell-i686.nix

This file was deleted.

4 changes: 0 additions & 4 deletions ci/shell.nix

This file was deleted.

0 comments on commit f24e122

Please sign in to comment.