diff --git a/.travis.yml b/.travis.yml index 1a3c1d602f..09ea24415e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,18 +4,27 @@ branches: language: cpp matrix: include: - - os: linux - dist: xenial - - os: osx + - name: "linux-x64" + os: linux + dist: bionic + - name: "linux-arm64" + os: linux + dist: bionic + env: EXTRA_FLAGS='target_cpu="arm64" use_sysroot=true' + - name: "linux-arm" + os: linux + dist: bionic + env: EXTRA_FLAGS='target_cpu="arm" use_sysroot=true' + - name: "osx" + os: osx osx_image: xcode10.2 addons: apt: - sources: - - sourceline: 'deb http://archive.ubuntu.com/ubuntu/ xenial-backports universe' packages: - - ninja-build=1.7.1-1~ubuntu16.04.1 + - ninja-build - pkg-config - libnss3-dev + - qemu-user homebrew: packages: - ninja @@ -28,7 +37,7 @@ script: - ( cd src; ./build.sh ) - ccache -s - ./tests/basic.sh src/out/Release/naive - - export BUILD_NAME="naiveproxy-$TRAVIS_BRANCH-$TRAVIS_OS_NAME" + - export BUILD_NAME="naiveproxy-$TRAVIS_BRANCH-$TRAVIS_JOB_NAME" - mkdir $BUILD_NAME - cp src/out/Release/naive src/config.json LICENSE USAGE.txt $BUILD_NAME - tar cJf $BUILD_NAME.tar.xz $BUILD_NAME diff --git a/src/get-clang.sh b/src/get-clang.sh index bb255695ba..52f12c2c0a 100755 --- a/src/get-clang.sh +++ b/src/get-clang.sh @@ -7,6 +7,31 @@ case "$ARCH" in MSYS*) ARCH=Windows;; esac +eval "$EXTRA_FLAGS" + +if [ "$use_sysroot" = true ]; then + ln -sfn / ./build/linux/debian_sid_amd64-sysroot + sudo mount --bind /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/pkgconfig + case "$target_cpu" in + arm64) + rm -rf ./build/linux/debian_sid_arm64-sysroot + ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootARM64 + mkdir -p ./build/linux/debian_sid_arm64-sysroot + tar xf ./out/sysroot-build/sid/debian_sid_arm64_sysroot.tar.xz -C ./build/linux/debian_sid_arm64-sysroot + ;; + arm) + rm -rf ./build/linux/debian_sid_arm-sysroot + ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootARM + mkdir -p ./build/linux/debian_sid_arm-sysroot + tar xf ./out/sysroot-build/sid/debian_sid_arm_sysroot.tar.xz -C ./build/linux/debian_sid_arm-sysroot + rm -rf ./build/linux/debian_sid_i386-sysroot + ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootI386 + mkdir -p ./build/linux/debian_sid_i386-sysroot + tar xf ./out/sysroot-build/sid/debian_sid_i386_sysroot.tar.xz -C ./build/linux/debian_sid_i386-sysroot + ;; + esac +fi + # Clang python2=$(which python2 2>/dev/null || which python 2>/dev/null) CLANG_REVISION=$($python2 tools/clang/scripts/update.py --print-revision) diff --git a/tests/basic.sh b/tests/basic.sh index 69de22b615..bfcafda301 100755 --- a/tests/basic.sh +++ b/tests/basic.sh @@ -2,10 +2,18 @@ [ "$1" ] || exit 1 naive="$1" +eval "$EXTRA_FLAGS" +if [ "$use_sysroot" = true ]; then + case "$target_cpu" in + arm64) naive="qemu-aarch64 -L src/build/linux/debian_sid_arm64-sysroot $naive";; + arm) naive="qemu-arm -L src/build/linux/debian_sid_arm-sysroot $naive";; + esac +fi + set -ex test_proxy() { - curl -v --proxy "$1" https://www.google.com/humans.txt | grep '^Google is built' + curl -v --proxy "$1" https://www.microsoft.com/robots.txt | grep 'www.microsoft.com' } test_naive() {