Skip to content

Commit 02312b1

Browse files
authored
Rollup merge of rust-lang#37584 - alexcrichton:travis, r=brson
Move all Linux/OSX CI infastructure to Travis This commit configures our `.travis.yml` to test the full suite of tests we have on Buildbot right now. A whole mess of docker images are added to the `src/ci` directory which represent all the build environments for each configuration. Each of these environments is then configured in `.travis.yml` to run on the auto branch. Note that the full matrix of tests aren't intended to be run on all PRs. Instead, we continue to run only one entry in the matrix, forcing all others to finish quickly. Only the `auto` branch should run the full matrix of builds. Also note that the infrastructure hasn't quite been allocated yet to the rust-lang/rust repository, so everything is disabled for now except for the one build that happens on PRs. Once that infrastructure is allocated though we can enable this and let it fly! Notable modifications from the current test suite today: * Android tests are run in rustbuild instead of the makefiles, for whatever reason I couldn't get the makefiles to work on Travis. * A debuginfo test was updated to work with the current version of the Android NDK. * Some dependencies in `mk/tests.mk` were fixed to allow running tests in parallel.
2 parents f19f939 + 008cc2d commit 02312b1

File tree

24 files changed

+734
-25
lines changed

24 files changed

+734
-25
lines changed

.travis.yml

+68-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,82 @@
1-
language: generic
1+
language: rust
22
sudo: required
3+
dist: trusty
34
services:
45
- docker
56

6-
# LLVM takes awhile to check out and otherwise we'll manage the submodules in
7-
# our configure script, so disable auto submodule management.
87
git:
9-
submodules: false
108
depth: 1
9+
submodules: false
1110

12-
before_install:
13-
- docker build -t rust -f src/etc/Dockerfile src/etc
11+
matrix:
12+
include:
13+
# Linux builders, all docker images
14+
- env: IMAGE=arm-android
15+
- env: IMAGE=cross
16+
- env: IMAGE=i686-gnu
17+
- env: IMAGE=i686-gnu-nopt
18+
- env: IMAGE=x86_64-freebsd
19+
- env: IMAGE=x86_64-gnu
20+
- env: IMAGE=x86_64-gnu-cargotest
21+
- env: IMAGE=x86_64-gnu-debug
22+
- env: IMAGE=x86_64-gnu-nopt
23+
- env: IMAGE=x86_64-gnu-rustbuild
24+
- env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1
25+
- env: IMAGE=x86_64-musl
26+
27+
# OSX builders
28+
- env: >
29+
RUST_CHECK_TARGET=check
30+
RUST_CONFIGURE_ARGS=--target=x86_64-apple-darwin
31+
SRC=.
32+
os: osx
33+
install: brew install ccache
34+
- env: >
35+
RUST_CHECK_TARGET=check
36+
RUST_CONFIGURE_ARGS=--target=i686-apple-darwin
37+
SRC=.
38+
os: osx
39+
install: brew install ccache
40+
- env: >
41+
RUST_CHECK_TARGET=check
42+
RUST_CONFIGURE_ARGS=--target=x86_64-apple-darwin --enable-rustbuild
43+
SRC=.
44+
os: osx
45+
install: brew install ccache
46+
- env: >
47+
RUST_CHECK_TARGET=
48+
RUST_CONFIGURE_ARGS=--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios
49+
SRC=.
50+
os: osx
51+
install: brew install ccache
1452
1553
script:
16-
- docker run -v `pwd`:/build rust
17-
sh -c "
18-
./configure --enable-vendor --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
19-
make tidy &&
20-
make check -j4
21-
"
54+
- if [ -z "$ALLOW_PR" ] && [ "$TRAVIS_BRANCH" != "auto" ]; then
55+
echo skipping, not a full build;
56+
elif [ -z "$ENABLE_AUTO" ] then
57+
echo skipping, not quite ready yet
58+
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
59+
git submodule update --init;
60+
src/ci/run.sh;
61+
else
62+
git submodule update --init;
63+
src/ci/docker/run.sh $IMAGE;
64+
fi
2265

23-
# Real testing happens on http://buildbot.rust-lang.org/
24-
#
25-
# See https://github.com/rust-lang/rust-buildbot
26-
# CONTRIBUTING.md#pull-requests
66+
# Save tagged docker images we created and load them if they're available
67+
before_cache:
68+
- docker history -q rust-ci |
69+
grep -v missing |
70+
xargs docker save |
71+
gzip -9 > $HOME/docker/rust-ci.tar.gz
72+
before_install:
73+
- zcat $HOME/docker/rust-ci.tar.gz | docker load || true
2774

