Skip to content
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ matrix:
- libc6-powerpc-cross
- libc6-dev-powerpc-cross
- qemu-user-static
- env: TARGET=powerpc64le-unknown-linux-gnu
os: linux
services: docker
sudo: required
- env: TARGET=x86_64-apple-darwin
os: osx
- env: TARGET=x86_64-unknown-linux-gnu
Expand All @@ -68,6 +72,9 @@ matrix:
# FIXME(#2)
- env: TARGET=armv7-unknown-linux-gnueabihf
os: linux
# FIXME QEMU blows up
- env: TARGET=powerpc64le-unknown-linux-gnu
os: linux

before_install:
- export PATH="$PATH:$HOME/.cargo/bin"
Expand Down
9 changes: 9 additions & 0 deletions ci/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ case $TARGET in
export PREFIX=powerpc-linux-gnu-
export QEMU_LD_PREFIX=/usr/powerpc-linux-gnu
;;
powerpc64le-unknown-linux-gnu)
# NOTE $DOCKER values: 'y' (yes, call docker), 'i' (inside a docker container) or 'n' ("no)
if [[ -z $DOCKER ]]; then
export DOCKER=y
fi
export PREFIX=powerpc64le-linux-gnu-
export QEMU=qemu-ppc64le
export QEMU_LD_PREFIX=/usr/powerpc64le-linux-gnu
;;
esac
37 changes: 31 additions & 6 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ set -ex

. $(dirname $0)/env.sh

install_deps() {
if [[ ${DOCKER} == "i" ]]; then
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates curl
fi
}

install_qemu() {
case $TARGET in
powerpc64le-unknown-linux-gnu)
apt-get install -y --no-install-recommends \
qemu-user
;;
esac
}

install_binutils() {
case $TRAVIS_OS_NAME in
osx)
Expand All @@ -16,7 +33,11 @@ install_c_toolchain() {
case $TARGET in
aarch64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
gcc-aarch64-linux-gnu libc6-dev-arm64-cross
;;
powerpc64le-unknown-linux-gnu)
apt-get install -y --no-install-recommends \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
;;
*)
;;
Expand Down Expand Up @@ -49,11 +70,15 @@ EOF
}

main() {
install_binutils
install_c_toolchain
install_rust
add_rustup_target
configure_cargo
if [[ ${DOCKER:-n} != "y" ]]; then
install_deps
install_qemu
install_binutils
install_c_toolchain
install_rust
add_rustup_target
configure_cargo
fi
}

main
31 changes: 26 additions & 5 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ run_tests() {
export RUST_TEST_THREADS=1
fi

cargo test --target $TARGET
cargo test --target $TARGET --release
if [[ $QEMU ]]; then
cargo test --target $TARGET --no-run
$QEMU target/**/debug/rustc_builtins-*
cargo test --target $TARGET --release --no-run
$QEMU target/**/release/rustc_builtins-*
else
cargo test --target $TARGET
cargo test --target $TARGET --release
fi
}

inspect() {
Expand All @@ -25,9 +32,23 @@ inspect() {
}

main() {
build
run_tests
inspect
if [[ $DOCKER == "y" ]]; then
docker run \
-e DOCKER=i \
-e TARGET=$TARGET \
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
-v $(pwd):/mnt \
ubuntu:16.04 \
sh -c 'set -ex;
cd /mnt;
export PATH="$PATH:$HOME/.cargo/bin";
bash ci/install.sh;
bash ci/script.sh'
else
build
run_tests
inspect
fi
}

main