From 1a54be06cd359257478b584611f34058d21fe723 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 24 Jun 2018 22:56:07 +0000 Subject: Simplify Travis CI builds. Have one script per build. This means more duplication between the scripts, but it's much easier to understand and to run locally. --- other/bootstrap_daemon/src/Makefile.inc | 1 + other/docker/windows/build_toxcore.sh | 10 ++-- other/travis/autotools-linux-install | 14 ------ other/travis/autotools-script | 35 -------------- other/travis/env-linux.sh | 27 ----------- other/travis/env-osx.sh | 21 --------- other/travis/env-windows.sh | 36 -------------- other/travis/freebsd-script-stage1 | 4 -- other/travis/installmd-windows-install | 12 ----- other/travis/installmd-windows-script | 12 ----- other/travis/phase | 32 ------------- other/travis/tox-bootstrapd-docker-linux-script | 63 ------------------------- other/travis/toxcore-after_failure | 7 --- other/travis/toxcore-linux-after_script | 8 ---- other/travis/toxcore-linux-install | 26 ---------- other/travis/toxcore-osx-install | 6 --- other/travis/toxcore-windows-install | 7 --- 17 files changed, 8 insertions(+), 313 deletions(-) delete mode 100644 other/travis/autotools-linux-install delete mode 100755 other/travis/autotools-script delete mode 100644 other/travis/env-linux.sh delete mode 100644 other/travis/env-osx.sh delete mode 100644 other/travis/env-windows.sh delete mode 100755 other/travis/freebsd-script-stage1 delete mode 100755 other/travis/installmd-windows-install delete mode 100755 other/travis/installmd-windows-script delete mode 100755 other/travis/phase delete mode 100755 other/travis/tox-bootstrapd-docker-linux-script delete mode 100755 other/travis/toxcore-after_failure delete mode 100755 other/travis/toxcore-linux-after_script delete mode 100755 other/travis/toxcore-linux-install delete mode 100755 other/travis/toxcore-osx-install delete mode 100755 other/travis/toxcore-windows-install (limited to 'other') diff --git a/other/bootstrap_daemon/src/Makefile.inc b/other/bootstrap_daemon/src/Makefile.inc index 1c313d44..6b820be0 100644 --- a/other/bootstrap_daemon/src/Makefile.inc +++ b/other/bootstrap_daemon/src/Makefile.inc @@ -33,6 +33,7 @@ tox_bootstrapd_LDADD = \ libtoxcore.la \ $(LIBCONFIG_LIBS) \ $(LIBSODIUM_LIBS) \ + $(NACL_OBJECTS) \ $(NACL_LIBS) endif diff --git a/other/docker/windows/build_toxcore.sh b/other/docker/windows/build_toxcore.sh index a3830455..da465eb1 100644 --- a/other/docker/windows/build_toxcore.sh +++ b/other/docker/windows/build_toxcore.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh set -e -x @@ -57,9 +57,13 @@ build() -DCMAKE_INSTALL_PREFIX="${STATIC_TOXCORE_PREFIX_DIR}" \ -DENABLE_SHARED=OFF \ -DENABLE_STATIC=ON \ + -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \ + -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \ + -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \ + -DCMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS}" \ ${EXTRA_CMAKE_FLAGS} \ .. - cmake --build . --target install + cmake --build . --target install -- -j$(nproc) if [ "${ENABLE_TEST}" = "true" ]; then rm -rf /root/.wine @@ -79,7 +83,7 @@ build() if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then set +e fi - cmake --build . --target test + cmake --build . --target test -- ARGS="-j50" if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then set -e fi diff --git a/other/travis/autotools-linux-install b/other/travis/autotools-linux-install deleted file mode 100644 index ca0adff7..00000000 --- a/other/travis/autotools-linux-install +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -. other/travis/toxcore-linux-install - -# Also install vanilla NaCl -[ -f $CACHE_DIR/lib/amd64/libnacl.a ] || { - curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx - cd nacl-20110221 # pushd - "./do" - # "make install" - mv build/*/include/* $CACHE_DIR/include - mv build/*/lib/* $CACHE_DIR/lib - cd - # popd -} diff --git a/other/travis/autotools-script b/other/travis/autotools-script deleted file mode 100755 index d72ec2a9..00000000 --- a/other/travis/autotools-script +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -if perl -e ' - use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK); - - socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1; - bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1; -'; then - IPV6_FLAG="--enable-ipv6" -else - IPV6_FLAG="--disable-ipv6" -fi - -# Build toxcore with some custom flags here. Note that this does *not* run the -# tests, so any flags passed here are irrelevant to testing. This only checks -# that we can build toxcore with the specified flags. Tests run with default -# configure flags. -./autogen.sh -./configure \ - --with-nacl-libs=$CACHE_DIR/lib/amd64 \ - --with-nacl-headers=$CACHE_DIR/include/amd64 \ - --enable-nacl \ - --enable-daemon \ - --enable-logging \ - $IPV6_FLAG \ - --with-log-level=TRACE - -# We use make instead of RUN $MAKE here, because the autotools build will only -# ever run natively on the Linux container, never on a Windows cross compilation -# docker instance or an OSX machine. -make -j$NPROC -k - -# This runs `make check` with the default configure flags, not with the ones -# above. -TESTS $MAX_TEST_RETRIES make distcheck -j$NPROC -k diff --git a/other/travis/env-linux.sh b/other/travis/env-linux.sh deleted file mode 100644 index 9f25e911..00000000 --- a/other/travis/env-linux.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -export PATH=/opt/ghc/7.8.4/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH -export PATH=$HOME/.cabal/bin:$PATH - -CMAKE=cmake -# Asan is disabled because it's currently broken on Travis. -# See https://github.com/travis-ci/travis-ci/issues/9033. -CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DASAN=OFF" -NPROC=`nproc` -CURDIR=$PWD -RUN_TESTS=true - -RUN() { - "$@" -} - -TESTS() { - COUNT="$1"; shift - "$@" || { - if [ $COUNT -gt 1 ]; then - TESTS `expr $COUNT - 1` "$@" - else - false - fi - } -} diff --git a/other/travis/env-osx.sh b/other/travis/env-osx.sh deleted file mode 100644 index af1794f4..00000000 --- a/other/travis/env-osx.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -CMAKE=cmake -CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" -NPROC=`sysctl -n hw.ncpu` -CURDIR=$PWD - -RUN() { - "$@" -} - -TESTS() { - COUNT="$1"; shift - "$@" || { - if [ $COUNT -gt 1 ]; then - TESTS `expr $COUNT - 1` "$@" - else - false - fi - } -} diff --git a/other/travis/env-windows.sh b/other/travis/env-windows.sh deleted file mode 100644 index 525630ae..00000000 --- a/other/travis/env-windows.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DBOOTSTRAP_DAEMON=OFF -DERROR_ON_WARNING=OFF" - -if [ "$JOB" = "toxcore" ]; then - CMAKE=$ARCH-w64-mingw32.shared-cmake - NPROC=`nproc` - CURDIR=/work - RUN_TESTS=true - - RUN() { - ./dockcross "$@" - } - - TESTS() { - shift # Ignore test run count. - - # Download Microsoft DLLs. - curl http://www.dlldump.com/dllfiles/I/iphlpapi.dll -o _build/iphlpapi.dll - curl http://www.dlldump.com/dllfiles/W/ws2_32.dll -o _build/ws2_32.dll - - # Copy our dependency DLLs. - ./dockcross sh -c 'cp $WINEDLLPATH/*.dll _build' - - # Run tests in docker. - ./dockcross "$@" || { - cat _build/Testing/Temporary/LastTest.log - # Ignore test failures on Windows builds for now. - #false - } - } -elif [ "$JOB" = "installmd" ]; then - true -else - echo "Unsupported JOB=$JOB" -fi diff --git a/other/travis/freebsd-script-stage1 b/other/travis/freebsd-script-stage1 deleted file mode 100755 index ce16aea1..00000000 --- a/other/travis/freebsd-script-stage1 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# We don't want toxcore-script to run yet, it should be done during FreeBSD stage 2 -exit 0 diff --git a/other/travis/installmd-windows-install b/other/travis/installmd-windows-install deleted file mode 100755 index 8a85bbbd..00000000 --- a/other/travis/installmd-windows-install +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -cd other/docker/windows - -docker build \ - --build-arg SUPPORT_ARCH_i686=${SUPPORT_ARCH_i686} \ - --build-arg SUPPORT_ARCH_x86_64=${SUPPORT_ARCH_x86_64} \ - --build-arg SUPPORT_TEST=${SUPPORT_TEST} \ - -t toxcore \ - . - -cd - diff --git a/other/travis/installmd-windows-script b/other/travis/installmd-windows-script deleted file mode 100755 index 906a7f1d..00000000 --- a/other/travis/installmd-windows-script +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -docker run \ - -e ALLOW_TEST_FAILURE=${ALLOW_TEST_FAILURE} \ - -e ENABLE_ARCH_i686=${ENABLE_ARCH_i686} \ - -e ENABLE_ARCH_x86_64=${ENABLE_ARCH_x86_64} \ - -e ENABLE_TEST=${ENABLE_TEST} \ - -e EXTRA_CMAKE_FLAGS="${CMAKE_EXTRA_FLAGS} -DDEBUG=ON -DTEST_TIMEOUT_SECONDS=90" \ - -v ${PWD}:/toxcore \ - -v ${PWD}/result:/prefix \ - --rm \ - toxcore diff --git a/other/travis/phase b/other/travis/phase deleted file mode 100755 index cb9c2abf..00000000 --- a/other/travis/phase +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -set -e -u -x - -JOB="$1" -ENV="$2" -PHASE="$3" -STAGE="" - -set +u -if [ ! -z "$4" ] ; then - STAGE="$4" -fi -set -u - -. "other/travis/env.sh" -. "other/travis/env-$ENV.sh" - -try_source() { - SCRIPT="other/travis/$1" - if [ -f "$SCRIPT" ]; then - . "$SCRIPT" - fi - if [ ! -z "$STAGE" ] && [ -f "$SCRIPT-$STAGE" ]; then - . "$SCRIPT-$STAGE" - fi -} - -try_source "$PHASE" -try_source "$ENV-$PHASE" -try_source "$JOB-$PHASE" -try_source "$JOB-$ENV-$PHASE" diff --git a/other/travis/tox-bootstrapd-docker-linux-script b/other/travis/tox-bootstrapd-docker-linux-script deleted file mode 100755 index bb3b5422..00000000 --- a/other/travis/tox-bootstrapd-docker-linux-script +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -# Copy source code to other/bootstrap_daemon/docker/c-toxcore -OLD_PWD=$PWD -cd /tmp -cp -a $OLD_PWD c-toxcore -mv c-toxcore $OLD_PWD/other/bootstrap_daemon/docker -cd $OLD_PWD -ls -lbh other/bootstrap_daemon/docker -ls -lbh other/bootstrap_daemon/docker/c-toxcore - -cd other/bootstrap_daemon - -# Make Docker container use our current source code instead of master branch -sed -i "s|WORKDIR /tmp/tox|WORKDIR /tmp/tox\nADD /c-toxcore ./c-toxcore/|g" docker/Dockerfile -sed -i '/git clone/d' docker/Dockerfile - -cat docker/Dockerfile - -sudo docker build -t tox-bootstrapd docker/ -sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd -sudo chmod 700 /var/lib/tox-bootstrapd -sudo docker run -d --name tox-bootstrapd -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd - -sudo ls -lbh /var/lib/tox-bootstrapd - -if sudo [ ! -f /var/lib/tox-bootstrapd/keys ]; then - echo "Error: File /var/lib/tox-bootstrapd/keys doesn't exist" - exit 1 -fi - -COUNTER=0 -COUNTER_END=120 -while [ $COUNTER -lt $COUNTER_END ]; do - if sudo docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully" ; then - break - fi - sleep 1 - COUNTER=$(($COUNTER+1)) -done - -sudo docker logs tox-bootstrapd - -if [ "$COUNTER" = "$COUNTER_END" ]; then - echo "Error: Didn't connect to any nodes" - exit 1 -fi - -# Wait a bit befrore testing if the container is still running -sleep 30 - -sudo docker ps -a - -if [ "`sudo docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then - echo "Error: Container is not running" - exit 1 -fi - -if ! python3 ../fun/bootstrap_node_info.py ipv4 localhost 33445 ; then - echo "Error: Unable to get bootstrap node info" - exit 1 -fi - diff --git a/other/travis/toxcore-after_failure b/other/travis/toxcore-after_failure deleted file mode 100755 index e1f5c399..00000000 --- a/other/travis/toxcore-after_failure +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ -d /cores ]; then - for core in /cores/*; do - lldb --core $core --one-line "bt all" < /dev/null - done -fi diff --git a/other/travis/toxcore-linux-after_script b/other/travis/toxcore-linux-after_script deleted file mode 100755 index 7a388d0d..00000000 --- a/other/travis/toxcore-linux-after_script +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# We only submit coverage from the Linux build. -coveralls \ - --exclude auto_tests \ - --exclude other \ - --exclude testing \ - --gcov-options '\-lp' diff --git a/other/travis/toxcore-linux-install b/other/travis/toxcore-linux-install deleted file mode 100755 index 19dccf64..00000000 --- a/other/travis/toxcore-linux-install +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# Install cpp-coveralls to upload test coverage results. -pip install --user ndg-httpsclient urllib3[secure] cpp-coveralls - -# Work around https://github.com/eddyxu/cpp-coveralls/issues/108 by manually -# installing the pyOpenSSL module and injecting it into urllib3 as per -# https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2 -sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyopenssl.inject_into_urllib3()' `which coveralls` - -# Install astyle (version in ubuntu-precise too old). -[ -f $ASTYLE ] || { - wget -O ../astyle.tar.gz https://deb.debian.org/debian/pool/main/a/astyle/astyle_2.06.orig.tar.gz - tar -xf ../astyle.tar.gz -C $CACHE_DIR - make -C $CACHE_DIR/astyle/build/gcc -j$NPROC -} - -# Install libsodium (not in ubuntu-precise). -[ -f $CACHE_DIR/lib/libsodium.a ] || { - git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium - cd ../libsodium # pushd - ./autogen.sh - ./configure --prefix=$CACHE_DIR - make install -j$NPROC - cd - # popd -} diff --git a/other/travis/toxcore-osx-install b/other/travis/toxcore-osx-install deleted file mode 100755 index 8f13cb5f..00000000 --- a/other/travis/toxcore-osx-install +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Workaround for bug in Homebrew where it only finds an old Ruby version. -brew update - -brew install libsodium libvpx opus libconfig astyle diff --git a/other/travis/toxcore-windows-install b/other/travis/toxcore-windows-install deleted file mode 100755 index 6160856b..00000000 --- a/other/travis/toxcore-windows-install +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -DOCKER_IMAGE=toktoknet/windows:latest.$ARCH-shared - -docker pull $DOCKER_IMAGE -docker run --rm $DOCKER_IMAGE > dockcross -chmod +x dockcross -- cgit v1.2.3