2875
notifications:
2976
email: false
3077

31-
branches:
32-
only:
33-
- master
78+
cache:
79+
directories:
80+
- $HOME/docker
81+
- $HOME/.ccache
82+
- $HOME/.cargo

mk/tests.mk

+2
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ CTEST_DEPS_ui_$(1)-T-$(2)-H-$(3) = $$(UI_TESTS)
697697
CTEST_DEPS_mir-opt_$(1)-T-$(2)-H-$(3) = $$(MIR_OPT_TESTS)
698698
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
699699
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
700+
$$(CSREQ$(1)_T_$(3)_H_$(3)) \
701+
$$(SREQ$(1)_T_$(3)_H_$(3)) \
700702
$(S)src/etc/htmldocck.py
701703

702704
endef

src/bootstrap/mk/Makefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ else
5757
$(Q)$(BOOTSTRAP) dist --install $(BOOTSTRAP_ARGS)
5858
endif
5959
tidy:
60-
$(Q)$(BOOTSTRAP) test src/tools/tidy $(BOOTSTRAP_ARGS)
60+
$(Q)$(BOOTSTRAP) test src/tools/tidy $(BOOTSTRAP_ARGS) --stage 0
61+
62+
check-stage2-android:
63+
$(Q)$(BOOTSTRAP) --step check-target --target arm-linux-androideabi
6164

6265
.PHONY: dist

src/ci/docker/arm-android/Dockerfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM ubuntu:16.04
2+
3+
RUN dpkg --add-architecture i386 && \
4+
apt-get update && \
5+
apt-get install -y --no-install-recommends \
6+
g++ \
7+
make \
8+
file \
9+
curl \
10+
ca-certificates \
11+
python2.7 \
12+
python-minimal \
13+
git \
14+
cmake \
15+
ccache \
16+
unzip \
17+
expect \
18+
openjdk-9-jre \
19+
sudo \
20+
libstdc++6:i386
21+
22+
WORKDIR /android/
23+
ENV PATH=$PATH:/android/ndk-arm-9/bin:/android/sdk/tools:/android/sdk/platform-tools
24+
25+
COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/
26+
RUN sh /android/install-ndk.sh
27+
RUN sh /android/install-sdk.sh
28+
29+
COPY start-emulator.sh /android/
30+
ENTRYPOINT ["/android/start-emulator.sh"]
31+
32+
ENV TARGETS=arm-linux-androideabi
33+
ENV TARGETS=$TARGETS,i686-linux-android
34+
ENV TARGETS=$TARGETS,aarch64-linux-android
35+
ENV TARGETS=$TARGETS,armv7-linux-androideabi
36+
37+
ENV RUST_CONFIGURE_ARGS \
38+
--target=$TARGETS \
39+
--arm-linux-androideabi-ndk=/android/ndk-arm-9 \
40+
--armv7-linux-androideabi-ndk=/android/ndk-arm-9 \
41+
--i686-linux-android-ndk=/android/ndk-x86-9 \
42+
--aarch64-linux-android-ndk=/android/ndk-aarch64 \
43+
--enable-rustbuild
44+
ENV RUST_CHECK_TARGET check-stage2-android
45+
RUN mkdir /tmp/obj
46+
RUN chmod 777 /tmp/obj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/expect -f
2+
# ignore-license
3+
4+
set timeout 1800
5+
set cmd [lindex $argv 0]
6+
set licenses [lindex $argv 1]
7+
8+
spawn {*}$cmd
9+
expect {
10+
"Do you accept the license '*'*" {
11+
exp_send "y\r"
12+
exp_continue
13+
}
14+
eof
15+
}
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -ex
13+
14+
cpgdb() {
15+
cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb /android/$1/bin/$2-gdb
16+
cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb-orig /android/$1/bin/gdb-orig
17+
cp -r android-ndk-r11c/prebuilt/linux-x86_64/share /android/$1/share
18+
}
19+
20+
# Prep the Android NDK
21+
#
22+
# See https://github.com/servo/servo/wiki/Building-for-Android
23+
curl -O https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
24+
unzip -q android-ndk-r11c-linux-x86_64.zip
25+
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
26+
--platform=android-9 \
27+
--toolchain=arm-linux-androideabi-4.9 \
28+
--install-dir=/android/ndk-arm-9 \
29+
--ndk-dir=/android/android-ndk-r11c \
30+
--arch=arm
31+
cpgdb ndk-arm-9 arm-linux-androideabi
32+
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
33+
--platform=android-21 \
34+
--toolchain=aarch64-linux-android-4.9 \
35+
--install-dir=/android/ndk-aarch64 \
36+
--ndk-dir=/android/android-ndk-r11c \
37+
--arch=arm64
38+
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
39+
--platform=android-9 \
40+
--toolchain=x86-4.9 \
41+
--install-dir=/android/ndk-x86-9 \
42+
--ndk-dir=/android/android-ndk-r11c \
43+
--arch=x86
44+
45+
rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -ex
13+
14+
# Prep the SDK and emulator
15+
#
16+
# Note that the update process requires that we accept a bunch of licenses, and
17+
# we can't just pipe `yes` into it for some reason, so we take the same strategy
18+
# located in https://github.com/appunite/docker by just wrapping it in a script
19+
# which apparently magically accepts the licenses.
20+
21+
mkdir sdk
22+
curl https://dl.google.com/android/android-sdk_r24.4-linux.tgz | \
23+
tar xzf - -C sdk --strip-components=1
24+
25+
filter="platform-tools,android-18"
26+
filter="$filter,sys-img-armeabi-v7a-android-18"
27+
28+
./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
29+
30+
echo "no" | android create avd \
31+
--name arm-18 \
32+
--target android-18 \
33+
--abi armeabi-v7a
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -ex
13+
ANDROID_EMULATOR_FORCE_32BIT=true \
14+
emulator @arm-18 -no-window -partition-size 2047 &
15+
exec "$@"

