Skip to content

Commit 0c5ff90

Browse files
committed
Add macOS support to travis
1 parent b6807d9 commit 0c5ff90

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

.travis.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
language: c
2-
os: linux
2+
os:
3+
- linux
4+
- osx
5+
6+
# Valgrind currently supports upto macOS 10.13, the latest xcode of that version is 10.1
7+
osx_image: xcode10.1
38
addons:
49
apt:
510
packages:
@@ -30,10 +35,13 @@ env:
3035
- CFLAGS=-O0 CTIMETEST=
3136
- ECMULTGENPRECISION=2
3237
- ECMULTGENPRECISION=8
38+
- VALGRIND=yes ENDOMORPHISM=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
39+
- VALGRIND=yes BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
3340
matrix:
3441
fast_finish: true
3542
include:
3643
- compiler: clang
44+
os: linux
3745
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
3846
addons:
3947
apt:
@@ -45,6 +53,7 @@ matrix:
4553
- libc6-dbg:i386
4654
- compiler: clang
4755
env: HOST=i686-linux-gnu
56+
os: linux
4857
addons:
4958
apt:
5059
packages:
@@ -54,6 +63,7 @@ matrix:
5463
- libc6-dbg:i386
5564
- compiler: gcc
5665
env: HOST=i686-linux-gnu ENDOMORPHISM=yes
66+
os: linux
5767
addons:
5868
apt:
5969
packages:
@@ -62,6 +72,7 @@ matrix:
6272
- libtool-bin
6373
- libc6-dbg:i386
6474
- compiler: gcc
75+
os: linux
6576
env: HOST=i686-linux-gnu
6677
addons:
6778
apt:
@@ -71,14 +82,12 @@ matrix:
7182
- valgrind
7283
- libtool-bin
7384
- libc6-dbg:i386
74-
- compiler: gcc
75-
env:
76-
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
77-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
78-
- compiler: gcc
79-
env: # The same as above but without endomorphism.
80-
- BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
81-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
85+
86+
# We use this to install macOS dependencies instead of the built in `homebrew` plugin,
87+
# because in xcode earlier than 11 they have a bug requiring updating the system which overall takes ~8 minutes.
88+
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296
89+
before_install:
90+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install gmp valgrind gcc@9; fi
8291

8392
before_script: ./autogen.sh
8493

@@ -90,3 +99,5 @@ after_script:
9099
- cat ./exhaustive_tests.log
91100
- cat ./valgrind_ctime_test.log
92101
- cat ./bench.log
102+
- $CC --version
103+
- valgrind --version

contrib/travis.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ if [ "$HOST" = "i686-linux-gnu" ]
1111
then
1212
export CC="$CC -m32"
1313
fi
14+
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
15+
then
16+
export CC="gcc-9"
17+
fi
1418

1519
./configure \
1620
--enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \
@@ -33,7 +37,8 @@ if [ -n "$BENCH" ]
3337
then
3438
if [ -n "$VALGRIND" ]
3539
then
36-
EXEC='libtool --mode=execute valgrind --error-exitcode=42'
40+
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
41+
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
3742
else
3843
EXEC=
3944
fi
@@ -54,5 +59,5 @@ then
5459
fi
5560
if [ -n "$CTIMETEST" ]
5661
then
57-
libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
62+
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
5863
fi

0 commit comments

Comments
 (0)