Skip to content

Commit f8c0b57

Browse files
committed
Merge #864: Add support for Cirrus CI
cc2a545 ci: Refactor Nix shell files (Jonas Nick) 2480e55 ci: Remove support for Travis CI (Tim Ruffing) 2b359f1 ci: Enable simple cache for brewing valgrind on macOS (Tim Ruffing) 8c02e46 ci: Add support for Cirrus CI (Tim Ruffing) Pull request description: ACKs for top commit: sipa: ACK cc2a545. Tested by introducing bugs: #883, #884, #885, #886, #887. jonasnick: ACK cc2a545 Tree-SHA512: c9e8a891c9bda48b3fc307c2a85d2e4aa180531d084edd778d41c034769661627538ab397efac3abfc1a71c2f0730a45350dd212d499fe475c90a2a1b3c61ac8
2 parents 659d0d4 + cc2a545 commit f8c0b57

9 files changed

+259
-123
lines changed

.cirrus.yml

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
env:
2+
WIDEMUL: auto
3+
BIGNUM: auto
4+
STATICPRECOMPUTATION: yes
5+
ECMULTGENPRECISION: auto
6+
ASM: no
7+
BUILD: check
8+
WITH_VALGRIND: yes
9+
RUN_VALGRIND: no
10+
EXTRAFLAGS:
11+
HOST:
12+
ECDH: no
13+
RECOVERY: no
14+
SCHNORRSIG: no
15+
EXPERIMENTAL: no
16+
CTIMETEST: yes
17+
BENCH: yes
18+
ITERS: 2
19+
# We only need the top commit
20+
CIRRUS_CLONE_DEPTH: 1
21+
22+
cat_logs_snippet: &CAT_LOGS
23+
always:
24+
test_logs_script:
25+
- cat tests.log || true
26+
- cat exhaustive_tests.log || true
27+
- cat valgrind_ctime_test.log || true
28+
- cat bench.log || true
29+
on_failure:
30+
debug_output_script:
31+
- cat config.log || true
32+
- cat test_env.log || true
33+
- env
34+
35+
task:
36+
name: "x86_64: Linux (Alpine Linux, Nix Shell)"
37+
container:
38+
dockerfile: ci/linux-nixos.Dockerfile
39+
# Reduce number of CPUs to be able to do more builds in parallel.
40+
cpu: 1
41+
# More than enough for our scripts.
42+
memory: 1G
43+
matrix: &ENV_MATRIX
44+
- env: {WIDEMUL: int64, RECOVERY: yes}
45+
- env: {WIDEMUL: int64, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
46+
- env: {WIDEMUL: int128}
47+
- env: {WIDEMUL: int128, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
48+
- env: {WIDEMUL: int128, ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
49+
- env: {WIDEMUL: int128, ASM: x86_64}
50+
- env: {BIGNUM: no}
51+
- env: {BIGNUM: no, RECOVERY: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
52+
- env: {BIGNUM: no, STATICPRECOMPUTATION: no}
53+
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
54+
- env: {CPPFLAGS: -DDETERMINISTIC}
55+
- env: {CFLAGS: -O0, CTIMETEST: no}
56+
- env:
57+
CFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
58+
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
59+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
60+
BIGNUM: no
61+
ASM: x86_64
62+
ECDH: yes
63+
RECOVERY: yes
64+
EXPERIMENTAL: yes
65+
SCHNORRSIG: yes
66+
CTIMETEST: no
67+
- env: { ECMULTGENPRECISION: 2 }
68+
- env: { ECMULTGENPRECISION: 8 }
69+
- env:
70+
RUN_VALGRIND: yes
71+
BIGNUM: no
72+
ASM: x86_64
73+
ECDH: yes
74+
RECOVERY: yes
75+
EXPERIMENTAL: yes
76+
SCHNORRSIG: yes
77+
EXTRAFLAGS: "--disable-openssl-tests"
78+
BUILD:
79+
matrix:
80+
- env:
81+
CC: gcc
82+
- env:
83+
CC: clang
84+
test_script:
85+
- nix-shell ci/shell.nix --run ./ci/cirrus.sh
86+
<< : *CAT_LOGS
87+
88+
task:
89+
name: "i686: Linux (Alpine Linux, Nix Shell)"
90+
container:
91+
dockerfile: ci/linux-nixos.Dockerfile
92+
cpu: 1
93+
memory: 1G
94+
env:
95+
HOST: i686-linux-gnu
96+
ECDH: yes
97+
RECOVERY: yes
98+
EXPERIMENTAL: yes
99+
SCHNORRSIG: yes
100+
matrix:
101+
- env:
102+
CC: gcc
103+
- env:
104+
CC: clang
105+
matrix:
106+
- env:
107+
BIGNUM: gmp
108+
- env:
109+
BIGNUM: no
110+
test_script:
111+
- nix-shell ci/shell-i686.nix --run ./ci/cirrus.sh
112+
<< : *CAT_LOGS
113+
114+
task:
115+
name: "x86_64: macOS Catalina"
116+
macos_instance:
117+
image: catalina-base
118+
env:
119+
HOMEBREW_NO_AUTO_UPDATE: 1
120+
HOMEBREW_NO_INSTALL_CLEANUP: 1
121+
matrix:
122+
<< : *ENV_MATRIX
123+
matrix:
124+
- env:
125+
CC: gcc-9
126+
- env:
127+
CC: clang
128+
# Update Command Line Tools
129+
# Uncomment this if the Command Line Tools on the CirrusCI macOS image are too old to brew valgrind.
130+
# See https://apple.stackexchange.com/a/195963 for the implementation.
131+
## update_clt_script:
132+
## - system_profiler SPSoftwareDataType
133+
## - touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
134+
## - |-
135+
## PROD=$(softwareupdate -l | grep "*.*Command Line" | tail -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | sed 's/Label: //g' | tr -d '\n')
136+
## # For debugging
137+
## - softwareupdate -l && echo "PROD: $PROD"
138+
## - softwareupdate -i "$PROD" --verbose
139+
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
140+
##
141+
brew_valgrind_pre_script:
142+
- brew config
143+
- brew tap --shallow LouisBrunner/valgrind
144+
# Fetch valgrind source but don't build it yet.
145+
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
146+
brew_valgrind_cache:
147+
# This is $(brew --cellar valgrind) but command substition does not work here.
148+
folder: /usr/local/Cellar/valgrind
149+
# Rebuild cache if ...
150+
fingerprint_script:
151+
# ... macOS version changes:
152+
- sw_vers
153+
# ... brew changes:
154+
- brew config
155+
# ... valgrind changes:
156+
- git -C "$(brew --cache)/valgrind--git" rev-parse HEAD
157+
populate_script:
158+
# If there's no hit in the cache, build and install valgrind.
159+
- brew install --HEAD LouisBrunner/valgrind/valgrind
160+
brew_valgrind_post_script:
161+
# If we have restored valgrind from the cache, tell brew to create symlink to the PATH.
162+
# If we haven't restored from cached (and just run brew install), this is a no-op.
163+
- brew link valgrind
164+
brew_script:
165+
- brew install automake libtool gmp gcc@9
166+
test_script:
167+
- ./ci/cirrus.sh
168+
<< : *CAT_LOGS
169+
170+
task:
171+
name: "s390x (big-endian): Linux (Debian QEMU)"
172+
container:
173+
dockerfile: ci/linux-debian-s390-qemu.Dockerfile
174+
cpu: 1
175+
memory: 1G
176+
env:
177+
QEMU_CMD: qemu-s390x
178+
HOST: s390x-linux-gnu
179+
BUILD:
180+
WITH_VALGRIND: no
181+
BIGNUM: no
182+
ECDH: yes
183+
RECOVERY: yes
184+
EXPERIMENTAL: yes
185+
SCHNORRSIG: yes
186+
CTIMETEST: no
187+
test_script:
188+
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
189+
- rm /etc/ld.so.cache
190+
- ./ci/cirrus.sh
191+
<< : *CAT_LOGS

.travis.yml

-109
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libsecp256k1
22
============
33

4-
[![Build Status](https://travis-ci.org/bitcoin-core/secp256k1.svg?branch=master)](https://travis-ci.org/bitcoin-core/secp256k1)
4+
[![Build Status](https://api.cirrus-ci.com/github/bitcoin-core/secp256k1.svg?branch=master)](https://cirrus-ci.com/github/bitcoin-core/secp256k1)
55

66
Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1.
77

contrib/travis.sh ci/cirrus.sh

+29-13
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
set -e
44
set -x
55

6-
if [ "$HOST" = "i686-linux-gnu" ]
7-
then
8-
export CC="$CC -m32"
9-
fi
10-
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
11-
then
12-
export CC="gcc-9"
13-
fi
6+
export LC_ALL=C
7+
8+
env >> test_env.log
9+
10+
$CC -v || true
11+
valgrind --version || true
12+
13+
./autogen.sh
14+
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
1418

1519
./configure \
1620
--enable-experimental="$EXPERIMENTAL" \
@@ -25,23 +29,35 @@ if [ -n "$BUILD" ]
2529
then
2630
make -j2 "$BUILD"
2731
fi
32+
2833
if [ "$RUN_VALGRIND" = "yes" ]
2934
then
3035
make -j2
3136
# 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)
3237
valgrind --error-exitcode=42 ./tests 16
3338
valgrind --error-exitcode=42 ./exhaustive_tests
3439
fi
40+
41+
if [ -n "$QEMU_CMD" ]
42+
then
43+
make -j2
44+
$QEMU_CMD ./tests 16
45+
$QEMU_CMD ./exhaustive_tests
46+
fi
47+
3548
if [ "$BENCH" = "yes" ]
3649
then
50+
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
51+
EXEC='./libtool --mode=execute'
52+
if [ -n "$QEMU_CMD" ]
53+
then
54+
EXEC="$EXEC $QEMU_CMD"
55+
fi
3756
if [ "$RUN_VALGRIND" = "yes" ]
3857
then
39-
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
40-
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
41-
else
42-
EXEC=
58+
EXEC="$EXEC valgrind --error-exitcode=42"
4359
fi
44-
# This limits the iterations in the benchmarks below to ITER(set in .travis.yml) iterations.
60+
# This limits the iterations in the benchmarks below to ITER iterations.
4561
export SECP256K1_BENCH_ITERS="$ITERS"
4662
{
4763
$EXEC ./bench_ecmult

ci/linux-debian-s390-qemu.Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM debian
2+
3+
RUN dpkg --add-architecture s390x
4+
RUN apt-get update
5+
RUN apt-get install --no-install-recommends --no-upgrade -y make automake libtool
6+
RUN apt-get install --no-install-recommends --no-upgrade -y gcc-s390x-linux-gnu libc6-dev-s390x-cross qemu-user libc6:s390x

ci/linux-nixos.Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM nixos/nix
2+
3+
COPY ci/shell.nix /tmp
4+
COPY ci/shell-i686.nix /tmp
5+
6+
RUN nix-channel --remove nixpkgs
7+
RUN nix-channel --add https://nixos.org/channels/nixos-20.09 nixpkgs
8+
RUN nix-channel --update
9+
10+
# Run dummy command "true" in the nix-shell just to get the packages prepared.
11+
RUN nix-shell /tmp/shell.nix --command true
12+
RUN nix-shell /tmp/shell-i686.nix --command true

0 commit comments

Comments
 (0)