Skip to content

Commit 920c479

Browse files
committed
Auto merge of #42218 - venkatagiri:update_cross, r=alexchrichton
use shared scripts for init and sccache in cross image cc #42201 cc @malbarbo
2 parents d47cf08 + 7acc999 commit 920c479

File tree

3 files changed

+62
-24
lines changed

3 files changed

+62
-24
lines changed

src/ci/docker/cross/Dockerfile

+14-24
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2121
libssl-dev \
2222
pkg-config
2323

24-
RUN curl -o /usr/local/bin/sccache \
25-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
26-
chmod +x /usr/local/bin/sccache
27-
28-
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
29-
dpkg -i dumb-init_*.deb && \
30-
rm dumb-init_*.deb
31-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
24+
# dumb-init
25+
COPY scripts/dumb-init.sh /scripts/
26+
RUN sh /scripts/dumb-init.sh
3227

3328
WORKDIR /tmp
3429

@@ -38,23 +33,11 @@ RUN ./build-rumprun.sh
3833
COPY cross/build-arm-musl.sh /tmp/
3934
RUN ./build-arm-musl.sh
4035

41-
# originally from
42-
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
43-
RUN mkdir /usr/local/mips-linux-musl
44-
RUN curl -L https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2 | \
45-
tar xjf - -C /usr/local/mips-linux-musl --strip-components=2
46-
RUN for file in /usr/local/mips-linux-musl/bin/mips-openwrt-linux-*; do \
47-
ln -s $file /usr/local/bin/`basename $file`; \
48-
done
36+
COPY cross/install-mips-musl.sh /tmp/
37+
RUN ./install-mips-musl.sh
4938

50-
# Note that this originally came from:
51-
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
52-
RUN mkdir /usr/local/mipsel-linux-musl
53-
RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
54-
tar xjf - -C /usr/local/mipsel-linux-musl --strip-components=2
55-
RUN for file in /usr/local/mipsel-linux-musl/bin/mipsel-openwrt-linux-*; do \
56-
ln -s $file /usr/local/bin/`basename $file`; \
57-
done
39+
COPY cross/install-mipsel-musl.sh /tmp/
40+
RUN ./install-mipsel-musl.sh
5841

5942
ENV TARGETS=asmjs-unknown-emscripten
6043
ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
@@ -80,3 +63,10 @@ ENV RUST_CONFIGURE_ARGS \
8063
--musl-root-armhf=/usr/local/arm-linux-musleabihf \
8164
--musl-root-armv7=/usr/local/armv7-linux-musleabihf
8265
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
66+
67+
# sccache
68+
COPY scripts/sccache.sh /scripts/
69+
RUN sh /scripts/sccache.sh
70+
71+
# init
72+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
set -ex
12+
13+
mkdir /usr/local/mips-linux-musl
14+
15+
# originally from
16+
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/
17+
# OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
18+
URL="https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror"
19+
FILE="OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2"
20+
curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mips-linux-musl --strip-components=2
21+
22+
for file in /usr/local/mips-linux-musl/bin/mips-openwrt-linux-*; do
23+
ln -s $file /usr/local/bin/`basename $file`
24+
done
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
set -ex
12+
13+
mkdir /usr/local/mipsel-linux-musl
14+
15+
# Note that this originally came from:
16+
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/
17+
# OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
18+
URL="https://s3.amazonaws.com/rust-lang-ci/libc"
19+
FILE="OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2"
20+
curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mipsel-linux-musl --strip-components=2
21+
22+
for file in /usr/local/mipsel-linux-musl/bin/mipsel-openwrt-linux-*; do
23+
ln -s $file /usr/local/bin/`basename $file`
24+
done

0 commit comments

Comments
 (0)