fix travis osx build

This commit is contained in:
Arvid Norberg 2019-09-07 13:51:08 +02:00 committed by Arvid Norberg
parent 9b1607a63c
commit 47bd25230c
1 changed files with 19 additions and 14 deletions

View File

@ -66,6 +66,11 @@ before_install:
travis_retry brew install boost-python python2;
brew link --overwrite python@2;
fi'
- 'if [[ $TRAVIS_OS_NAME != "osx" ]]; then
export B2=bjam;
else
export B2=b2;
fi'
# we have to use python from brew rather than the system provided python
# because of OSX System Integrity Protection, which prevents injecting
# user-libraries (i.e. python modules) into system binaries (i.e. /usr/bin/python)
@ -198,28 +203,28 @@ script:
python3 -m flake8 --max-line-length=120;
fi'
- 'if [ "$sonar_scan" == "1" ]; then
build-wrapper-linux-x86-64 --out-dir bw-output bjam -a -j3 optimization=off crypto=$crypto deprecated-functions=off $toolset variant=$variant -l300 &&
build-wrapper-linux-x86-64 --out-dir bw-output ${B2} -a -j3 optimization=off crypto=$crypto deprecated-functions=off $toolset variant=$variant -l300 &&
sonar-scanner -D sonar.login=$SONAR_TOKEN;
fi'
- 'if [[ $clang_tidy == "1" ]]; then
which clang-tidy;
clang-tidy --version;
bjam -a -j3 clang_tidy;
${B2} -a -j3 clang_tidy;
fi'
- 'if [ "$check_headers" == "1" ]; then
bjam -j3 check-headers crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant;
${B2} -j3 check-headers crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant;
fi'
# if we are building with code coverage, report it as soon as possible
# libtorrent is the name of the test suite target
- cd test
- 'if [ "$tests" == "1" ]; then
bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant testing.execute=off &&
travis_retry bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant -l300 &&
travis_retry bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_natpmp enum_if -l300 &&
${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant testing.execute=off &&
travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant -l300 &&
travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_natpmp enum_if -l300 &&
if [[ $TRAVIS_OS_NAME != "osx" ]]; then
travis_retry bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_lsd -l300;
travis_retry ${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant test_lsd -l300;
fi &&
if [ "$coverage" == "1" ]; then
codecov --root .. --gcov-exec gcov-5;
@ -230,30 +235,30 @@ script:
# rebuilding libtorrent itself.
- cd ../fuzzers
- 'if [ "$fuzzers" == "1" ]; then
bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant sanitize=off fuzz=off link=shared stage;
${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant sanitize=off fuzz=off link=shared stage;
fi'
- cd ../examples
- 'if [ "$examples" == "1" ]; then
bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared;
${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared;
fi'
- cd ..
- cd tools
- 'if [ "$tools" == "1" ]; then
bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared;
${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared;
fi'
- cd ..
- if [[ $ios == "1" ]]; then
bjam -q darwin-ios darwin-ios_sim -j2 link=static;
${B2} -q darwin-ios darwin-ios_sim -j2 link=static;
fi
# a binary built with sanitizer does not interact well with python
# on OSX we need to use the brew version of python, for reasons explained above
- cd bindings/python
- 'if [[ "$python" == "1" ]]; then
bjam -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant stage_module stage_dependencies libtorrent-link=shared boost-link=shared &&
${B2} -j3 warnings-as-errors=on warnings=all crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant stage_module stage_dependencies libtorrent-link=shared boost-link=shared &&
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
DYLD_LIBRARY_PATH=./dependencies python2 test.py -b;
else
@ -265,7 +270,7 @@ script:
# simulation
- cd simulation
- 'if [[ "$sim" == "1" ]]; then
bjam -j2 crypto=built-in warnings-as-errors=on warnings=all debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset deprecated-functions=off;
${B2} -j2 crypto=built-in warnings-as-errors=on warnings=all debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset deprecated-functions=off;
fi'
- cd ..
@ -294,6 +299,6 @@ script:
- cd test
- 'if [[ "$arch" == "arm" ]];
then
bjam arm-tests warnings-as-errors=on warnings=all crypto=$crypto variant=test_arm $toolset target-os=linux link=static testing.launcher="sudo cp -R bin rootfs/; sudo chroot rootfs";
${B2} arm-tests warnings-as-errors=on warnings=all crypto=$crypto variant=test_arm $toolset target-os=linux link=static testing.launcher="sudo cp -R bin rootfs/; sudo chroot rootfs";
fi'
- cd ..