fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
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. 5FROM centos:7 6 7WORKDIR /build 8 9RUN yum upgrade -y && \ 10 yum install -y epel-release && \ 11 yum install -y \ 12 automake \ 13 bzip2 \ 14 file \ 15 gcc \ 16 gcc-c++ \ 17 git \ 18 glibc-devel.i686 \ 19 glibc-devel.x86_64 \ 20 libedit-devel \ 21 libstdc++-devel.i686 \ 22 libstdc++-devel.x86_64 \ 23 make \ 24 ncurses-devel \ 25 openssl-devel \ 26 patch \ 27 perl \ 28 pkgconfig \ 29 python3 \ 30 unzip \ 31 wget \ 32 xz \ 33 zlib-devel.i686 \ 34 zlib-devel.x86_64 \ 35 && yum clean all 36 37RUN mkdir -p /rustroot/bin 38 39ENV PATH=/rustroot/bin:$PATH 40ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib 41ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig 42WORKDIR /tmp 43RUN mkdir /home/user 44COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/ 45 46# Need at least GCC 5.1 to compile LLVM nowadays 47COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/ 48RUN ./build-gcc.sh && yum remove -y gcc gcc-c++ 49 50# LLVM 17 needs cmake 3.20 or higher. 51COPY scripts/cmake.sh /tmp/ 52RUN ./cmake.sh 53 54# Now build LLVM+Clang, afterwards configuring further compilations to use the 55# clang/clang++ compilers. 56COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/ 57RUN ./build-clang.sh 58ENV CC=clang CXX=clang++ 59 60# rustc-perf version from 2023-05-30 61# Should also be changed in the opt-dist tool for other environments. 62ENV PERF_COMMIT 8b2ac3042e1ff2c0074455a0a3618adef97156b1 63RUN curl -LS -o perf.zip https://ci-mirrors.rust-lang.org/rustc/rustc-perf-$PERF_COMMIT.zip && \ 64 unzip perf.zip && \ 65 mv rustc-perf-$PERF_COMMIT rustc-perf && \ 66 rm perf.zip 67 68COPY scripts/sccache.sh /scripts/ 69RUN sh /scripts/sccache.sh 70 71ENV PGO_HOST=x86_64-unknown-linux-gnu 72 73ENV HOSTS=x86_64-unknown-linux-gnu 74 75ENV RUST_CONFIGURE_ARGS \ 76 --enable-full-tools \ 77 --enable-sanitizers \ 78 --enable-profiler \ 79 --enable-compiler-docs \ 80 --set target.x86_64-unknown-linux-gnu.linker=clang \ 81 --set target.x86_64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \ 82 --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \ 83 --set llvm.thin-lto=true \ 84 --set llvm.ninja=false \ 85 --set rust.jemalloc \ 86 --set rust.use-lld=true \ 87 --set rust.lto=thin \ 88 --set rust.codegen-units=1 89 90ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ 91 ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ 92 --host $HOSTS --target $HOSTS \ 93 --include-default-paths \ 94 build-manifest bootstrap 95ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang 96 97# This is the only builder which will create source tarballs 98ENV DIST_SRC 1 99 100# When we build cargo in this container, we don't want it to use the system 101# libcurl, instead it should compile its own. 102ENV LIBCURL_NO_PKG_CONFIG 1 103 104ENV DIST_REQUIRE_ALL_TOOLS 1