Skip to content

Commit

Permalink
travis: Expand dist builder coverage
Browse files Browse the repository at this point in the history
This commit adds six new travis matrix entires for doing cross-compiled
distribution builds of the compiler. The support added in #38731 allows us to
quickly compile a complete suite of distribution artifacts for cross-compiled
platforms, and currently each matrix entry (when fully cached) clocks in around
an hour to finish. Note that a full test run typically takes about two hours
right now.

With further optimizations coming down the pike in #39026 this commit also
starts doubling up cross-compiled distribution builders on each matrix entry. We
initially planned to do one build per entry, but it's looking like we may be
able to get by with more than one in each entry. Depending on how long these
builds take we may even be able to up it to three, but we'll start with two
first.

This commit then completes the suite of cross-compiled compilers that we're
going to compile, adding it for a whole litany of platforms detailed in the
changes to the docker files here. The existing `cross` image is also trimmed
down quite a bit to avoid duplicate work, and we'll eventually provision it for
far more cross compilation as well.

Note that the gcc toolchains installed to compile most of these compilers are
inappropriate for actualy distribution. The glibc they pull in is much newer
than we'd like, so before we turn nightlies off we'll need to tweak these docker
files to custom build toolchains like the current `linux-cross` docker image
does.
  • Loading branch information
alexcrichton committed Jan 15, 2017
1 parent b0c52c5 commit a6d88b0
Show file tree
Hide file tree
Showing 14 changed files with 394 additions and 55 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ matrix:
# Linux builders, all docker images
- env: IMAGE=arm-android DEPLOY=1
- env: IMAGE=cross DEPLOY=1
- env: IMAGE=dist-arm-unknown-linux-gnueabi DEPLOY=1
- env: IMAGE=dist-x86_64-unknown-freebsd DEPLOY=1
- env: IMAGE=dist-arm-linux DEPLOY=1
- env: IMAGE=dist-armv7-aarch64-linux DEPLOY=1
- env: IMAGE=dist-freebsd DEPLOY=1
- env: IMAGE=dist-mips-linux DEPLOY=1
- env: IMAGE=dist-mips64-linux DEPLOY=1
- env: IMAGE=dist-powerpc-linux DEPLOY=1
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
- env: IMAGE=dist-s390x-linux-netbsd DEPLOY=1
- env: IMAGE=i686-gnu DEPLOY=1
- env: IMAGE=i686-gnu-nopt
- env: IMAGE=x86_64-gnu DEPLOY=1
Expand Down
6 changes: 5 additions & 1 deletion src/ci/docker/arm-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ ENV RUST_CONFIGURE_ARGS \
# to all the targets above eventually.
ENV SCRIPT \
python2.7 ../x.py test --target arm-linux-androideabi && \
python2.7 ../x.py dist --target arm-linux-androideabi
python2.7 ../x.py dist \
--target arm-linux-androideabi \
--target armv7-linux-androideabi \
--target i686-linux-android \
--target aarch64-linux-android
37 changes: 1 addition & 36 deletions src/ci/docker/cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
git \
cmake \
sudo \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-arm-linux-gnueabi libc6-dev-armel-cross \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
gcc-mips-linux-gnu libc6-dev-mips-cross \
gcc-mipsel-linux-gnu libc6-dev-mipsel-cross \
gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \
gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \
gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
xz-utils

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
Expand All @@ -32,19 +21,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV TARGETS=aarch64-unknown-linux-gnu
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabi
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabihf
ENV TARGETS=$TARGETS,armv7-unknown-linux-gnueabihf
ENV TARGETS=$TARGETS,asmjs-unknown-emscripten
ENV TARGETS=$TARGETS,mips-unknown-linux-gnu
ENV TARGETS=$TARGETS,mips64-unknown-linux-gnuabi64
ENV TARGETS=$TARGETS,mips64el-unknown-linux-gnuabi64
ENV TARGETS=$TARGETS,mipsel-unknown-linux-gnu
ENV TARGETS=$TARGETS,powerpc-unknown-linux-gnu
ENV TARGETS=$TARGETS,powerpc64-unknown-linux-gnu
ENV TARGETS=$TARGETS,powerpc64le-unknown-linux-gnu
ENV TARGETS=$TARGETS,s390x-unknown-linux-gnu
ENV TARGETS=asmjs-unknown-emscripten
ENV TARGETS=$TARGETS,wasm32-unknown-emscripten

#ENV TARGETS=$TARGETS,mips-unknown-linux-musl
Expand All @@ -62,15 +39,3 @@ ENV RUST_CONFIGURE_ARGS \
ENV SCRIPT \
python2.7 ../x.py build && \
python2.7 ../x.py dist --target wasm32-unknown-emscripten

ENV AR_s390x_unknown_linux_gnu=s390x-linux-gnu-ar \
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
AR_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-ar \
CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
AR_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-ar \
CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \
AR_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-ar \
CC_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-gcc

# FIXME(rust-lang/rust#36150): powerpc unfortunately aborts right now
ENV NO_LLVM_ASSERTIONS=1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
gdb \
xz-utils \
g++-arm-linux-gnueabi
g++-arm-linux-gnueabi \
g++-arm-linux-gnueabihf

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
Expand All @@ -23,8 +24,11 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS --host=arm-unknown-linux-gnueabi
ENV RUST_CONFIGURE_ARGS \
--host=arm-unknown-linux-gnueabi,arm-unknown-linux-gnueabihf
ENV SCRIPT \
python2.7 ../x.py dist \
--host arm-unknown-linux-gnueabi \
--target arm-unknown-linux-gnueabi
--target arm-unknown-linux-gnueabi \
--host arm-unknown-linux-gnueabihf \
--target arm-unknown-linux-gnueabihf
34 changes: 34 additions & 0 deletions src/ci/docker/dist-armv7-aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-arm-linux-gnueabihf \
g++-aarch64-linux-gnu

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
tar xJf - -C /usr/local/bin --strip-components=1

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS \
--host=armv7-unknown-linux-gnueabihf,aarch64-unknown-linux-gnu
ENV SCRIPT \
python2.7 ../x.py dist \
--host armv7-unknown-linux-gnueabihf \
--target armv7-unknown-linux-gnueabihf \
--host aarch64-unknown-linux-gnu \
--target aarch64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
wget

