summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-06-24 22:56:07 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-01 08:35:44 +0000
commit1a54be06cd359257478b584611f34058d21fe723 (patch)
treedb3d6ca2dfa2a87ae2efdac6e412c2b780a64009 /other
parent706fad1ce88c2104009a3835ee343ff9d8ec8b79 (diff)
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.
Diffstat (limited to 'other')
-rw-r--r--other/bootstrap_daemon/src/Makefile.inc1
-rw-r--r--other/docker/windows/build_toxcore.sh10
-rw-r--r--other/travis/autotools-linux-install14
-rwxr-xr-xother/travis/autotools-script35
-rw-r--r--other/travis/env-linux.sh27
-rw-r--r--other/travis/env-osx.sh21
-rw-r--r--other/travis/env-windows.sh36
-rwxr-xr-xother/travis/freebsd-script-stage14
-rwxr-xr-xother/travis/installmd-windows-install12
-rwxr-xr-xother/travis/installmd-windows-script12
-rwxr-xr-xother/travis/phase32
-rwxr-xr-xother/travis/tox-bootstrapd-docker-linux-script63
-rwxr-xr-xother/travis/toxcore-after_failure7
-rwxr-xr-xother/travis/toxcore-linux-after_script8
-rwxr-xr-xother/travis/toxcore-linux-install26
-rwxr-xr-xother/travis/toxcore-osx-install6
-rwxr-xr-xother/travis/toxcore-windows-install7
17 files changed, 8 insertions, 313 deletions
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 = \
33 libtoxcore.la \ 33 libtoxcore.la \
34 $(LIBCONFIG_LIBS) \ 34 $(LIBCONFIG_LIBS) \
35 $(LIBSODIUM_LIBS) \ 35 $(LIBSODIUM_LIBS) \
36 $(NACL_OBJECTS) \
36 $(NACL_LIBS) 37 $(NACL_LIBS)
37 38
38endif 39endif
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 @@
1#!/usr/bin/env sh 1#!/bin/sh
2 2
3set -e -x 3set -e -x
4 4
@@ -57,9 +57,13 @@ build()
57 -DCMAKE_INSTALL_PREFIX="${STATIC_TOXCORE_PREFIX_DIR}" \ 57 -DCMAKE_INSTALL_PREFIX="${STATIC_TOXCORE_PREFIX_DIR}" \
58 -DENABLE_SHARED=OFF \ 58 -DENABLE_SHARED=OFF \
59 -DENABLE_STATIC=ON \ 59 -DENABLE_STATIC=ON \
60 -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \
61 -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
62 -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
63 -DCMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS}" \
60 ${EXTRA_CMAKE_FLAGS} \ 64 ${EXTRA_CMAKE_FLAGS} \
61 .. 65 ..
62 cmake --build . --target install 66 cmake --build . --target install -- -j$(nproc)
63 67
64 if [ "${ENABLE_TEST}" = "true" ]; then 68 if [ "${ENABLE_TEST}" = "true" ]; then
65 rm -rf /root/.wine 69 rm -rf /root/.wine
@@ -79,7 +83,7 @@ build()
79 if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then 83 if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then
80 set +e 84 set +e
81 fi 85 fi
82 cmake --build . --target test 86 cmake --build . --target test -- ARGS="-j50"
83 if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then 87 if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then
84 set -e 88 set -e
85 fi 89 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 @@
1#!/bin/sh
2
3. other/travis/toxcore-linux-install
4
5# Also install vanilla NaCl
6[ -f $CACHE_DIR/lib/amd64/libnacl.a ] || {
7 curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx
8 cd nacl-20110221 # pushd
9 "./do"
10 # "make install"
11 mv build/*/include/* $CACHE_DIR/include
12 mv build/*/lib/* $CACHE_DIR/lib
13 cd - # popd
14}
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 @@
1#!/bin/sh
2
3if perl -e '
4 use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
5
6 socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
7 bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
8'; then
9 IPV6_FLAG="--enable-ipv6"
10else
11 IPV6_FLAG="--disable-ipv6"
12fi
13
14# Build toxcore with some custom flags here. Note that this does *not* run the
15# tests, so any flags passed here are irrelevant to testing. This only checks
16# that we can build toxcore with the specified flags. Tests run with default
17# configure flags.
18./autogen.sh
19./configure \
20 --with-nacl-libs=$CACHE_DIR/lib/amd64 \
21 --with-nacl-headers=$CACHE_DIR/include/amd64 \
22 --enable-nacl \
23 --enable-daemon \
24 --enable-logging \
25 $IPV6_FLAG \
26 --with-log-level=TRACE
27
28# We use make instead of RUN $MAKE here, because the autotools build will only
29# ever run natively on the Linux container, never on a Windows cross compilation
30# docker instance or an OSX machine.
31make -j$NPROC -k
32
33# This runs `make check` with the default configure flags, not with the ones
34# above.
35TESTS $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 @@
1#!/bin/sh
2
3export 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
4export PATH=$HOME/.cabal/bin:$PATH
5
6CMAKE=cmake
7# Asan is disabled because it's currently broken on Travis.
8# See https://github.com/travis-ci/travis-ci/issues/9033.
9CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DASAN=OFF"
10NPROC=`nproc`
11CURDIR=$PWD
12RUN_TESTS=true
13
14RUN() {
15 "$@"
16}
17
18TESTS() {
19 COUNT="$1"; shift
20 "$@" || {
21 if [ $COUNT -gt 1 ]; then
22 TESTS `expr $COUNT - 1` "$@"
23 else
24 false
25 fi
26 }
27}
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 @@
1#!/bin/sh
2
3CMAKE=cmake
4CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS"
5NPROC=`sysctl -n hw.ncpu`
6CURDIR=$PWD
7
8RUN() {
9 "$@"
10}
11
12TESTS() {
13 COUNT="$1"; shift
14 "$@" || {
15 if [ $COUNT -gt 1 ]; then
16 TESTS `expr $COUNT - 1` "$@"
17 else
18 false
19 fi
20 }
21}
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 @@
1#!/bin/sh
2
3CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DBOOTSTRAP_DAEMON=OFF -DERROR_ON_WARNING=OFF"
4
5if [ "$JOB" = "toxcore" ]; then
6 CMAKE=$ARCH-w64-mingw32.shared-cmake
7 NPROC=`nproc`
8 CURDIR=/work
9 RUN_TESTS=true
10
11 RUN() {
12 ./dockcross "$@"
13 }
14
15 TESTS() {
16 shift # Ignore test run count.
17
18 # Download Microsoft DLLs.
19 curl http://www.dlldump.com/dllfiles/I/iphlpapi.dll -o _build/iphlpapi.dll
20 curl http://www.dlldump.com/dllfiles/W/ws2_32.dll -o _build/ws2_32.dll
21
22 # Copy our dependency DLLs.
23 ./dockcross sh -c 'cp $WINEDLLPATH/*.dll _build'
24
25 # Run tests in docker.
26 ./dockcross "$@" || {
27 cat _build/Testing/Temporary/LastTest.log
28 # Ignore test failures on Windows builds for now.
29 #false
30 }
31 }
32elif [ "$JOB" = "installmd" ]; then
33 true
34else
35 echo "Unsupported JOB=$JOB"
36fi
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 @@
1#!/bin/sh
2
3# We don't want toxcore-script to run yet, it should be done during FreeBSD stage 2
4exit 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 @@
1#!/bin/sh
2
3cd other/docker/windows
4
5docker build \
6 --build-arg SUPPORT_ARCH_i686=${SUPPORT_ARCH_i686} \
7 --build-arg SUPPORT_ARCH_x86_64=${SUPPORT_ARCH_x86_64} \
8 --build-arg SUPPORT_TEST=${SUPPORT_TEST} \
9 -t toxcore \
10 .
11
12cd -
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 @@
1#!/bin/sh
2
3docker run \
4 -e ALLOW_TEST_FAILURE=${ALLOW_TEST_FAILURE} \
5 -e ENABLE_ARCH_i686=${ENABLE_ARCH_i686} \
6 -e ENABLE_ARCH_x86_64=${ENABLE_ARCH_x86_64} \
7 -e ENABLE_TEST=${ENABLE_TEST} \
8 -e EXTRA_CMAKE_FLAGS="${CMAKE_EXTRA_FLAGS} -DDEBUG=ON -DTEST_TIMEOUT_SECONDS=90" \
9 -v ${PWD}:/toxcore \
10 -v ${PWD}/result:/prefix \
11 --rm \
12 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 @@
1#!/bin/sh
2
3set -e -u -x
4
5JOB="$1"
6ENV="$2"
7PHASE="$3"
8STAGE=""
9
10set +u
11if [ ! -z "$4" ] ; then
12 STAGE="$4"
13fi
14set -u
15
16. "other/travis/env.sh"
17. "other/travis/env-$ENV.sh"
18
19try_source() {
20 SCRIPT="other/travis/$1"
21 if [ -f "$SCRIPT" ]; then
22 . "$SCRIPT"
23 fi
24 if [ ! -z "$STAGE" ] && [ -f "$SCRIPT-$STAGE" ]; then
25 . "$SCRIPT-$STAGE"
26 fi
27}
28
29try_source "$PHASE"
30try_source "$ENV-$PHASE"
31try_source "$JOB-$PHASE"
32try_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 @@
1#!/bin/sh
2
3# Copy source code to other/bootstrap_daemon/docker/c-toxcore
4OLD_PWD=$PWD
5cd /tmp
6cp -a $OLD_PWD c-toxcore
7mv c-toxcore $OLD_PWD/other/bootstrap_daemon/docker
8cd $OLD_PWD
9ls -lbh other/bootstrap_daemon/docker
10ls -lbh other/bootstrap_daemon/docker/c-toxcore
11
12cd other/bootstrap_daemon
13
14# Make Docker container use our current source code instead of master branch
15sed -i "s|WORKDIR /tmp/tox|WORKDIR /tmp/tox\nADD /c-toxcore ./c-toxcore/|g" docker/Dockerfile
16sed -i '/git clone/d' docker/Dockerfile
17
18cat docker/Dockerfile
19
20sudo docker build -t tox-bootstrapd docker/
21sudo 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
22sudo chmod 700 /var/lib/tox-bootstrapd
23sudo 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
24
25sudo ls -lbh /var/lib/tox-bootstrapd
26
27if sudo [ ! -f /var/lib/tox-bootstrapd/keys ]; then
28 echo "Error: File /var/lib/tox-bootstrapd/keys doesn't exist"
29 exit 1
30fi
31
32COUNTER=0
33COUNTER_END=120
34while [ $COUNTER -lt $COUNTER_END ]; do
35 if sudo docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully" ; then
36 break
37 fi
38 sleep 1
39 COUNTER=$(($COUNTER+1))
40done
41
42sudo docker logs tox-bootstrapd
43
44if [ "$COUNTER" = "$COUNTER_END" ]; then
45 echo "Error: Didn't connect to any nodes"
46 exit 1
47fi
48
49# Wait a bit befrore testing if the container is still running
50sleep 30
51
52sudo docker ps -a
53
54if [ "`sudo docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then
55 echo "Error: Container is not running"
56 exit 1
57fi
58
59if ! python3 ../fun/bootstrap_node_info.py ipv4 localhost 33445 ; then
60 echo "Error: Unable to get bootstrap node info"
61 exit 1
62fi
63
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 @@
1#!/bin/sh
2
3if [ -d /cores ]; then
4 for core in /cores/*; do
5 lldb --core $core --one-line "bt all" < /dev/null
6 done
7fi
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 @@
1#!/bin/sh
2
3# We only submit coverage from the Linux build.
4coveralls \
5 --exclude auto_tests \
6 --exclude other \
7 --exclude testing \
8 --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 @@
1#!/bin/sh
2
3# Install cpp-coveralls to upload test coverage results.
4pip install --user ndg-httpsclient urllib3[secure] cpp-coveralls
5
6# Work around https://github.com/eddyxu/cpp-coveralls/issues/108 by manually
7# installing the pyOpenSSL module and injecting it into urllib3 as per
8# https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
9sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyopenssl.inject_into_urllib3()' `which coveralls`
10
11# Install astyle (version in ubuntu-precise too old).
12[ -f $ASTYLE ] || {
13 wget -O ../astyle.tar.gz https://deb.debian.org/debian/pool/main/a/astyle/astyle_2.06.orig.tar.gz
14 tar -xf ../astyle.tar.gz -C $CACHE_DIR
15 make -C $CACHE_DIR/astyle/build/gcc -j$NPROC
16}
17
18# Install libsodium (not in ubuntu-precise).
19[ -f $CACHE_DIR/lib/libsodium.a ] || {
20 git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium
21 cd ../libsodium # pushd
22 ./autogen.sh
23 ./configure --prefix=$CACHE_DIR
24 make install -j$NPROC
25 cd - # popd
26}
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 @@
1#!/bin/sh
2
3# Workaround for bug in Homebrew where it only finds an old Ruby version.
4brew update
5
6brew 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 @@
1#!/bin/sh
2
3DOCKER_IMAGE=toktoknet/windows:latest.$ARCH-shared
4
5docker pull $DOCKER_IMAGE
6docker run --rm $DOCKER_IMAGE > dockcross
7chmod +x dockcross