Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Move dist-aarch64-linux to an aarch64 runner #135262

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# We document platform support for minimum glibc 2.17 and kernel 3.2.
# CentOS 7 has headers for kernel 3.10, but that's fine as long as we don't
# actually use newer APIs in rustc or std without a fallback. It's more
# important that we match glibc for ELF symbol versioning.
FROM centos:7

WORKDIR /build

# CentOS 7 EOL is June 30, 2024, but the repos remain in the vault.
RUN sed -i /etc/yum.repos.d/*.repo -e 's!^mirrorlist!#mirrorlist!' \
-e 's!^#baseurl=http://mirror.centos.org/!baseurl=https://vault.centos.org/!'
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf

RUN yum upgrade -y && \
yum install -y \
automake \
bzip2 \
file \
gcc \
gcc-c++ \
git \
glibc-devel \
libedit-devel \
libstdc++-devel \
make \
ncurses-devel \
openssl-devel \
patch \
perl \
perl-core \
pkgconfig \
python3 \
unzip \
wget \
xz \
zlib-devel \
&& yum clean all

RUN mkdir -p /rustroot/bin

ENV PATH=/rustroot/bin:$PATH
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
WORKDIR /tmp
RUN mkdir /home/user
COPY scripts/shared.sh /tmp/

# Need at least GCC 5.1 to compile LLVM
COPY scripts/build-gcc.sh /tmp/
ENV GCC_VERSION=9.5.0
ENV GCC_BUILD_TARGET=aarch64-unknown-linux-gnu
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++

ENV CC=gcc CXX=g++

# LLVM 17 needs cmake 3.20 or higher.
COPY scripts/cmake.sh /tmp/
RUN ./cmake.sh

# Build LLVM+Clang
COPY scripts/build-clang.sh /tmp/
ENV LLVM_BUILD_TARGETS=AArch64
RUN ./build-clang.sh
ENV CC=clang CXX=clang++

# Build zstd to enable `llvm.libzstd`.
COPY scripts/build-zstd.sh /tmp/
RUN ./build-zstd.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV PGO_HOST=aarch64-unknown-linux-gnu
ENV HOSTS=aarch64-unknown-linux-gnu

ENV CPATH=/usr/include/aarch64-linux-gnu/:$CPATH

ENV RUST_CONFIGURE_ARGS \
--build=aarch64-unknown-linux-gnu \
--enable-full-tools \
--enable-profiler \
--enable-sanitizers \
--enable-compiler-docs \
--set target.aarch64-unknown-linux-gnu.linker=clang \
--set target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
--set target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
--set llvm.link-shared=true \
--set llvm.thin-lto=true \
--set llvm.libzstd=true \
--set llvm.ninja=false \
--set rust.debug-assertions=false \
--set rust.jemalloc \
--set rust.use-lld=true \
--set rust.codegen-units=1

ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=clang
ENV DIST_SRC 1
ENV LIBCURL_NO_PKG_CONFIG 1
ENV DIST_REQUIRE_ALL_TOOLS 1
32 changes: 0 additions & 32 deletions src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile

This file was deleted.

This file was deleted.

9 changes: 6 additions & 3 deletions src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN yum upgrade -y && \
gcc \
gcc-c++ \
git \
binutils.i686 \
glibc-devel.i686 \
glibc-devel.x86_64 \
libedit-devel \
Expand Down Expand Up @@ -46,19 +47,21 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
WORKDIR /tmp
RUN mkdir /home/user
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
COPY scripts/shared.sh /tmp/

# Need at least GCC 5.1 to compile LLVM nowadays
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
COPY scripts/build-gcc.sh /tmp/
ENV GCC_VERSION=9.5.0
ENV GCC_BUILD_TARGET=i686-pc-linux-gnu
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++

COPY scripts/cmake.sh /tmp/
RUN ./cmake.sh

# Now build LLVM+Clang, afterwards configuring further compilations to use the
# clang/clang++ compilers.
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
COPY scripts/build-clang.sh /tmp/
ENV LLVM_BUILD_TARGETS=X86
RUN ./build-clang.sh
ENV CC=clang CXX=clang++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN /scripts/crosstool-ng-build.sh
WORKDIR /build

RUN apt-get install -y --no-install-recommends rpm2cpio cpio
COPY host-x86_64/dist-powerpc64le-linux/shared.sh host-x86_64/dist-powerpc64le-linux/build-powerpc64le-toolchain.sh /build/
COPY scripts/shared.sh host-x86_64/dist-powerpc64le-linux/build-powerpc64le-toolchain.sh /build/
RUN ./build-powerpc64le-toolchain.sh

COPY scripts/sccache.sh /scripts/
Expand Down
16 changes: 0 additions & 16 deletions src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh

This file was deleted.

10 changes: 6 additions & 4 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
# Clang needs to access GCC headers to enable linker plugin LTO
WORKDIR /tmp
RUN mkdir /home/user
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
COPY scripts/shared.sh /tmp/

# Need at least GCC 5.1 to compile LLVM nowadays
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
COPY scripts/build-gcc.sh /tmp/
ENV GCC_VERSION=9.5.0
ENV GCC_BUILD_TARGET=x86_64-pc-linux-gnu
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++

# LLVM 17 needs cmake 3.20 or higher.
Expand All @@ -60,12 +61,13 @@ RUN ./cmake.sh

# Now build LLVM+Clang, afterwards configuring further compilations to use the
# clang/clang++ compilers.
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
COPY scripts/build-clang.sh /tmp/
ENV LLVM_BUILD_TARGETS=X86
RUN ./build-clang.sh
ENV CC=clang CXX=clang++

# Build zstd to enable `llvm.libzstd`.
COPY host-x86_64/dist-x86_64-linux/build-zstd.sh /tmp/
COPY scripts/build-zstd.sh /tmp/
RUN ./build-zstd.sh

COPY scripts/sccache.sh /scripts/
Expand Down
16 changes: 0 additions & 16 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh

This file was deleted.

4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
--set rust.randomize-layout=true \
--set rust.thin-lto-import-instr-limit=10

COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
COPY scripts/shared.sh /scripts/
COPY scripts/build-gccjit.sh /scripts/

RUN /scripts/build-gccjit.sh /scripts

Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
--set rust.randomize-layout=true \
--set rust.thin-lto-import-instr-limit=10

COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
COPY scripts/shared.sh /scripts/
COPY scripts/build-gccjit.sh /scripts/

RUN /scripts/build-gccjit.sh /scripts

Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ ENV HOST_TARGET x86_64-unknown-linux-gnu
# assertions enabled! Therefore, we cannot force download CI rustc.
#ENV FORCE_CI_RUSTC 1

COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
COPY scripts/shared.sh /scripts/
COPY scripts/build-gccjit.sh /scripts/

RUN /scripts/build-gccjit.sh /scripts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ cd clang-build
# include path, /rustroot/include, to clang's default include path.
INC="/rustroot/include:/usr/include"

GCC_PLUGIN_TARGET=$GCC_BUILD_TARGET
# We build gcc for the i686 job on x86_64 so the plugin will end up under an x86_64 path
if [[ $GCC_PLUGIN_TARGET == "i686-pc-linux-gnu" ]]; then
GCC_PLUGIN_TARGET=x86_64-pc-linux-gnu
fi

# We need compiler-rt for the profile runtime (used later to PGO the LLVM build)
# but sanitizers aren't currently building. Since we don't need those, just
# disable them. BOLT is used for optimizing LLVM.
Expand All @@ -34,12 +40,12 @@ hide_output \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_TARGETS_TO_BUILD=$LLVM_BUILD_TARGETS \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt;bolt" \
-DLLVM_BINUTILS_INCDIR="/rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC_VERSION/plugin/include/" \
-DLLVM_BINUTILS_INCDIR="/rustroot/lib/gcc/$GCC_PLUGIN_TARGET/$GCC_VERSION/plugin/include/" \
-DC_INCLUDE_DIRS="$INC"

hide_output make -j$(nproc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ cd ..
rm -rf gcc-build
rm -rf gcc-$GCC

# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
# but it does look all the way under /rustroot/lib/[...]/32,
# so we can link stuff there to help it out.
ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/
if [[ $GCC_BUILD_TARGET == "i686-pc-linux-gnu" ]]; then
# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
# but it does look all the way under /rustroot/lib/[...]/32,
# so we can link stuff there to help it out.
ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/
fi
2 changes: 1 addition & 1 deletion src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ auto:
- name: dist-aarch64-linux
env:
CODEGEN_BACKENDS: llvm,cranelift
<<: *job-linux-4c
<<: *job-aarch64-linux

- name: dist-android
<<: *job-linux-4c
Expand Down
Loading