blob: f5ddc9dc51f5c9e7e71f7ce418f68cba685de9b3 [file] [log] [blame]
Alex Crichton83a30492015-09-12 16:15:48 -07001set -ex
2
Alex Crichtone47a4502015-09-12 16:42:49 -07003if [ "$TRAVIS_OS_NAME" = "linux" ]; then
Alex Crichton83a30492015-09-12 16:15:48 -07004 OS=unknown-linux-gnu
5else
6 OS=apple-darwin
7fi
8
9export HOST=$ARCH-$OS
10
Alex Crichton2fe6de42015-09-14 14:07:49 -070011MAIN_TARGETS=https://static.rust-lang.org/dist
Alex Crichton23ab70b2015-09-13 23:38:27 -070012EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08
13
Alex Crichton9eca4682015-09-17 00:48:36 -070014if [ "$TARGET" = "arm-linux-androideabi" ]; then
Alex Crichtonacda0132015-09-13 11:22:26 -070015 # Pull a pre-built docker image for testing android, then run tests entirely
16 # within that image.
17 docker pull alexcrichton/rust-libc-test
Alex Crichton944a7332015-09-14 11:27:10 -070018 exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
19 sh ci/run.sh $TARGET
Alex Crichton2f846f32015-09-13 21:21:46 -070020elif [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
Alex Crichton23ab70b2015-09-13 23:38:27 -070021 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichton15b83c22015-09-17 17:25:52 -070022 sudo apt-get install musl-tools
23 export CC=musl-gcc
Alex Crichton23ab70b2015-09-13 23:38:27 -070024elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
25 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichton517b76a2015-09-13 23:53:31 -070026 sudo apt-get install gcc-4.7-arm-linux-gnueabihf qemu-user
Alex Crichton23ab70b2015-09-13 23:38:27 -070027 export CC=arm-linux-gnueabihf-gcc-4.7
Alex Crichton684cfa42015-09-17 15:18:18 -070028elif [ "$TARGET" = "aarch64-unknown-linux-gnu" ]; then
29 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
30 sudo apt-get install gcc-aarch64-linux-gnu qemu-user
31 export CC=aarch64-linux-gnu-gcc
Alex Crichton944a7332015-09-14 11:27:10 -070032elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
Alex Crichtona4d78c42015-09-14 13:52:51 -070033 # Download pre-built and custom MIPS libs and then also instsall the MIPS
34 # compiler according to this post:
35 # http://sathisharada.blogspot.com/2014_10_01_archive.html
Alex Crichton944a7332015-09-14 11:27:10 -070036 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichtona4d78c42015-09-14 13:52:51 -070037
Alex Crichton944a7332015-09-14 11:27:10 -070038 echo 'deb http://ftp.de.debian.org/debian squeeze main' | \
39 sudo tee -a /etc/apt/sources.list
40 echo 'deb http://www.emdebian.org/debian/ squeeze main' | \
41 sudo tee -a /etc/apt/sources.list
42 sudo apt-get update
Alex Crichtonac5ba002015-09-14 11:49:09 -070043 sudo apt-get install emdebian-archive-keyring
Alex Crichton86c7c432015-09-14 12:58:03 -070044 sudo apt-get install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes
Alex Crichton944a7332015-09-14 11:27:10 -070045 export CC=mips-linux-gnu-gcc
Alex Crichtonacda0132015-09-13 11:22:26 -070046else
Alex Crichtona4d78c42015-09-14 13:52:51 -070047 # Download the rustlib folder from the relevant portion of main distribution's
48 # tarballs.
49 curl -s $MAIN_TARGETS/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz | \
50 tar xzf - -C $HOME/rust/lib/rustlib --strip-components=4 \
51 rust-$TRAVIS_RUST_VERSION-$HOST/rustc/lib/rustlib/$HOST
Alex Crichton944a7332015-09-14 11:27:10 -070052 TARGET=$HOST
Alex Crichtona4d78c42015-09-14 13:52:51 -070053
54 # clang has better error messages and implements alignof more broadly
55 export CC=clang
Alex Crichton83a30492015-09-12 16:15:48 -070056fi
Alex Crichton944a7332015-09-14 11:27:10 -070057
58mkdir .cargo
59cp ci/cargo-config .cargo/config
60sh ci/run.sh $TARGET
Alex Crichton9eca4682015-09-17 00:48:36 -070061
62if [ "$TARGET" = "x86_64-unknown-linux-gnu" ] && \
63 [ "$TRAVIS_RUST_VERSION" = "nightly" ] && \
64 [ "$TRAVIS_OS_NAME" = "linux" ]; then
65 sh ci/dox.sh
66fi