2021-04-23 11:35:15 -07:00
env :
2023-03-08 17:41:24 -05:00
### cirrus config
CIRRUS_CLONE_DEPTH : 1
2021-07-14 10:02:02 -07:00
### compiler options
HOST :
2023-03-08 17:41:24 -05:00
WRAPPER_CMD :
2021-07-14 10:02:02 -07:00
# 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
2022-04-06 20:20:30 +01:00
MAKEFLAGS : -j4
2021-07-14 10:02:02 -07:00
BUILD : check
### secp256k1 config
2022-04-06 20:20:30 +01:00
ECMULTWINDOW : auto
2021-04-23 11:35:15 -07:00
ECMULTGENPRECISION : auto
ASM : no
2021-07-14 10:02:02 -07:00
WIDEMUL : auto
2021-04-23 11:35:15 -07:00
WITH_VALGRIND : yes
EXTRAFLAGS :
2021-07-14 10:02:02 -07:00
### secp256k1 modules
EXPERIMENTAL : no
2021-04-23 11:35:15 -07:00
ECDH : no
RECOVERY : no
SCHNORRSIG : no
2021-07-14 10:02:02 -07:00
### test options
2021-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS :
2021-04-23 11:35:15 -07:00
BENCH : yes
2021-12-15 09:19:50 -05:00
SECP256K1_BENCH_ITERS : 2
2023-03-08 17:41:24 -05:00
CTIMETESTS : yes
2022-04-06 20:20:30 +01:00
# Compile and run the tests
EXAMPLES : yes
2021-04-23 11:35:15 -07:00
2022-12-12 23:40:36 -05:00
# https://cirrus-ci.org/pricing/#compute-credits
credits_snippet : &CREDITS
# Don't use any credits for now.
use_compute_credits : false
2021-04-23 11:35:15 -07:00
cat_logs_snippet : &CAT_LOGS
always :
cat_tests_log_script :
- cat tests.log || true
2023-03-08 17:41:24 -05:00
cat_noverify_tests_log_script :
- cat noverify_tests.log || true
2021-04-23 11:35:15 -07:00
cat_exhaustive_tests_log_script :
- cat exhaustive_tests.log || true
2023-03-08 17:41:24 -05:00
cat_ctime_tests_log_script :
- cat ctime_tests.log || true
2021-04-23 11:35:15 -07:00
cat_bench_log_script :
- cat bench.log || true
cat_config_log_script :
- cat config.log || true
cat_test_env_script :
- cat test_env.log || true
cat_ci_env_script :
- env
merge_base_script_snippet : &MERGE_BASE
merge_base_script :
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
2023-03-08 17:41:24 -05:00
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
2021-04-23 11:35:15 -07:00
2022-04-06 20:20:30 +01:00
linux_container_snippet : &LINUX_CONTAINER
2021-04-23 11:35:15 -07:00
container :
dockerfile : ci/linux-debian.Dockerfile
# Reduce number of CPUs to be able to do more builds in parallel.
cpu : 1
2022-04-06 20:20:30 +01:00
# Gives us more CPUs for free if they're available.
greedy : true
2021-04-23 11:35:15 -07:00
# More than enough for our scripts.
memory : 1G
2022-04-06 20:20:30 +01:00
task :
name : "x86_64: Linux (Debian stable)"
<< : *LINUX_CONTAINER
2021-04-23 11:35:15 -07:00
matrix : &ENV_MATRIX
- env : {WIDEMUL: int64, RECOVERY : yes }
2022-04-06 20:20:30 +01:00
- env : {WIDEMUL: int64, ECDH: yes, SCHNORRSIG : yes }
2021-04-23 11:35:15 -07:00
- env : {WIDEMUL : int128}
2022-12-12 23:40:36 -05:00
- env : {WIDEMUL : int128_struct}
2022-04-06 20:20:30 +01:00
- env : {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG : yes }
- env : {WIDEMUL: int128, ECDH: yes, SCHNORRSIG : yes }
2021-04-23 11:35:15 -07:00
- env : {WIDEMUL: int128, ASM : x86_64}
2022-04-06 20:20:30 +01:00
- env : { RECOVERY: yes, SCHNORRSIG : yes }
2023-03-08 17:41:24 -05:00
- env : {CTIMETESTS: no, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, CPPFLAGS : -DVERIFY}
- env : {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH : no }
2021-04-23 11:35:15 -07:00
- env : {CPPFLAGS : -DDETERMINISTIC}
2023-03-08 17:41:24 -05:00
- env : {CFLAGS: -O0, CTIMETESTS : no }
2022-04-06 20:20:30 +01:00
- env : { ECMULTGENPRECISION: 2, ECMULTWINDOW : 2 }
- env : { ECMULTGENPRECISION: 8, ECMULTWINDOW : 4 }
2021-04-23 11:35:15 -07:00
matrix :
- env :
CC : gcc
- env :
CC : clang
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
name : "i686: Linux (Debian stable)"
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-04-23 11:35:15 -07:00
env :
HOST : i686-linux-gnu
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
matrix :
- env :
CC : i686-linux-gnu-gcc
- env :
CC : clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
2021-07-14 10:02:02 -07:00
<< : *MERGE_BASE
2021-04-23 11:35:15 -07:00
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
2022-12-12 23:40:36 -05:00
name : "arm64: macOS Ventura"
2021-04-23 11:35:15 -07:00
macos_instance :
2022-12-12 23:40:36 -05:00
image : ghcr.io/cirruslabs/macos-ventura-base:latest
2021-04-23 11:35:15 -07:00
env :
HOMEBREW_NO_AUTO_UPDATE : 1
HOMEBREW_NO_INSTALL_CLEANUP : 1
2022-12-12 23:40:36 -05:00
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
MAKEFLAGS : -j5
2021-04-23 11:35:15 -07:00
matrix :
<< : *ENV_MATRIX
2022-12-12 23:40:36 -05:00
env :
ASM : no
WITH_VALGRIND : no
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-04-23 11:35:15 -07:00
matrix :
- env :
2022-12-12 23:40:36 -05:00
CC : gcc
2021-04-23 11:35:15 -07:00
- env :
CC : clang
brew_script :
2022-12-12 23:40:36 -05:00
- brew install automake libtool gcc
2021-04-23 11:35:15 -07:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2022-12-12 23:40:36 -05:00
<< : *CREDITS
2021-04-23 11:35:15 -07:00
task :
name : "s390x (big-endian): Linux (Debian stable, QEMU)"
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-04-23 11:35:15 -07:00
env :
2021-07-14 10:02:02 -07:00
WRAPPER_CMD : qemu-s390x
2021-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 16
2021-04-23 11:35:15 -07:00
HOST : s390x-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-04-23 11:35:15 -07:00
<< : *MERGE_BASE
test_script :
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
- rm /etc/ld.so.cache
- ./ci/cirrus.sh
<< : *CAT_LOGS
2021-07-14 10:02:02 -07:00
task :
name : "ARM32: Linux (Debian stable, QEMU)"
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-07-14 10:02:02 -07:00
env :
WRAPPER_CMD : qemu-arm
2021-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 16
2021-07-14 10:02:02 -07:00
HOST : arm-linux-gnueabihf
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-07-14 10:02:02 -07:00
matrix :
- env : {}
2022-04-06 20:20:30 +01:00
- env : {EXPERIMENTAL: yes, ASM : arm}
2021-07-14 10:02:02 -07:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
name : "ARM64: Linux (Debian stable, QEMU)"
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-07-14 10:02:02 -07:00
env :
WRAPPER_CMD : qemu-aarch64
2021-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 16
2021-07-14 10:02:02 -07:00
HOST : aarch64-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-07-14 10:02:02 -07:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
name : "ppc64le: Linux (Debian stable, QEMU)"
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-07-14 10:02:02 -07:00
env :
WRAPPER_CMD : qemu-ppc64le
2021-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 16
2021-07-14 10:02:02 -07:00
HOST : powerpc64le-linux-gnu
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-07-14 10:02:02 -07:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-07-14 10:02:02 -07:00
env :
2022-12-12 23:40:36 -05:00
WRAPPER_CMD : wine
2021-07-14 10:02:02 -07:00
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2022-12-12 23:40:36 -05: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
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
<< : *LINUX_CONTAINER
env :
WRAPPER_CMD : wine
WERROR_CFLAGS : -WX
WITH_VALGRIND : no
ECDH : yes
RECOVERY : yes
EXPERIMENTAL : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2022-12-12 23:40:36 -05:00
# 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.
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
# 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
2023-03-08 17:41:24 -05:00
LDFLAGS : -Xlinker -Xlinker -Xlinker -nologo
2022-12-12 23:40:36 -05:00
matrix :
- name : "x86_64 (MSVC): Windows (Debian stable, Wine)"
- name : "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"
env :
WIDEMUL : int128_struct
- name : "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct with __(u)mulh)"
env :
WIDEMUL : int128_struct
CPPFLAGS : -DSECP256K1_MSVC_MULH_TEST_OVERRIDE
- 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-07-14 10:02:02 -07:00
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
# Sanitizers
task :
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2021-07-14 10:02:02 -07:00
env :
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : no
2021-07-14 10:02:02 -07:00
matrix :
- name : "Valgrind (memcheck)"
2022-04-06 20:20:30 +01:00
container :
cpu : 2
2021-07-14 10:02:02 -07:00
env :
# 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-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 2
2021-07-14 10:02:02 -07:00
- name : "UBSan, ASan, LSan"
2022-04-06 20:20:30 +01:00
container :
memory : 2G
2021-07-14 10:02:02 -07:00
env :
2021-12-15 09:19:50 -05:00
CFLAGS : "-fsanitize=undefined,address -g"
2021-07-14 10:02:02 -07: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-12-15 09:19:50 -05:00
SECP256K1_TEST_ITERS : 32
2021-07-14 10:02:02 -07:00
# Try to cover many configurations with just a tiny matrix.
matrix :
- env :
ASM : auto
- env :
ASM : no
ECMULTGENPRECISION : 2
2022-04-06 20:20:30 +01:00
ECMULTWINDOW : 2
2021-07-14 10:02:02 -07:00
matrix :
- env :
CC : clang
- env :
HOST : i686-linux-gnu
CC : i686-linux-gnu-gcc
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2022-12-12 23:40:36 -05:00
# Memory sanitizers
2021-07-14 10:02:02 -07:00
task :
2022-04-06 20:20:30 +01:00
<< : *LINUX_CONTAINER
2022-12-12 23:40:36 -05:00
name : "MSan"
2021-07-14 10:02:02 -07:00
env :
2022-12-12 23:40:36 -05:00
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
2023-03-08 17:41:24 -05:00
CTIMETESTS : yes
2022-12-12 23:40:36 -05:00
CC : clang
SECP256K1_TEST_ITERS : 32
ASM : no
2023-03-08 17:41:24 -05:00
WITH_VALGRIND : no
2022-12-12 23:40:36 -05:00
container :
memory : 2G
matrix :
- env :
CFLAGS : "-fsanitize=memory -g"
- env :
ECMULTGENPRECISION : 2
ECMULTWINDOW : 2
CFLAGS : "-fsanitize=memory -g -O3"
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
task :
name : "C++ -fpermissive (entire project)"
<< : *LINUX_CONTAINER
env :
CC : g++
CFLAGS : -fpermissive -g
CPPFLAGS : -DSECP256K1_CPLUSPLUS_TEST_OVERRIDE
2021-07-14 10:02:02 -07:00
WERROR_CFLAGS :
ECDH : yes
RECOVERY : yes
SCHNORRSIG : yes
<< : *MERGE_BASE
test_script :
- ./ci/cirrus.sh
<< : *CAT_LOGS
2022-04-06 20:20:30 +01:00
2022-12-12 23:40:36 -05: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-04-06 20:20:30 +01:00
task :
name : "sage prover"
<< : *LINUX_CONTAINER
test_script :
- cd sage
- sage prove_group_implementations.sage
2023-03-08 17:41:24 -05:00
task :
name : "x86_64: Windows (VS 2022)"
windows_container :
image : cirrusci/windowsservercore:visualstudio2022
cpu : 4
memory : 3840MB
env :
PATH : '%CIRRUS_WORKING_DIR%\build\src\RelWithDebInfo;%PATH%'
x64_NATIVE_TOOLS : '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
# Ignore MSBuild warning MSB8029.
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
IgnoreWarnIntDirInTempDetected : 'true'
merge_script :
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
configure_script :
- '%x64_NATIVE_TOOLS%'
- cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
build_script :
- '%x64_NATIVE_TOOLS%'
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5
check_script :
- '%x64_NATIVE_TOOLS%'
- ctest --test-dir build -j 5
- build\src\RelWithDebInfo\bench_ecmult.exe
- build\src\RelWithDebInfo\bench_internal.exe
- build\src\RelWithDebInfo\bench.exe