Skip to content

Commit f44801c

Browse files
committed
travis: Split the linux-tested-targets builder
Travis only gives us 30GB disk space and we don't currently have an option to increase that. Each musl target generates "hello world" binaries of about 3.5MB in size, and we're testing two targets in the same image. We have around 3k run-pass tests and 2 musl targets which works out to around 20GB. That's dangerously close to the limit and is causing PRs to bounce. This PR splits up the builder in two, one for x86_64 musl and the other for i686. Hopefully that'll keep us under the disk limit. Closes #40359
1 parent 3087a1f commit f44801c

File tree

6 files changed

+87
-22
lines changed

6 files changed

+87
-22
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ matrix:
1515
- env: IMAGE=arm-android
1616
- env: IMAGE=armhf-gnu
1717
- env: IMAGE=cross DEPLOY=1
18-
- env: IMAGE=linux-tested-targets DEPLOY=1
1918
- env: IMAGE=dist-android DEPLOY=1
2019
- env: IMAGE=dist-arm-linux DEPLOY=1
2120
- env: IMAGE=dist-armv7-aarch64-linux DEPLOY=1
2221
- env: IMAGE=dist-freebsd DEPLOY=1
22+
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
2323
- env: IMAGE=dist-mips-linux DEPLOY=1
2424
- env: IMAGE=dist-mips64-linux DEPLOY=1
2525
- env: IMAGE=dist-powerpc-linux DEPLOY=1
2626
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
2727
- env: IMAGE=dist-s390x-linux-netbsd DEPLOY=1
2828
- env: IMAGE=dist-x86-linux DEPLOY=1
29+
- env: IMAGE=dist-x86_64-musl DEPLOY=1
2930
- env: IMAGE=emscripten
3031
- env: IMAGE=i686-gnu
3132
- env: IMAGE=i686-gnu-nopt

src/ci/docker/linux-tested-targets/Dockerfile src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,21 @@ RUN curl -o /usr/local/bin/sccache \
3030
chmod +x /usr/local/bin/sccache
3131

3232
ENV RUST_CONFIGURE_ARGS \
33-
--target=x86_64-unknown-linux-musl,i686-unknown-linux-musl,i586-unknown-linux-gnu \
34-
--musl-root-x86_64=/musl-x86_64 \
33+
--target=i686-unknown-linux-musl,i586-unknown-linux-gnu \
3534
--musl-root-i686=/musl-i686
3635

3736
# Newer binutils broke things on some vms/distros (i.e., linking against
3837
# unknown relocs disabled by the following flag), so we need to go out of our
3938
# way to produce "super compatible" binaries.
4039
#
4140
# See: https://github.com/rust-lang/rust/issues/34978
42-
ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no \
43-
CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
41+
ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
4442

4543
ENV SCRIPT \
4644
python2.7 ../x.py test \
47-
--target x86_64-unknown-linux-musl \
4845
--target i686-unknown-linux-musl \
4946
--target i586-unknown-linux-gnu \
5047
&& \
5148
python2.7 ../x.py dist \
52-
--target x86_64-unknown-linux-musl \
5349
--target i686-unknown-linux-musl \
5450
--target i586-unknown-linux-gnu

src/ci/docker/linux-tested-targets/build-musl.sh src/ci/docker/dist-i586-gnu-i686-musl/build-musl.sh

-15
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ export CXXFLAGS="-Wa,-mrelax-relocations=no"
1818
MUSL=musl-1.1.14
1919
curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
2020
cd $MUSL
21-
./configure --prefix=/musl-x86_64 --disable-shared
22-
make -j10
23-
make install
24-
make clean
25-
# for i686
2621
CFLAGS="$CFLAGS -m32" ./configure --prefix=/musl-i686 --disable-shared --target=i686
2722
make -j10
2823
make install
@@ -50,16 +45,6 @@ cd ..
5045

5146
mkdir libunwind-build
5247
cd libunwind-build
53-
cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
54-
-DLIBUNWIND_ENABLE_SHARED=0
55-
make -j10
56-
cp lib/libunwind.a /musl-x86_64/lib
57-
58-
# (Note: the next cmake call doesn't fully override the previous cached one, so remove the cached
59-
# configuration manually. IOW, if don't do this or call make clean we'll end up building libunwind
60-
# for x86_64 again)
61-
rm -rf *
62-
# for i686
6348
CFLAGS="$CFLAGS -m32" CXXFLAGS="$CXXFLAGS -m32" cmake ../libunwind-release_37 \
6449
-DLLVM_PATH=/build/llvm-release_37 \
6550
-DLIBUNWIND_ENABLE_SHARED=0
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
git \
11+
cmake \
12+
xz-utils \
13+
sudo \
14+
gdb \
15+
patch \
16+
libssl-dev \
17+
pkg-config
18+
19+
WORKDIR /build/
20+
COPY build-musl.sh /build/
21+
RUN sh /build/build-musl.sh && rm -rf /build
22+
23+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
24+
dpkg -i dumb-init_*.deb && \
25+
rm dumb-init_*.deb
26+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
27+
28+
RUN curl -o /usr/local/bin/sccache \
29+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-unknown-linux-musl && \
30+
chmod +x /usr/local/bin/sccache
31+
32+
ENV RUST_CONFIGURE_ARGS \
33+
--target=x86_64-unknown-linux-musl \
34+
--musl-root-x86_64=/musl-x86_64
35+
36+
# Newer binutils broke things on some vms/distros (i.e., linking against
37+
# unknown relocs disabled by the following flag), so we need to go out of our
38+
# way to produce "super compatible" binaries.
39+
#
40+
# See: https://github.com/rust-lang/rust/issues/34978
41+
ENV CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
42+
43+
ENV SCRIPT \
44+
python2.7 ../x.py test --target x86_64-unknown-linux-musl && \
45+
python2.7 ../x.py dist --target x86_64-unknown-linux-musl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
15+
export CFLAGS="-fPIC -Wa,-mrelax-relocations=no"
16+
export CXXFLAGS="-Wa,-mrelax-relocations=no"
17+
18+
MUSL=musl-1.1.14
19+
curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
20+
cd $MUSL
21+
./configure --prefix=/musl-x86_64 --disable-shared
22+
make -j10
23+
make install
24+
25+
cd ..
26+
rm -rf $MUSL
27+
28+
# To build MUSL we're going to need a libunwind lying around, so acquire that
29+
# here and build it.
30+
curl -L https://github.com/llvm-mirror/llvm/archive/release_37.tar.gz | tar xzf -
31+
curl -L https://github.com/llvm-mirror/libunwind/archive/release_37.tar.gz | tar xzf -
32+
33+
mkdir libunwind-build
34+
cd libunwind-build
35+
cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
36+
-DLIBUNWIND_ENABLE_SHARED=0
37+
make -j10
38+
cp lib/libunwind.a /musl-x86_64/lib

0 commit comments

Comments
 (0)