Skip to content

Commit 4c3ba88

Browse files
Merge #901: ci: Switch all Linux builds to Debian and more improvements
9361f36 ci: Select number of parallel make jobs depending on CI environment (Tim Ruffing) 28eccdf ci: Split output of logs into multiple sections (Tim Ruffing) c7f754f ci: Run PRs on merge result instead of on the source branch (Tim Ruffing) b994a8b ci: Print information about binaries using "file" (Tim Ruffing) f24e122 ci: Switch all Linux builds to Debian (Tim Ruffing) Pull request description: Best reviewed commit by commit ACKs for top commit: jonasnick: ACK 9361f36 sipa: utACK 9361f36 Tree-SHA512: fc754e8b57dc58058cebbf63a60ca76e08dbaefea1508ea27b7f962bce697c10033da3f57a35f731bc7cf3e210eb00e3b8985ae8b729d7bd83faee085b878b9c
2 parents ebdba03 + 9361f36 commit 4c3ba88

8 files changed

+54
-59
lines changed

.cirrus.yml

+32-14
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,38 @@ env:
1616
CTIMETEST: yes
1717
BENCH: yes
1818
ITERS: 2
19-
# We only need the top commit
20-
CIRRUS_CLONE_DEPTH: 1
19+
MAKEFLAGS: -j2
2120

2221
cat_logs_snippet: &CAT_LOGS
2322
always:
24-
test_logs_script:
23+
cat_tests_log_script:
2524
- cat tests.log || true
25+
cat_exhaustive_tests_log_script:
2626
- cat exhaustive_tests.log || true
27+
cat_valgrind_ctime_test_log_script:
2728
- cat valgrind_ctime_test.log || true
29+
cat_bench_log_script:
2830
- cat bench.log || true
2931
on_failure:
30-
debug_output_script:
32+
cat_config_log_script:
3133
- cat config.log || true
34+
cat_test_env_script:
3235
- cat test_env.log || true
36+
cat_ci_env_script:
3337
- env
3438

39+
merge_base_script_snippet: &MERGE_BASE
40+
merge_base_script:
41+
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
42+
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
43+
- git config --global user.email "[email protected]"
44+
- git config --global user.name "ci"
45+
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
46+
3547
task:
36-
name: "x86_64: Linux (Alpine Linux, Nix Shell)"
48+
name: "x86_64: Linux (Debian stable)"
3749
container:
38-
dockerfile: ci/linux-nixos.Dockerfile
50+
dockerfile: ci/linux-debian.Dockerfile
3951
# Reduce number of CPUs to be able to do more builds in parallel.
4052
cpu: 1
4153
# More than enough for our scripts.
@@ -81,14 +93,15 @@ task:
8193
CC: gcc
8294
- env:
8395
CC: clang
96+
<< : *MERGE_BASE
8497
test_script:
85-
- nix-shell ci/shell.nix --run ./ci/cirrus.sh
98+
- ./ci/cirrus.sh
8699
<< : *CAT_LOGS
87100

88101
task:
89-
name: "i686: Linux (Alpine Linux, Nix Shell)"
102+
name: "i686: Linux (Debian stable)"
90103
container:
91-
dockerfile: ci/linux-nixos.Dockerfile
104+
dockerfile: ci/linux-debian.Dockerfile
92105
cpu: 1
93106
memory: 1G
94107
env:
@@ -99,16 +112,17 @@ task:
99112
SCHNORRSIG: yes
100113
matrix:
101114
- env:
102-
CC: gcc
115+
CC: i686-linux-gnu-gcc
103116
- env:
104-
CC: clang
117+
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
105118
matrix:
106119
- env:
107120
BIGNUM: gmp
108121
- env:
109122
BIGNUM: no
123+
<< : *MERGE_BASE
110124
test_script:
111-
- nix-shell ci/shell-i686.nix --run ./ci/cirrus.sh
125+
- ./ci/cirrus.sh
112126
<< : *CAT_LOGS
113127

