Skip to content

Commit e665b24

Browse files
WIP: Try to use qemu for big endian test on travis
1 parent 3967d96 commit e665b24

File tree

2 files changed

+87
-66
lines changed

2 files changed

+87
-66
lines changed

.travis.yml

Lines changed: 75 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
language: c
2-
os:
3-
- linux
4-
- osx
5-
62
dist: bionic
73
# Valgrind currently supports upto macOS 10.13, the latest xcode of that version is 10.1
84
osx_image: xcode10.1
@@ -12,77 +8,89 @@ addons:
128
- libgmp-dev
139
- valgrind
1410
- libtool-bin
15-
compiler:
16-
- clang
17-
- gcc
11+
services:
12+
- docker
13+
14+
#os:
15+
# - linux
16+
# - osx
17+
#compiler:
18+
# - clang
19+
# - gcc
1820
env:
1921
global:
2022
- WIDEMUL=auto BIGNUM=auto STATICPRECOMPUTATION=yes ECMULTGENPRECISION=auto ASM=no BUILD=check WITH_VALGRIND=yes RUN_VALGRIND=no EXTRAFLAGS= HOST= ECDH=no RECOVERY=no SCHNORRSIG=no EXPERIMENTAL=no CTIMETEST=yes BENCH=yes ITERS=2
21-
matrix:
22-
- WIDEMUL=int64 RECOVERY=yes
23-
- WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
24-
- WIDEMUL=int128
25-
- WIDEMUL=int128 RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
26-
- WIDEMUL=int128 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
27-
- WIDEMUL=int128 ASM=x86_64
28-
- BIGNUM=no
29-
- BIGNUM=no RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
30-
- BIGNUM=no STATICPRECOMPUTATION=no
31-
- BUILD=distcheck WITH_VALGRIND=no CTIMETEST=no BENCH=no
32-
- CPPFLAGS=-DDETERMINISTIC
33-
- CFLAGS=-O0 CTIMETEST=no
34-
- ECMULTGENPRECISION=2
35-
- ECMULTGENPRECISION=8
36-
- RUN_VALGRIND=yes BIGNUM=no ASM=x86_64 ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
23+
# matrix:
24+
# - WIDEMUL=int64 RECOVERY=yes
25+
# - WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
26+
# - WIDEMUL=int128
27+
# - WIDEMUL=int128 RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
28+
# - WIDEMUL=int128 ECDH=yes EXPERIMENTAL=yes SCHNORRSIG=yes
29+
# - WIDEMUL=int128 ASM=x86_64
30+
# - BIGNUM=no
31+
# - BIGNUM=no RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes
32+
# - BIGNUM=no STATICPRECOMPUTATION=no
33+
# - BUILD=distcheck WITH_VALGRIND=no CTIMETEST=no BENCH=no
34+
# - CPPFLAGS=-DDETERMINISTIC
35+
# - CFLAGS=-O0 CTIMETEST=no
36+
# - ECMULTGENPRECISION=2
37+
# - ECMULTGENPRECISION=8
38+
# - RUN_VALGRIND=yes BIGNUM=no ASM=x86_64 ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes EXTRAFLAGS="--disable-openssl-tests" BUILD=
39+
3740
matrix:
3841
fast_finish: true
3942
include:
40-
- compiler: clang
41-
os: linux
42-
env: HOST=i686-linux-gnu
43-
addons:
44-
apt:
45-
packages:
46-
- gcc-multilib
47-
- libgmp-dev:i386
48-
- valgrind
49-
- libtool-bin
50-
- libc6-dbg:i386
51-
- compiler: clang
52-
env: HOST=i686-linux-gnu
53-
os: linux
54-
addons:
55-
apt:
56-
packages:
57-
- gcc-multilib
58-
- valgrind
59-
- libtool-bin
60-
- libc6-dbg:i386
61-
- compiler: gcc
62-
env: HOST=i686-linux-gnu
63-
os: linux
64-
addons:
65-
apt:
66-
packages:
67-
- gcc-multilib
68-
- valgrind
69-
- libtool-bin
70-
- libc6-dbg:i386
43+
# - compiler: clang
44+
# os: linux
45+
# env: HOST=i686-linux-gnu
46+
# addons:
47+
# apt:
48+
# packages:
49+
# - gcc-multilib
50+
# - libgmp-dev:i386
51+
# - valgrind
52+
# - libtool-bin
53+
# - libc6-dbg:i386
54+
# - compiler: clang
55+
# env: HOST=i686-linux-gnu
56+
# os: linux
57+
# addons:
58+
# apt:
59+
# packages:
60+
# - gcc-multilib
61+
# - valgrind
62+
# - libtool-bin
63+
# - libc6-dbg:i386
64+
# - compiler: gcc
65+
# env: HOST=i686-linux-gnu
66+
# os: linux
67+
# addons:
68+
# apt:
69+
# packages:
70+
# - gcc-multilib
71+
# - valgrind
72+
# - libtool-bin
73+
# - libc6-dbg:i386
74+
# - compiler: gcc
75+
# os: linux
76+
# env: HOST=i686-linux-gnu
77+
# addons:
78+
# apt:
79+
# packages:
80+
# - gcc-multilib
81+
# - libgmp-dev:i386
82+
# - valgrind
83+
# - libtool-bin
84+
# - libc6-dbg:i386
85+
# S390x build (big endian system)
7186
- compiler: gcc
72-
os: linux
73-
env: HOST=i686-linux-gnu
87+
env: HOST=s390x-unknown-linux-gnu ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes CTIMETEST= BENCH=no WITH_VALGRIND=no BUILD= QEMU=s390x
7488
addons:
7589
apt:
7690
packages:
77-
- gcc-multilib
78-
- libgmp-dev:i386
79-
- valgrind
8091
- libtool-bin
81-
- libc6-dbg:i386
82-
# S390x build (big endian system)
83-
- compiler: gcc
84-
env: HOST=s390x-unknown-linux-gnu ECDH=yes RECOVERY=yes EXPERIMENTAL=yes SCHNORRSIG=yes CTIMETEST=
85-
arch: s390x
92+
- gcc-s390x-linux-gnu
93+
- libc6-dev-s390x-cross
8694

