]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
Remove obsolete comment.
[rust.git] / src / ci / docker / host-x86_64 / dist-x86_64-linux / Dockerfile
1 # We document platform support for minimum glibc 2.17 and kernel 3.2.
2 # CentOS 7 has headers for kernel 3.10, but that's fine as long as we don't
3 # actually use newer APIs in rustc or std without a fallback. It's more
4 # important that we match glibc for ELF symbol versioning.
5 FROM centos:7
6
7 WORKDIR /build
8
9 RUN yum upgrade -y && \
10     yum install -y epel-release && \
11     yum install -y \
12       automake \
13       bzip2 \
14       file \
15       cmake3 \
16       gcc \
17       gcc-c++ \
18       git \
19       glibc-devel.i686 \
20       glibc-devel.x86_64 \
21       libedit-devel \
22       libstdc++-devel.i686 \
23       libstdc++-devel.x86_64 \
24       make \
25       ncurses-devel \
26       openssl-devel \
27       patch \
28       perl \
29       pkgconfig \
30       python3 \
31       unzip \
32       wget \
33       xz \
34       zlib-devel.i686 \
35       zlib-devel.x86_64 \
36       && yum clean all
37
38 RUN mkdir -p /rustroot/bin && ln -s /usr/bin/cmake3 /rustroot/bin/cmake
39
40 ENV PATH=/rustroot/bin:$PATH
41 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
42 ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
43 WORKDIR /tmp
44 RUN mkdir /home/user
45 COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
46
47 # Need at least GCC 5.1 to compile LLVM nowadays
48 COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
49 RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
50
51 # Now build LLVM+Clang, afterwards configuring further compilations to use the
52 # clang/clang++ compilers.
53 COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
54 RUN ./build-clang.sh
55 ENV CC=clang CXX=clang++
56
57 # rustc-perf version from 2022-07-22
58 ENV PERF_COMMIT 3c253134664fdcba862c539d37f0de18557a9a4c
59 RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \
60     unzip perf.zip && \
61     mv rustc-perf-$PERF_COMMIT rustc-perf && \
62     rm perf.zip
63
64 COPY scripts/sccache.sh /scripts/
65 RUN sh /scripts/sccache.sh
66
67 ENV PGO_HOST=x86_64-unknown-linux-gnu
68
69 ENV HOSTS=x86_64-unknown-linux-gnu
70
71 ENV RUST_CONFIGURE_ARGS \
72       --enable-full-tools \
73       --enable-sanitizers \
74       --enable-profiler \
75       --enable-compiler-docs \
76       --set target.x86_64-unknown-linux-gnu.linker=clang \
77       --set target.x86_64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
78       --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
79       --set llvm.thin-lto=true \
80       --set llvm.ninja=false \
81       --set rust.jemalloc \
82       --set rust.use-lld=true \
83       --set rust.lto=thin
84 ENV SCRIPT ../src/ci/pgo.sh python3 ../x.py dist \
85     --host $HOSTS --target $HOSTS \
86     --include-default-paths \
87     build-manifest bootstrap
88 ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
89
90 # This is the only builder which will create source tarballs
91 ENV DIST_SRC 1
92
93 # When we build cargo in this container, we don't want it to use the system
94 # libcurl, instead it should compile its own.
95 ENV LIBCURL_NO_PKG_CONFIG 1
96
97 ENV DIST_REQUIRE_ALL_TOOLS 1