Skip to content

Commit 3eb4a48

Browse files
committed
Use docker for all CI tests and images
Previously we were somewhat half-Docker, half-Travis, half apt-get, etc. This commit alters the CI infrastructure to use Docker images for each target. This should make it much easier to update the images and tweak various bits and pieces of installed software. Additionally, it's also much clearer now what's needed for each suite of tests! Some images were updated a bit (e.g. musl is now 1.1.14), but other images encountered failures when updating so they're not getting updated just yet.
1 parent 70dce05 commit 3eb4a48

File tree

20 files changed

+267
-319
lines changed

20 files changed

+267
-319
lines changed

.travis.yml

Lines changed: 72 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,106 @@
11
language: rust
22
sudo: required
33
dist: trusty
4-
rust:
5-
- 1.0.0
6-
- stable
7-
- beta
8-
- nightly
94
services:
105
- docker
6+
install:
7+
- curl https://static.rust-lang.org/rustup.sh |
8+
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`
119
script:
12-
- if [[ $TRAVIS_RUST_VERSION = nightly* ]]; then
13-
sh ci/run-travis.sh;
14-
elif [[ $TRAVIS_RUST_VERSION = "1.0.0" ]]; then
15-
cargo build;
10+
- cargo build
11+
- cargo build --no-default-features
12+
- cargo generate-lockfile --manifest-path libc-test/Cargo.toml
13+
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then
14+
sh ci/run-docker.sh $TARGET;
1615
else
17-
cargo build &&
18-
cargo build --no-default-features &&
19-
rustc ci/style.rs && ./style src;
16+
export CARGO_TARGET_DIR=`pwd`/target;
17+
sh ci/run.sh $TARGET;
2018
fi
19+
- rustc ci/style.rs && ./style src
2120
osx_image: xcode7.3
22-
os:
23-
- linux
24-
- osx
2521
env:
26-
matrix:
27-
- ARCH=x86_64
28-
- ARCH=i686
2922
global:
3023
secure: eIDEoQdTyglcsTD13zSGotAX2HDhRSXIaaTnVZTThqLSrySOc3/6KY3qmOc2Msf7XaBqfFy9QA+alk7OwfePp253eiy1Kced67ffjjFOytEcRT7FlQiYpcYQD6WNHZEj62/bJBO4LTM9sGtWNCTJVEDKW0WM8mUK7qNuC+honPM=
3124
matrix:
3225
include:
26+
# 1.0.0 compat
3327
- os: linux
34-
env: TARGET=arm-linux-androideabi DOCKER=alexcrichton/rust-slave-android:2015-11-22
35-
rust: nightly
28+
env: TARGET=x86_64-unknown-linux-gnu
29+
rust: 1.0.0
30+
script: cargo build
31+
install:
32+
33+
# build documentation
34+
- os: linux
35+
env: TARGET=x86_64-unknown-linux-gnu
36+
rust: stable
37+
script: sh ci/dox.sh
38+
39+
# stable compat
40+
- os: linux
41+
env: TARGET=x86_64-unknown-linux-gnu
42+
rust: stable
43+
- os: linux
44+
env: TARGET=i686-unknown-linux-gnu
45+
rust: stable
46+
- os: osx
47+
env: TARGET=x86_64-apple-darwin
48+
rust: stable
49+
- os: osx
50+
env: TARGET=i686-apple-darwin
51+
rust: stable
52+
- os: linux
53+
env: TARGET=arm-linux-androideabi
54+
rust: stable
3655
- os: linux
3756
env: TARGET=x86_64-unknown-linux-musl
38-
rust: nightly
57+
rust: stable
3958
- os: linux
4059
env: TARGET=arm-unknown-linux-gnueabihf
41-
rust: nightly
42-
- os: linux
43-
env: TARGET=mips-unknown-linux-gnu DOCKER=alexcrichton/rust-libc-mips:2016-01-10
44-
rust: nightly
60+
rust: stable
4561
- os: linux
4662
env: TARGET=aarch64-unknown-linux-gnu
47-
rust: nightly
63+
rust: stable
4864
- os: osx
4965
env: TARGET=i386-apple-ios
50-
rust: nightly
66+
rust: stable
5167
- os: osx
5268
env: TARGET=x86_64-apple-ios
53-
rust: nightly
69+
rust: stable
70+
- os: linux
71+
env: TARGET=x86_64-rumprun-netbsd
72+
rust: stable
73+
74+
# beta
75+
- os: linux
76+
env: TARGET=x86_64-unknown-linux-gnu
77+
rust: beta
78+
- os: osx
79+
env: TARGET=x86_64-apple-darwin
80+
rust: beta
81+
82+
# nightly
5483
- os: linux
55-
env: TARGET=x86_64-rumprun-netbsd DOCKER=alexcrichton/rust-libc-rumprun:2015-11-27
84+
env: TARGET=x86_64-unknown-linux-gnu
85+
rust: nightly
86+
- os: osx
87+
env: TARGET=x86_64-apple-darwin
5688
rust: nightly
5789
- os: linux
58-
env: TARGET=x86_64-unknown-freebsd QEMU=freebsd.qcow2
90+
env: TARGET=mips-unknown-linux-gnu
91+
# not sure why this has to be nightly...
5992
rust: nightly
93+
94+
# QEMU based targets that compile in an emulator
95+
- os: linux
96+
env: TARGET=x86_64-unknown-freebsd
97+
rust: stable
6098
- os: linux
6199
env: TARGET=x86_64-unknown-openbsd QEMU=openbsd.qcow2
62-
rust: nightly
100+
rust: stable
101+
script: sh ci/run-docker.sh $TARGET
102+
install:
103+
63104
notifications:
64105
email:
65106
on_success: never

ci/cargo-config

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM ubuntu:14.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
gcc libc6-dev ca-certificates \
5+
gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
6+
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
7+
PATH=$PATH:/rust/bin
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM alexcrichton/rust-slave-android:2015-11-22
2+
ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
3+
PATH=$PATH:/rust/bin
4+
ENTRYPOINT ["sh"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
gcc libc6-dev ca-certificates \
5+
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
6+
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
7+
PATH=$PATH:/rust/bin
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
gcc-multilib libc6-dev ca-certificates
5+
ENV PATH=$PATH:/rust/bin
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:15.10
2+
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends \
5+
software-properties-common gcc libc6-dev qemu-user
6+
RUN add-apt-repository ppa:angelsl/mips-cross
7+
RUN apt-get update
8+
RUN apt-get install -y --no-install-recommends \
9+
gcc-5-mips-linux-gnu libc6-dev-mips-cross
10+
11+
ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc-5 \
12+
CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc-5 \
13+
PATH=$PATH:/rust/bin
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mato/rumprun-toolchain-hw-x86_64
2+
USER root
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends \
5+
qemu
6+
ENV PATH=$PATH:/rust/bin
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alexcrichton/rust-slave-linux-cross:2016-04-15
2+
USER root
3+
4+
RUN apt-get update
5+
RUN apt-get install -y --no-install-recommends \
6+
qemu qemu-kvm kmod cpu-checker
7+
8+
ENTRYPOINT ["sh"]
9+
10+
ENV PATH=$PATH:/rust/bin \
11+
QEMU=freebsd.qcow2 \
12+
CAN_CROSS=1 \
13+
CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd10-gcc
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
gcc libc6-dev ca-certificates
5+
ENV PATH=$PATH:/rust/bin
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends \
5+
gcc make libc6-dev git curl ca-certificates
6+
RUN curl https://www.musl-libc.org/releases/musl-1.1.14.tar.gz | \
7+
tar xzf - && \
8+
cd musl-1.1.14 && \
9+
./configure --prefix=/musl-x86_64 && \
10+
make install -j4 && \
11+
cd .. && \
12+
rm -rf musl-1.1.14
13+
ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends \
5+
gcc libc6-dev qemu qemu-kvm curl ca-certificates kmod cpu-checker
6+
ENV PATH=$PATH:/rust/bin \
7+
QEMU=openbsd.qcow2

ci/mips/Dockerfile

Lines changed: 0 additions & 12 deletions
This file was deleted.

ci/rumprun/Dockerfile

Lines changed: 0 additions & 12 deletions
This file was deleted.

ci/run-all.sh

Lines changed: 0 additions & 48 deletions
This file was deleted.

ci/run-docker.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Small script to run tests for a target (or all targets) inside all the
2+
# respective docker images.
3+
4+
set -ex
5+
6+
run() {
7+
echo $1
8+
docker build -t libc ci/docker/$1
9+
docker run \
10+
-v `rustc --print sysroot`:/rust:ro \
11+
-v `pwd`:/checkout:ro \
12+
-e CARGO_TARGET_DIR=/tmp/target \
13+
-w /checkout \
14+
--privileged \
15+
-it libc \
16+
ci/run.sh $1
17+
}
18+
19+
if [ -z "$1" ]; then
20+
for d in `ls ci/docker/`; do
21+
run $d
22+
done
23+
else
24+
run $1
25+
fi

ci/run-qemu.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ cp -r $ROOT/libc /tmp/libc
1515
cd /tmp/libc
1616

1717
TARGET=$(cat $ROOT/TARGET)
18+
export CARGO_TARGET_DIR=/tmp
1819

1920
case $TARGET in
20-
*-freebsd)
21-
sudo pkg install -y rust cargo
22-
;;
23-
2421
*-openbsd)
2522
pkg_add rust curl gcc-4.8.4p4
2623
curl https://static.rust-lang.org/cargo-dist/2015-04-02/cargo-nightly-x86_64-unknown-openbsd.tar.gz | \

0 commit comments

Comments
 (0)