2020-12-22 15:42:08 +00:00
env :
2021-05-06 12:02:00 +00:00
### compiler options
HOST :
# Specific warnings can be disabled with -Wno-error=foo.
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
WERROR_CFLAGS : -Werror -pedantic-errors
2021-12-20 17:00:13 +00:00
MAKEFLAGS : -j4
2021-05-06 12:02:00 +00:00
BUILD : check
### secp256k1 config
2021-12-15 13:10:46 +00:00
ECMULTWINDOW : auto
2020-12-22 15:42:08 +00:00
ECMULTGENPRECISION : auto
ASM : no
2021-05-06 12:02:00 +00:00
WIDEMUL : auto
2020-12-22 15:42:08 +00:00
WITH_VALGRIND : yes
EXTRAFLAGS :
2021-05-06 12:02:00 +00:00
### secp256k1 modules
EXPERIMENTAL : no
2020-12-22 15:42:08 +00:00
ECDH : no
RECOVERY : no
SCHNORRSIG : no
2021-05-06 12:02:00 +00:00
### test options
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS :
2021-05-06 12:02:00 +00:00
BENCH : yes
2021-11-08 20:02:30 +00:00
SECP256K1_BENCH_ITERS : 2
2021-05-06 12:02:00 +00:00
CTIMETEST : yes
2020-04-30 11:34:24 +00:00
# Compile and run the tests
EXAMPLES : yes
2020-12-22 15:42:08 +00:00
cat_logs_snippet : &CAT_LOGS
always :
2021-03-01 23:09:05 +00:00
cat_tests_log_script :
2020-12-22 15:42:08 +00:00
- cat tests.log || true
2021-03-01 23:09:05 +00:00
cat_exhaustive_tests_log_script :
2020-12-22 15:42:08 +00:00
- cat exhaustive_tests.log || true
2021-03-01 23:09:05 +00:00
cat_valgrind_ctime_test_log_script :
2020-12-22 15:42:08 +00:00
- cat valgrind_ctime_test.log || true
2021-03-01 23:09:05 +00:00
cat_bench_log_script :
2020-12-22 15:42:08 +00:00
- cat bench.log || true
on_failure :
2021-03-01 23:09:05 +00:00
cat_config_log_script :
2020-12-22 15:42:08 +00:00
- cat config.log || true
2021-03-01 23:09:05 +00:00
cat_test_env_script :
2020-12-22 15:42:08 +00:00
- cat test_env.log || true
2021-03-01 23:09:05 +00:00
cat_ci_env_script :
2020-12-22 15:42:08 +00:00
- env
2021-03-01 22:50:54 +00:00
merge_base_script_snippet : &MERGE_BASE
merge_base_script :
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
- git config --global user.email "ci@ci.ci"
- git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
2021-12-20 17:00:13 +00:00
linux_container_snippet : &LINUX_CONTAINER
2020-12-22 15:42:08 +00:00
container :
2021-02-26 14:52:40 +00:00
dockerfile : ci/linux-debian.Dockerfile
2020-12-22 15:42:08 +00:00
# Reduce number of CPUs to be able to do more builds in parallel.
cpu : 1
2021-12-20 17:00:13 +00:00
# Gives us more CPUs for free if they're available.
greedy : true
2020-12-22 15:42:08 +00:00
# More than enough for our scripts.
memory : 1G
2021-12-20 17:00:13 +00:00
task :
name : "x86_64: Linux (Debian stable)"
<< : *LINUX_CONTAINER
2020-12-22 15:42:08 +00:00
matrix : &ENV_MATRIX
- env : {WIDEMUL: int64, RECOVERY : yes }
2021-10-20 11:45:31 +00:00
- env : {WIDEMUL: int64, ECDH: yes, SCHNORRSIG : yes }
2020-12-22 15:42:08 +00:00
- env : {WIDEMUL : int128}
2021-10-20 11:45:31 +00:00
- env : {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG : yes }
- env : {WIDEMUL: int128, ECDH: yes, SCHNORRSIG : yes }
2020-12-22 15:42:08 +00:00
- env : {WIDEMUL: int128, ASM : x86_64}
2021-10-20 11:45:31 +00:00
- env : { RECOVERY: yes, SCHNORRSIG : yes }
2020-12-22 15:42:08 +00:00
- env : {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH : no }
- env : {CPPFLAGS : -DDETERMINISTIC}
- env : {CFLAGS: -O0, CTIMETEST : no }
2021-12-15 13:10:46 +00:00
- env : { ECMULTGENPRECISION: 2, ECMULTWINDOW : 2 }
- env : { ECMULTGENPRECISION: 8, ECMULTWINDOW : 4 }
2020-12-22 15:42:08 +00:00
matrix :
- env :
CC : gcc
- env :
CC : clang
2021-03-01 22:50:54 +00:00
<< : *MERGE_BASE
2020-12-22 15:42:08 +00:00
test_script :
2021-02-26 14:52:40 +00:00
- ./ci/cirrus.sh
2020-12-22 15:42:08 +00:00
<< : *CAT_LOGS
task :
2021-02-26 14:52:40 +00:00
name : "i686: Linux (Debian stable)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2020-12-22 15:42:08 +00:00
env :
HOST : i686-linux-gnu
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
matrix :
- env :
2021-02-26 14:52:40 +00:00
CC : i686-linux-gnu-gcc
2020-12-22 15:42:08 +00:00
- env :
2021-02-26 14:52:40 +00:00
CC : clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
2021-05-31 16:11:27 +00:00
<< : *MERGE_BASE
2020-12-22 15:42:08 +00:00
test_script :
2021-02-26 14:52:40 +00:00
- ./ci/cirrus.sh
2020-12-22 15:42:08 +00:00
<< : *CAT_LOGS
task :
name : "x86_64: macOS Catalina"
macos_instance :
image : catalina-base
2021-01-14 10:05:20 +00:00
env :
HOMEBREW_NO_AUTO_UPDATE : 1
HOMEBREW_NO_INSTALL_CLEANUP : 1
2021-03-03 00:21:18 +00:00
# Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment...
MAKEFLAGS : -j13
2020-12-22 15:42:08 +00:00
matrix :
<< : *ENV_MATRIX
matrix :
- env :
CC : gcc-9
- env :
CC : clang
# Update Command Line Tools
# Uncomment this if the Command Line Tools on the CirrusCI macOS image are too old to brew valgrind.
# See https://apple.stackexchange.com/a/195963 for the implementation.
## update_clt_script:
## - system_profiler SPSoftwareDataType
## - touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
## - |-
## PROD=$(softwareupdate -l | grep "*.*Command Line" | tail -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | sed 's/Label: //g' | tr -d '\n')
## # For debugging
## - softwareupdate -l && echo "PROD: $PROD"
## - softwareupdate -i "$PROD" --verbose
## - rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
##
2021-01-14 10:05:20 +00:00
brew_valgrind_pre_script :
2022-02-08 13:09:58 +00:00
# Retry a few times because this tends to fail randomly.
- for i in {1..5}; do brew update && break || sleep 15; done
2020-12-22 15:42:08 +00:00
- brew config
2021-12-20 14:43:00 +00:00
- brew tap LouisBrunner/valgrind
2021-01-14 10:05:20 +00:00
# Fetch valgrind source but don't build it yet.
- brew fetch --HEAD LouisBrunner/valgrind/valgrind
brew_valgrind_cache :
# This is $(brew --cellar valgrind) but command substition does not work here.
folder : /usr/local/Cellar/valgrind
# Rebuild cache if ...
fingerprint_script :
# ... macOS version changes:
- sw_vers
# ... brew changes:
- brew config
# ... valgrind changes:
- git -C "$(brew --cache)/valgrind--git" rev-parse HEAD
populate_script :
# If there's no hit in the cache, build and install valgrind.
- brew install --HEAD LouisBrunner/valgrind/valgrind
brew_valgrind_post_script :
# If we have restored valgrind from the cache, tell brew to create symlink to the PATH.
# If we haven't restored from cached (and just run brew install), this is a no-op.
- brew link valgrind
brew_script :
2020-10-11 23:04:58 +00:00
- brew install automake libtool gcc@9
2021-03-01 22:50:54 +00:00
<< : *MERGE_BASE
2020-12-22 15:42:08 +00:00
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
2021-02-26 14:52:40 +00:00
name : "s390x (big-endian): Linux (Debian stable, QEMU)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2020-12-22 15:42:08 +00:00
env :
2021-05-17 15:19:01 +00:00
WRAPPER_CMD : qemu-s390x
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS : 16
2020-12-22 15:42:08 +00:00
HOST : s390x-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
2021-03-01 22:50:54 +00:00
<< : *MERGE_BASE
2020-12-22 15:42:08 +00:00
test_script :
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
- rm /etc/ld.so.cache
- ./ci/cirrus.sh
<< : *CAT_LOGS
2021-04-17 17:57:16 +00:00
2021-05-02 19:48:38 +00:00
task :
name : "ARM32: Linux (Debian stable, QEMU)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2021-05-02 19:48:38 +00:00
env :
2021-05-17 15:19:01 +00:00
WRAPPER_CMD : qemu-arm
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS : 16
2021-05-02 19:48:38 +00:00
HOST : arm-linux-gnueabihf
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
2021-05-02 20:39:22 +00:00
matrix :
- env : {}
2021-10-20 11:45:31 +00:00
- env : {EXPERIMENTAL: yes, ASM : arm}
2021-05-02 19:48:38 +00:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
name : "ARM64: Linux (Debian stable, QEMU)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2021-05-02 19:48:38 +00:00
env :
2021-05-17 15:19:01 +00:00
WRAPPER_CMD : qemu-aarch64
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS : 16
2021-05-02 19:48:38 +00:00
HOST : aarch64-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2021-06-08 15:03:53 +00:00
task :
name : "ppc64le: Linux (Debian stable, QEMU)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2021-06-08 15:03:53 +00:00
env :
WRAPPER_CMD : qemu-ppc64le
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS : 16
2021-06-08 15:03:53 +00:00
HOST : powerpc64le-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2021-04-17 17:57:16 +00:00
task :
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2021-04-17 17:57:16 +00:00
env :
2022-03-15 23:15:33 +00:00
WRAPPER_CMD : wine
2021-04-17 17:57:16 +00:00
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
2022-03-15 23:15:33 +00:00
matrix :
- name : "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
env :
HOST : x86_64-w64-mingw32
- name : "i686 (mingw32-w64): Windows (Debian stable, Wine)"
env :
HOST : i686-w64-mingw32
2021-04-17 17:57:16 +00:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2020-11-09 16:52:12 +00:00
2022-03-10 19:09:41 +00:00
task :
<< : *LINUX_CONTAINER
env :
WRAPPER_CMD : wine
WERROR_CFLAGS : -WX
2021-04-17 17:57:16 +00:00
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
2022-03-10 19:09:41 +00:00
EXPERIMENTAL : yes
2021-04-17 17:57:16 +00:00
SCHNORRSIG : yes
CTIMETEST : no
2022-03-10 19:09:41 +00:00
# Set non-essential options that affect the CLI messages here.
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
CFLAGS : -nologo -diagnostics:caret
LDFLAGS : -XCClinker -nologo -XCClinker -diagnostics:caret
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
# This will detect some MinGW-w64 tools but then make will need only
# the MSVC tools CC, AR and NM as specified below.
matrix :
- name : "x86_64 (MSVC): Windows (Debian stable, Wine)"
env :
HOST : x86_64-w64-mingw32
CC : /opt/msvc/bin/x64/cl
AR : /opt/msvc/bin/x64/lib
NM : /opt/msvc/bin/x64/dumpbin -symbols -headers
- name : "i686 (MSVC): Windows (Debian stable, Wine)"
env :
HOST : i686-w64-mingw32
CC : /opt/msvc/bin/x86/cl
AR : /opt/msvc/bin/x86/lib
NM : /opt/msvc/bin/x86/dumpbin -symbols -headers
2021-04-17 17:57:16 +00:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2020-11-09 16:52:12 +00:00
# Sanitizers
task :
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2020-11-09 16:52:12 +00:00
env :
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
CTIMETEST : no
matrix :
- name : "Valgrind (memcheck)"
2021-12-21 12:13:59 +00:00
container :
cpu : 2
2020-11-09 16:52:12 +00:00
env :
2021-05-17 15:19:01 +00:00
# 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)
WRAPPER_CMD : "valgrind --error-exitcode=42"
2021-12-03 19:56:28 +00:00
SECP256K1_TEST_ITERS : 2
2020-11-09 16:52:12 +00:00
- name : "UBSan, ASan, LSan"
2021-12-21 12:13:59 +00:00
container :
memory : 2G
2020-11-09 16:52:12 +00:00
env :
2021-11-10 14:17:26 +00:00
CFLAGS : "-fsanitize=undefined,address -g"
2020-11-09 16:52:12 +00:00
UBSAN_OPTIONS : "print_stacktrace=1:halt_on_error=1"
ASAN_OPTIONS : "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
LSAN_OPTIONS : "use_unaligned=1"
2021-11-08 20:02:30 +00:00
SECP256K1_TEST_ITERS : 32
2020-11-09 16:52:12 +00:00
# Try to cover many configurations with just a tiny matrix.
matrix :
- env :
ASM : auto
- env :
ASM : no
ECMULTGENPRECISION : 2
2021-12-15 13:10:46 +00:00
ECMULTWINDOW : 2
2020-11-09 16:52:12 +00:00
matrix :
- env :
CC : clang
- env :
HOST : i686-linux-gnu
CC : i686-linux-gnu-gcc
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2021-07-05 08:33:36 +00:00
task :
2022-03-17 21:29:25 +00:00
name : "C++ -fpermissive (entire project)"
2021-12-20 17:00:13 +00:00
<< : *LINUX_CONTAINER
2021-07-05 08:33:36 +00:00
env :
2022-03-17 21:26:19 +00:00
CC : g++
CFLAGS : -fpermissive -g
CPPFLAGS : -DSECP256K1_CPLUSPLUS_TEST_OVERRIDE
2021-07-05 08:33:36 +00:00
WERROR_CFLAGS :
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2022-02-03 11:58:55 +00:00
2022-03-17 21:29:25 +00:00
task :
name : "C++ (public headers)"
<< : *LINUX_CONTAINER
test_script :
- g++ -Werror include/*.h
- clang -Werror -x c++-header include/*.h
- /opt/msvc/bin/x64/cl.exe -c -WX -TP include/*.h
2022-02-03 11:58:55 +00:00
task :
name : "sage prover"
<< : *LINUX_CONTAINER
test_script :
- cd sage
- sage prove_group_implementations.sage