8795
# We use this to install macOS dependencies instead of the built in `homebrew` plugin,
8896
# because in xcode earlier than 11 they have a bug requiring updating the system which overall takes ~8 minutes.
@@ -94,6 +102,8 @@ before_script: ./autogen.sh
94102

95103
# travis auto terminates jobs that go for 10 minutes without printing to stdout, but travis_wait doesn't work well with forking programs like valgrind (https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received https://github.com/bitcoin-core/secp256k1/pull/750#issuecomment-623476860)
96104
script:
105+
- if [ -n "$QEMU" ]; then docker run --rm --privileged multiarch/qemu-user-static --reset -p yes; fi
106+
- cat /proc/sys/fs/binfmt_misc/qemu-s390x
97107
- function keep_alive() { while true; do echo -en "\a"; sleep 60; done }
98108
- keep_alive &
99109
- ./contrib/travis.sh
@@ -106,3 +116,4 @@ after_script:
106116
- cat ./bench.log
107117
- $CC --version
108118
- valgrind --version
119+
- ls /usr/bin/qemu*

contrib/travis.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ fi
2121
--with-valgrind="$WITH_VALGRIND" \
2222
--host="$HOST" $EXTRAFLAGS
2323

24+
make -j2
25+
2426
if [ -n "$BUILD" ]
2527
then
26-
make -j2 "$BUILD"
28+
make "$BUILD"
2729
fi
30+
31+
if [ -n "$QEMU" ]
32+
then
33+
qemu_run() { docker run --rm -t -v "${PWD}:/mnt/secp256k1" -w /mnt/secp256k1 $QEMU/ubuntu "$@"; }
34+
qemu_run ls /mnt/secp256k1
35+
qemu_run ./tests
36+
qemu_run ./exhaustive_tests
37+
fi
38+
2839
if [ "$RUN_VALGRIND" = "yes" ]
2940
then
30-
make -j2
3141
# the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (http://valgrind.org/docs/manual/manual-core.html)
3242
valgrind --error-exitcode=42 ./tests 16
3343
valgrind --error-exitcode=42 ./exhaustive_tests

0 commit comments

Comments
 (0)