aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/.cirrus.yml
blob: bf71a70839f59a3b3c67dbba0979843efb6bc6d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
env:
  ### 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
  MAKEFLAGS: -j2
  BUILD: check
  ### secp256k1 config
  STATICPRECOMPUTATION: yes
  ECMULTGENPRECISION: auto
  ASM: no
  WIDEMUL: auto
  WITH_VALGRIND: yes
  EXTRAFLAGS:
  ### secp256k1 modules
  EXPERIMENTAL: no
  ECDH: no
  RECOVERY: no
  SCHNORRSIG: no
  ### test options
  TEST_ITERS:
  BENCH: yes
  BENCH_ITERS: 2
  CTIMETEST: yes

cat_logs_snippet: &CAT_LOGS
  always:
    cat_tests_log_script:
      - cat tests.log || true
    cat_exhaustive_tests_log_script:
      - cat exhaustive_tests.log || true
    cat_valgrind_ctime_test_log_script:
      - cat valgrind_ctime_test.log || true
    cat_bench_log_script:
      - cat bench.log || true
  on_failure:
    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
    - 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

task:
  name: "x86_64: Linux (Debian stable)"
  container:
    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.
    memory: 1G
  matrix: &ENV_MATRIX
    - env: {WIDEMUL:  int64,  RECOVERY: yes}
    - env: {WIDEMUL:  int64,                 ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
    - env: {WIDEMUL: int128}
    - env: {WIDEMUL: int128,  RECOVERY: yes,            EXPERIMENTAL: yes, SCHNORRSIG: yes}
    - env: {WIDEMUL: int128,                 ECDH: yes, EXPERIMENTAL: yes, SCHNORRSIG: yes}
    - env: {WIDEMUL: int128,  ASM: x86_64}
    - env: {                  RECOVERY: yes,            EXPERIMENTAL: yes, SCHNORRSIG: yes}
    - env: {                  STATICPRECOMPUTATION: no}
    - env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
    - env: {CPPFLAGS: -DDETERMINISTIC}
    - env: {CFLAGS: -O0, CTIMETEST: no}
    - env: { ECMULTGENPRECISION: 2 }
    - env: { ECMULTGENPRECISION: 8 }
  matrix:
    - env:
        CC: gcc
    - env:
        CC: clang
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "i686: Linux (Debian stable)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    HOST: i686-linux-gnu
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
  matrix:
    - env:
        CC: i686-linux-gnu-gcc
    - env:
        CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "x86_64: macOS Catalina"
  macos_instance:
    image: catalina-base
  env:
    HOMEBREW_NO_AUTO_UPDATE: 1
    HOMEBREW_NO_INSTALL_CLEANUP: 1
    # Cirrus gives us a fixed number of 12 virtual CPUs. Not that we even have that many jobs at the moment...
    MAKEFLAGS: -j13
  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
  ##
  brew_valgrind_pre_script:
    - brew config
    - brew tap --shallow LouisBrunner/valgrind
    # 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:
    - brew install automake libtool gcc@9
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "s390x (big-endian): Linux (Debian stable, QEMU)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    WRAPPER_CMD: qemu-s390x
    TEST_ITERS: 16
    HOST: s390x-linux-gnu
    WITH_VALGRIND: no
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
  << : *MERGE_BASE
  test_script:
    # https://sourceware.org/bugzilla/show_bug.cgi?id=27008
    - rm /etc/ld.so.cache
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "ARM32: Linux (Debian stable, QEMU)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    WRAPPER_CMD: qemu-arm
    TEST_ITERS: 16
    HOST: arm-linux-gnueabihf
    WITH_VALGRIND: no
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
  matrix:
    - env: {}
    - env: {ASM: arm}
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "ARM64: Linux (Debian stable, QEMU)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    WRAPPER_CMD: qemu-aarch64
    TEST_ITERS: 16
    HOST: aarch64-linux-gnu
    WITH_VALGRIND: no
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "ppc64le: Linux (Debian stable, QEMU)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    WRAPPER_CMD: qemu-ppc64le
    TEST_ITERS: 16
    HOST: powerpc64le-linux-gnu
    WITH_VALGRIND: no
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    WRAPPER_CMD: wine64-stable
    TEST_ITERS: 16
    HOST: x86_64-w64-mingw32
    WITH_VALGRIND: no
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

# Sanitizers
task:
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    ECDH: yes
    RECOVERY: yes
    EXPERIMENTAL: yes
    SCHNORRSIG: yes
    CTIMETEST: no
    EXTRAFLAGS: "--disable-openssl-tests"
  matrix:
    - name: "Valgrind (memcheck)"
      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"
        TEST_ITERS: 16
    - name: "UBSan, ASan, LSan"
      env:
        CFLAGS: "-fsanitize=undefined,address"
        CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
        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"
        TEST_ITERS: 32
  # Try to cover many configurations with just a tiny matrix.
  matrix:
    - env:
        ASM: auto
        STATICPRECOMPUTATION: yes
    - env:
        ASM: no
        STATICPRECOMPUTATION: no
        ECMULTGENPRECISION: 2
  matrix:
    - env:
        CC: clang
    - env:
        HOST: i686-linux-gnu
        CC: i686-linux-gnu-gcc
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS

task:
  name: "C++ -fpermissive"
  container:
    dockerfile: ci/linux-debian.Dockerfile
    cpu: 1
    memory: 1G
  env:
    # ./configure correctly errors out when given CC=g++.
    # We hack around this by passing CC=g++ only to make.
    CC: gcc
    MAKEFLAGS: -j2 CC=g++ CFLAGS=-fpermissive
    WERROR_CFLAGS:
    EXPERIMENTAL: yes
    ECDH: yes
    RECOVERY: yes
    SCHNORRSIG: yes
  << : *MERGE_BASE
  test_script:
    - ./ci/cirrus.sh
  << : *CAT_LOGS