Skip to content

Commit ae4288f

Browse files
committed
Integrate dist-cloudabi into dist-various-2.
As discussed in #47427, let's not have a separate container for doing CloudABI builds. It's a lot faster if we integrate it into an existing container, so there's less duplication of what's being built. Upgrade the existing container to Ubuntu 17.10, which is required for CloudABI builds. The version of Clang shipped with 16.04 is not recent enough to support CloudABI properly.
1 parent 5801f95 commit ae4288f

File tree

3 files changed

+40
-51
lines changed

3 files changed

+40
-51
lines changed

src/ci/docker/disabled/dist-cloudabi/Dockerfile

-30
This file was deleted.

src/ci/docker/dist-various-2/Dockerfile

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:17.10
22

33
COPY scripts/cross-apt-packages.sh /scripts/
44
RUN sh /scripts/cross-apt-packages.sh
@@ -21,9 +21,14 @@ RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7
2121
RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main'
2222

2323
WORKDIR /tmp
24-
COPY dist-various-2/shared.sh dist-various-2/build-fuchsia-toolchain.sh /tmp/
25-
COPY dist-various-2/build-solaris-toolchain.sh /tmp/
24+
COPY dist-various-2/shared.sh /tmp/
25+
COPY dist-various-2/build-cloudabi-toolchain.sh /tmp/
26+
RUN /tmp/build-cloudabi-toolchain.sh aarch64-unknown-cloudabi
27+
RUN /tmp/build-cloudabi-toolchain.sh i686-unknown-cloudabi
28+
RUN /tmp/build-cloudabi-toolchain.sh x86_64-unknown-cloudabi
29+
COPY dist-various-2/build-fuchsia-toolchain.sh /tmp/
2630
RUN /tmp/build-fuchsia-toolchain.sh
31+
COPY dist-various-2/build-solaris-toolchain.sh /tmp/
2732
RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386
2833
RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc
2934

@@ -44,12 +49,30 @@ ENV \
4449
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
4550
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++
4651

52+
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It can
53+
# automatically pick the right compiler path.
54+
ENV \
55+
AR_aarch64_unknown_cloudabi=aarch64-unknown-cloudabi-ar \
56+
CC_aarch64_unknown_cloudabi=aarch64-unknown-cloudabi-clang \
57+
CXX_aarch64_unknown_cloudabi=aarch64-unknown-cloudabi-clang++ \
58+
AR_i686_unknown_cloudabi=i686-unknown-cloudabi-ar \
59+
CC_i686_unknown_cloudabi=i686-unknown-cloudabi-clang \
60+
CXX_i686_unknown_cloudabi=i686-unknown-cloudabi-clang++ \
61+
AR_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-ar \
62+
CC_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang \
63+
CXX_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang++
64+
4765
ENV TARGETS=x86_64-unknown-fuchsia
4866
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
4967
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
5068
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
5169
ENV TARGETS=$TARGETS,x86_64-sun-solaris
5270
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
71+
ENV TARGETS=$TARGETS,aarch64-unknown-cloudabi
72+
# FIXME(EdSchouten): Enable ARMv7 support once libc ≥0.2.37 has been merged.
73+
# ENV TARGETS=$TARGETS,armv7-unknown-cloudabi-eabihf
74+
ENV TARGETS=$TARGETS,i686-unknown-cloudabi
75+
ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi
5376

5477
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
5578
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

src/ci/docker/scripts/cloudabi-toolchain.sh renamed to src/ci/docker/dist-various-2/build-cloudabi-toolchain.sh

+14-18
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,25 @@ apt-get install -y --no-install-recommends \
3131

3232
# Set up a Clang-based cross compiler toolchain.
3333
# Based on the steps described at https://nuxi.nl/cloudabi/debian/
34-
IFS=,
35-
for target in ${TARGETS}; do
36-
for tool in ar nm objdump ranlib size; do
37-
ln -s ../lib/llvm-5.0/bin/llvm-${tool} /usr/bin/${target}-${tool}
38-
done
39-
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-cc
40-
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-c++
41-
ln -s ../lib/llvm-5.0/bin/lld /usr/bin/${target}-ld
42-
ln -s ../../${target} /usr/lib/llvm-5.0/${target}
43-
44-
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It
45-
# can make use of ${target}-cc and ${target}-c++, without incorrectly
46-
# assuming it's MSVC.
47-
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang
48-
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang++
34+
target=$1
35+
for tool in ar nm objdump ranlib size; do
36+
ln -s ../lib/llvm-5.0/bin/llvm-${tool} /usr/bin/${target}-${tool}
4937
done
38+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-cc
39+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-c++
40+
ln -s ../lib/llvm-5.0/bin/lld /usr/bin/${target}-ld
41+
ln -s ../../${target} /usr/lib/llvm-5.0/${target}
42+
43+
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It
44+
# can make use of ${target}-cc and ${target}-c++, without incorrectly
45+
# assuming it's MSVC.
46+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang
47+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang++
5048

5149
# Install the C++ runtime libraries from CloudABI Ports.
5250
echo deb https://nuxi.nl/distfiles/cloudabi-ports/debian/ cloudabi cloudabi > \
5351
/etc/apt/sources.list.d/cloudabi.list
5452
curl 'https://pgp.mit.edu/pks/lookup?op=get&search=0x0DA51B8531344B15' | \
5553
apt-key add -
5654
apt-get update
57-
for target in ${TARGETS}; do
58-
apt-get install -y $(echo ${target} | sed -e s/_/-/g)-cxx-runtime
59-
done
55+
apt-get install -y $(echo ${target} | sed -e s/_/-/g)-cxx-runtime

0 commit comments

Comments
 (0)