2015-09-18 02:45:10 +02:00
|
|
|
# Entry point for all travis builds, this will set up the Travis environment by
|
|
|
|
# downloading any dependencies. It will then execute the `run.sh` script to
|
|
|
|
# build and execute all tests.
|
|
|
|
|
2015-09-13 01:15:48 +02:00
|
|
|
set -ex
|
|
|
|
|
2015-09-13 01:42:49 +02:00
|
|
|
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
2015-09-13 01:15:48 +02:00
|
|
|
OS=unknown-linux-gnu
|
|
|
|
else
|
|
|
|
OS=apple-darwin
|
|
|
|
fi
|
|
|
|
|
|
|
|
export HOST=$ARCH-$OS
|
2015-10-29 18:06:09 +01:00
|
|
|
if [ "$TARGET" = "" ]; then
|
|
|
|
TARGET=$HOST
|
|
|
|
fi
|
2015-09-13 01:15:48 +02:00
|
|
|
|
2015-09-14 23:07:49 +02:00
|
|
|
MAIN_TARGETS=https://static.rust-lang.org/dist
|
2015-09-14 08:38:27 +02:00
|
|
|
EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08
|
|
|
|
|
2015-09-18 05:55:52 +02:00
|
|
|
install() {
|
|
|
|
sudo apt-get update
|
2015-10-15 00:58:08 +02:00
|
|
|
sudo apt-get install -y $@
|
2015-09-18 05:55:52 +02:00
|
|
|
}
|
|
|
|
|
2015-10-29 18:06:09 +01:00
|
|
|
case "$TARGET" in
|
|
|
|
*-apple-ios)
|
|
|
|
curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
# Download the rustlib folder from the relevant portion of main distribution's
|
|
|
|
# tarballs.
|
|
|
|
dir=rust-std-$TARGET
|
|
|
|
pkg=rust-std
|
|
|
|
if [ "$TRAVIS_RUST_VERSION" = "1.0.0" ]; then
|
|
|
|
pkg=rust
|
|
|
|
dir=rustc
|
|
|
|
fi
|
|
|
|
curl -s $MAIN_TARGETS/$pkg-$TRAVIS_RUST_VERSION-$TARGET.tar.gz | \
|
|
|
|
tar xzf - -C $HOME/rust/lib/rustlib --strip-components=4 \
|
|
|
|
$pkg-$TRAVIS_RUST_VERSION-$TARGET/$dir/lib/rustlib/$TARGET
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2015-09-19 02:30:58 +02:00
|
|
|
case "$TARGET" in
|
2015-09-13 20:22:26 +02:00
|
|
|
# Pull a pre-built docker image for testing android, then run tests entirely
|
2015-09-19 02:30:58 +02:00
|
|
|
#d within that image.
|
|
|
|
arm-linux-androideabi)
|
|
|
|
docker pull alexcrichton/rust-libc-test
|
|
|
|
exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
|
|
|
|
sh ci/run.sh $TARGET
|
|
|
|
;;
|
|
|
|
|
|
|
|
x86_64-unknown-linux-musl)
|
|
|
|
install musl-tools
|
|
|
|
export CC=musl-gcc
|
|
|
|
;;
|
|
|
|
|
|
|
|
arm-unknown-linux-gnueabihf)
|
|
|
|
install gcc-4.7-arm-linux-gnueabihf qemu-user
|
|
|
|
export CC=arm-linux-gnueabihf-gcc-4.7
|
|
|
|
;;
|
|
|
|
|
|
|
|
aarch64-unknown-linux-gnu)
|
|
|
|
install gcc-aarch64-linux-gnu qemu-user
|
|
|
|
export CC=aarch64-linux-gnu-gcc
|
|
|
|
;;
|
|
|
|
|
2015-09-20 08:20:53 +02:00
|
|
|
*-apple-ios)
|
|
|
|
;;
|
|
|
|
|
2015-09-19 02:30:58 +02:00
|
|
|
mips-unknown-linux-gnu)
|
|
|
|
# Download pre-built and custom MIPS libs and then also instsall the MIPS
|
|
|
|
# compiler according to this post:
|
|
|
|
# http://sathisharada.blogspot.com/2014_10_01_archive.html
|
|
|
|
echo 'deb http://ftp.de.debian.org/debian squeeze main' | \
|
|
|
|
sudo tee -a /etc/apt/sources.list
|
|
|
|
echo 'deb http://www.emdebian.org/debian/ squeeze main' | \
|
|
|
|
sudo tee -a /etc/apt/sources.list
|
|
|
|
install emdebian-archive-keyring
|
|
|
|
install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes
|
|
|
|
export CC=mips-linux-gnu-gcc
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
# clang has better error messages and implements alignof more broadly
|
|
|
|
export CC=clang
|
|
|
|
|
|
|
|
if [ "$TARGET" = "i686-unknown-linux-gnu" ]; then
|
|
|
|
install gcc-multilib
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2015-09-14 20:27:10 +02:00
|
|
|
|
|
|
|
mkdir .cargo
|
|
|
|
cp ci/cargo-config .cargo/config
|
|
|
|
sh ci/run.sh $TARGET
|
2015-09-17 09:48:36 +02:00
|
|
|
|
|
|
|
if [ "$TARGET" = "x86_64-unknown-linux-gnu" ] && \
|
|
|
|
[ "$TRAVIS_RUST_VERSION" = "nightly" ] && \
|
|
|
|
[ "$TRAVIS_OS_NAME" = "linux" ]; then
|
|
|
|
sh ci/dox.sh
|
|
|
|
fi
|