114128
task:
@@ -118,6 +132,8 @@ task:
118132
env:
119133
HOMEBREW_NO_AUTO_UPDATE: 1
120134
HOMEBREW_NO_INSTALL_CLEANUP: 1
135+
# Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment...
136+
MAKEFLAGS: -j13
121137
matrix:
122138
<< : *ENV_MATRIX
123139
matrix:
@@ -163,14 +179,15 @@ task:
163179
- brew link valgrind
164180
brew_script:
165181
- brew install automake libtool gmp gcc@9
182+
<< : *MERGE_BASE
166183
test_script:
167184
- ./ci/cirrus.sh
168185
<< : *CAT_LOGS
169186

170187
task:
171-
name: "s390x (big-endian): Linux (Debian QEMU)"
188+
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
172189
container:
173-
dockerfile: ci/linux-debian-s390-qemu.Dockerfile
190+
dockerfile: ci/linux-debian.Dockerfile
174191
cpu: 1
175192
memory: 1G
176193
env:
@@ -184,6 +201,7 @@ task:
184201
EXPERIMENTAL: yes
185202
SCHNORRSIG: yes
186203
CTIMETEST: no
204+
<< : *MERGE_BASE
187205
test_script:
188206
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
189207
- rm /etc/ld.so.cache

ci/cirrus.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ valgrind --version || true
1212

1313
./autogen.sh
1414

15-
# Nix doesn't store GNU file in /usr/bin, see https://lists.gnu.org/archive/html/bug-libtool/2015-09/msg00000.html .
16-
# The -i'' is necessary for macOS portability, see https://stackoverflow.com/a/4247319 .
17-
sed -i'' -e 's@/usr/bin/file@$(which file)@g' configure
18-
1915
./configure \
2016
--enable-experimental="$EXPERIMENTAL" \
2117
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
@@ -25,22 +21,28 @@ sed -i'' -e 's@/usr/bin/file@$(which file)@g' configure
2521
--with-valgrind="$WITH_VALGRIND" \
2622
--host="$HOST" $EXTRAFLAGS
2723

24+
# We have set "-j<n>" in MAKEFLAGS.
25+
make
26+
27+
# Print information about binaries so that we can see that the architecture is correct
28+
file *tests || true
29+
file bench_* || true
30+
file .libs/* || true
31+
2832
if [ -n "$BUILD" ]
2933
then
30-
make -j2 "$BUILD"
34+
make "$BUILD"
3135
fi
3236

3337
if [ "$RUN_VALGRIND" = "yes" ]
3438
then
35-
make -j2
3639
# the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (https://www.valgrind.org/docs/manual/manual-core.html)
3740
valgrind --error-exitcode=42 ./tests 16
3841
valgrind --error-exitcode=42 ./exhaustive_tests
3942
fi
4043

4144
if [ -n "$QEMU_CMD" ]
4245
then
43-
make -j2
4446
$QEMU_CMD ./tests 16
4547
$QEMU_CMD ./exhaustive_tests
4648
fi

ci/linux-debian-s390-qemu.Dockerfile

-6
This file was deleted.

ci/linux-debian.Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:stable
2+
3+
RUN dpkg --add-architecture i386
4+
RUN dpkg --add-architecture s390x
5+
RUN apt-get update
6+
7+
# dkpg-dev: to make pkg-config work in cross-builds
8+
RUN apt-get install --no-install-recommends --no-upgrade -y \
9+
git ca-certificates \
10+
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
11+
gcc clang libc6-dbg libgmp-dev \
12+
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libgmp-dev:i386 \
13+
gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x

ci/linux-nixos.Dockerfile

-12
This file was deleted.

ci/mkshell.nix

-12
This file was deleted.

ci/shell-i686.nix

-4
This file was deleted.

ci/shell.nix

-4
This file was deleted.

0 commit comments

Comments
 (0)