COPY build-toolchain.sh /tmp/
RUN sh /tmp/build-toolchain.sh
RUN /tmp/build-toolchain.sh x86_64
RUN /tmp/build-toolchain.sh i686

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
Expand All @@ -29,10 +30,16 @@ RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST |
ENV \
AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-ar \
CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-gcc \
CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-g++
CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-g++ \
AR_i686_unknown_freebsd=i686-unknown-freebsd10-ar \
CC_i686_unknown_freebsd=i686-unknown-freebsd10-gcc \
CXX_i686_unknown_freebsd=i686-unknown-freebsd10-g++

ENV RUST_CONFIGURE_ARGS --host=x86_64-unknown-freebsd
ENV RUST_CONFIGURE_ARGS \
--host=x86_64-unknown-freebsd,i686-unknown-freebsd
ENV SCRIPT \
python2.7 ../x.py dist \
--host x86_64-unknown-freebsd \
--target x86_64-unknown-freebsd
--target x86_64-unknown-freebsd \
--host i686-unknown-freebsd \
--target i686-unknown-freebsd
30 changes: 23 additions & 7 deletions ...x86_64-unknown-freebsd/build-toolchain.sh → ...ci/docker/dist-freebsd/build-toolchain.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,37 @@

set -ex

ARCH=x86_64
ARCH=$1
BINUTILS=2.25.1
GCC=5.3.0

hide_output() {
set +x
on_err="
echo ERROR: An error was encountered with the build.
cat /tmp/build.log
exit 1
"
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
}

mkdir binutils
cd binutils

# First up, build binutils
curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2 | tar xjf -
mkdir binutils-build
cd binutils-build
../binutils-$BINUTILS/configure \
hide_output ../binutils-$BINUTILS/configure \
--target=$ARCH-unknown-freebsd10
make -j10
make install
hide_output make -j10
hide_output make install
cd ../..
rm -rf binutils

Expand Down Expand Up @@ -76,7 +92,7 @@ cd gcc-$GCC

mkdir ../gcc-build
cd ../gcc-build
../gcc-$GCC/configure \
hide_output ../gcc-$GCC/configure \
--enable-languages=c,c++ \
--target=$ARCH-unknown-freebsd10 \
--disable-multilib \
Expand All @@ -90,7 +106,7 @@ cd ../gcc-build
--disable-libsanitizer \
--disable-libquadmath-support \
--disable-lto
make -j10
make install
hide_output make -j10
hide_output make install
cd ../..
rm -rf gcc
34 changes: 34 additions & 0 deletions src/ci/docker/dist-mips-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-mips-linux-gnu \
g++-mipsel-linux-gnu

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
tar xJf - -C /usr/local/bin --strip-components=1

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS \
--host=mips-unknown-linux-gnu,mipsel-unknown-linux-gnu
ENV SCRIPT \
python2.7 ../x.py dist \
--host mips-unknown-linux-gnu \
--target mips-unknown-linux-gnu \
--host mipsel-unknown-linux-gnu \
--target mipsel-unknown-linux-gnu
34 changes: 34 additions & 0 deletions src/ci/docker/dist-mips64-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-mips64-linux-gnuabi64 \
g++-mips64el-linux-gnuabi64

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
tar xJf - -C /usr/local/bin --strip-components=1

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS \
--host=mips64-unknown-linux-gnuabi64,mips64el-unknown-linux-gnuabi64
ENV SCRIPT \
python2.7 ../x.py dist \
--host mips64-unknown-linux-gnuabi64 \
--target mips64-unknown-linux-gnuabi64 \
--host mips64el-unknown-linux-gnuabi64 \
--target mips64el-unknown-linux-gnuabi64
35 changes: 35 additions & 0 deletions src/ci/docker/dist-powerpc-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-powerpc-linux-gnu

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
tar xJf - -C /usr/local/bin --strip-components=1

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS \
--host=powerpc-unknown-linux-gnu
ENV SCRIPT \
python2.7 ../x.py dist \
--host powerpc-unknown-linux-gnu \
--target powerpc-unknown-linux-gnu

# FIXME(#36150) this will fail the bootstrap. Probably means something bad is
# happening!
ENV NO_LLVM_ASSERTIONS 1
39 changes: 39 additions & 0 deletions src/ci/docker/dist-powerpc64-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
gdb \
xz-utils \
g++-powerpc64-linux-gnu \
g++-powerpc64le-linux-gnu

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
tar xJf - -C /usr/local/bin --strip-components=1

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV \
AR_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-ar \
CC_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-gcc \
CXX_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-g++

ENV RUST_CONFIGURE_ARGS \
--host=powerpc64-unknown-linux-gnu,powerpc64le-unknown-linux-gnu
ENV SCRIPT \
python2.7 ../x.py dist \
--host powerpc64-unknown-linux-gnu \
--target powerpc64-unknown-linux-gnu \
--host powerpc64le-unknown-linux-gnu \
--target powerpc64le-unknown-linux-gnu
Loading

0 comments on commit a6d88b0

Please sign in to comment.