src/ci/docker/cross/Dockerfile

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
python-minimal \
11+
git \
12+
cmake \
13+
ccache \
14+
sudo \
15+
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
16+
gcc-arm-linux-gnueabi libc6-dev-armel-cross \
17+
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
18+
gcc-mips-linux-gnu libc6-dev-mips-cross \
19+
gcc-mipsel-linux-gnu libc6-dev-mipsel-cross \
20+
gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \
21+
gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \
22+
gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \
23+
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
24+
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
25+
gcc-s390x-linux-gnu libc6-dev-s390x-cross
26+
27+
ENV TARGETS=aarch64-unknown-linux-gnu
28+
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabi
29+
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabihf
30+
ENV TARGETS=$TARGETS,armv7-unknown-linux-gnueabihf
31+
ENV TARGETS=$TARGETS,asmjs-unknown-emscripten
32+
ENV TARGETS=$TARGETS,mips-unknown-linux-gnu
33+
ENV TARGETS=$TARGETS,mips64-unknown-linux-gnuabi64
34+
ENV TARGETS=$TARGETS,mips64el-unknown-linux-gnuabi64
35+
ENV TARGETS=$TARGETS,mipsel-unknown-linux-gnu
36+
ENV TARGETS=$TARGETS,powerpc-unknown-linux-gnu
37+
ENV TARGETS=$TARGETS,powerpc64-unknown-linux-gnu
38+
ENV TARGETS=$TARGETS,powerpc64le-unknown-linux-gnu
39+
ENV TARGETS=$TARGETS,s390x-unknown-linux-gnu
40+
ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
41+
42+
#ENV TARGETS=$TARGETS,mips-unknown-linux-musl
43+
#ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
44+
#ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
45+
#ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
46+
#ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd
47+
48+
ENV RUST_CONFIGURE_ARGS \
49+
--target=$TARGETS \
50+
--enable-rustbuild
51+
ENV RUST_CHECK_TARGET ""
52+
53+
ENV AR_s390x_unknown_linux_gnu=s390x-linux-gnu-ar \
54+
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
55+
AR_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-ar \
56+
CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
57+
AR_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-ar \
58+
CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \
59+
AR_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-ar \
60+
CC_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-gcc
61+
62+
# FIXME(rust-lang/rust#36150): powerpc unfortunately aborts right now
63+
ENV NO_LLVM_ASSERTIONS=1
64+
65+
RUN mkdir /tmp/obj
66+
RUN chmod 777 /tmp/obj
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++-multilib \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
git \
11+
cmake \
12+
ccache \
13+
sudo \
14+
gdb
15+
16+
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
17+
ENV RUST_CHECK_TARGET check
18+
RUN mkdir /tmp/obj
19+
RUN chmod 777 /tmp/obj

src/ci/docker/i686-gnu/Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++-multilib \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
git \
11+
cmake \
12+
ccache \
13+
sudo \
14+
gdb
15+
16+
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
17+
ENV RUST_CHECK_TARGET check
18+
RUN mkdir /tmp/obj
19+
RUN chmod 777 /tmp/obj

0 commit comments

Comments
 (0)