]> git.proxmox.com Git - rustc.git/blame - src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
New upstream version 1.55.0+dfsg1
[rustc.git] / src / ci / docker / host-x86_64 / dist-x86_64-linux / Dockerfile
CommitLineData
3dfed10e
XL
1# We use Debian 6 (glibc 2.11, kernel 2.6.32) as a common base for other
2# distros that still need Rust support: RHEL 6 (glibc 2.12, kernel 2.6.32) and
3# SLES 11 SP4 (glibc 2.11, kernel 3.0).
4FROM debian:6
32a655c1
SL
5
6WORKDIR /build
7
3dfed10e
XL
8# Debian 6 is EOL and no longer available from the usual mirrors,
9# so we'll need to switch to http://archive.debian.org/
10RUN sed -i '/updates/d' /etc/apt/sources.list && \
11 sed -i 's/httpredir/archive/' /etc/apt/sources.list
8bb4bdeb 12
3dfed10e
XL
13RUN apt-get update && \
14 apt-get install --allow-unauthenticated -y --no-install-recommends \
15 automake \
32a655c1 16 bzip2 \
3dfed10e
XL
17 ca-certificates \
18 curl \
19 file \
20 g++ \
21 g++-multilib \
32a655c1 22 gcc \
3dfed10e
XL
23 gcc-multilib \
24 git \
25 lib32z1-dev \
26 libedit-dev \
27 libncurses-dev \
32a655c1 28 make \
3dfed10e 29 patch \
32a655c1 30 perl \
3dfed10e
XL
31 pkg-config \
32 unzip \
32a655c1 33 wget \
3dfed10e
XL
34 xz-utils \
35 zlib1g-dev
32a655c1
SL
36
37ENV PATH=/rustroot/bin:$PATH
3dfed10e 38ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
8bb4bdeb 39ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
32a655c1 40WORKDIR /tmp
3dfed10e 41RUN mkdir /home/user
f035d41b 42COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
32a655c1
SL
43
44# We need a build of openssl which supports SNI to download artifacts from
45# static.rust-lang.org. This'll be used to link into libcurl below (and used
46# later as well), so build a copy of OpenSSL with dynamic libraries into our
47# generic root.
f035d41b 48COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/
32a655c1
SL
49RUN ./build-openssl.sh
50
3dfed10e 51# The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching
32a655c1
SL
52# some https urls we have, so install a new version of libcurl + curl which is
53# using the openssl we just built previously.
54#
55# Note that we also disable a bunch of optional features of curl that we don't
56# really need.
f035d41b 57COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/
3dfed10e 58RUN ./build-curl.sh && apt-get remove -y curl
32a655c1 59
8bb4bdeb
XL
60# binutils < 2.22 has a bug where the 32-bit executables it generates
61# immediately segfault in Rust, so we need to install our own binutils.
62#
63# See https://github.com/rust-lang/rust/issues/20440 for more info
f035d41b 64COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/
8bb4bdeb
XL
65RUN ./build-binutils.sh
66
3dfed10e 67# Need at least GCC 5.1 to compile LLVM nowadays
f035d41b 68COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
3dfed10e 69RUN ./build-gcc.sh && apt-get remove -y gcc g++
8bb4bdeb 70
f035d41b 71COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
6a06907d
XL
72# Build Python 3 needed for LLVM 12.
73RUN ./build-python.sh 3.9.1
32a655c1 74
6a06907d 75# LLVM needs cmake 3.13.4 or higher.
3dfed10e
XL
76COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
77RUN ./build-cmake.sh
78
79# Now build LLVM+Clang, afterwards configuring further compilations to use the
94b46f34 80# clang/clang++ compilers.
3dfed10e 81COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
94b46f34
XL
82RUN ./build-clang.sh
83ENV CC=clang CXX=clang++
84
041b39d2
XL
85COPY scripts/sccache.sh /scripts/
86RUN sh /scripts/sccache.sh
32a655c1 87
fc512014
XL
88ENV PGO_HOST=x86_64-unknown-linux-gnu
89
cc61c64b 90ENV HOSTS=x86_64-unknown-linux-gnu
32a655c1 91
8bb4bdeb 92ENV RUST_CONFIGURE_ARGS \
0531ce1d 93 --enable-full-tools \
041b39d2 94 --enable-sanitizers \
2c00a5a8 95 --enable-profiler \
94b46f34 96 --enable-compiler-docs \
b7449926
XL
97 --set target.x86_64-unknown-linux-gnu.linker=clang \
98 --set target.x86_64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
99 --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
29967ef6 100 --set llvm.thin-lto=true \
1b1a35ee 101 --set llvm.ninja=false \
a1dfa0c6 102 --set rust.jemalloc
136023e0 103ENV SCRIPT ../src/ci/pgo.sh python3 ../x.py dist \
fc512014
XL
104 --host $HOSTS --target $HOSTS \
105 --include-default-paths \
106 src/tools/build-manifest
94b46f34 107ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
8bb4bdeb
XL
108
109# This is the only builder which will create source tarballs
110ENV DIST_SRC 1
111
112# When we build cargo in this container, we don't want it to use the system
113# libcurl, instead it should compile its own.
114ENV LIBCURL_NO_PKG_CONFIG 1
0bf4aa26
XL
115
116ENV DIST_REQUIRE_ALL_TOOLS 1