-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Enable opt-dist for dist-aarch64-linux builds
Move the CI dist-aarch64-linux job to an aarch64 runner and enable optimised dist builds with the opt-dist pipeline. For the time being, disable bolt on aarch64 due to upstream bolt bugs.
- Loading branch information
1 parent
bd36e69
commit 02b958d
Showing
8 changed files
with
153 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /build | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y pkg-config curl xz-utils wget unzip git make patch perl lbzip2 gcc g++ libc6-dev cmake python3 doxygen graphviz zstd libzstd-dev openssl libssl-dev | ||
|
||
ENV PATH=/rustroot/bin:$PATH | ||
|
||
WORKDIR /tmp | ||
COPY host-aarch64/dist-aarch64-linux/shared.sh /tmp/ | ||
|
||
ENV CC=gcc CXX=g++ | ||
|
||
# Build LLVM+Clang | ||
COPY host-aarch64/dist-aarch64-linux/build-clang.sh /tmp/ | ||
RUN ./build-clang.sh | ||
ENV CC=clang CXX=clang++ | ||
|
||
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.lto=thin \ | ||
--set rust.codegen-units=1 | ||
|
||
|
||
ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ | ||
./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ | ||
--host $HOSTS --target $HOSTS --include-default-paths build-manifest bootstrap | ||
|
||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=clang | ||
ENV DIST_SRC 1 | ||
ENV DIST_REQUIRE_ALL_TOOLS 1 |
46 changes: 46 additions & 0 deletions
46
src/ci/docker/host-aarch64/dist-aarch64-linux/build-clang.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
source shared.sh | ||
|
||
# Try to keep the LLVM version here in sync with src/ci/scripts/install-clang.sh | ||
LLVM=llvmorg-19.1.5 | ||
|
||
mkdir llvm-project | ||
cd llvm-project | ||
|
||
curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \ | ||
tar xzf - --strip-components=1 | ||
|
||
mkdir clang-build | ||
cd clang-build | ||
|
||
# For whatever reason the default set of include paths for clang is different | ||
# than that of gcc. As a result we need to manually include our sysroot's | ||
# include path, /rustroot/include, to clang's default include path. | ||
INC="/rustroot/include:/usr/include" | ||
|
||
# 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. | ||
hide_output \ | ||
cmake ../llvm \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/rustroot \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF \ | ||
-DLLVM_TARGETS_TO_BUILD=AArch64 \ | ||
-DLLVM_INCLUDE_BENCHMARKS=OFF \ | ||
-DLLVM_INCLUDE_TESTS=OFF \ | ||
-DLLVM_INCLUDE_EXAMPLES=OFF \ | ||
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt;bolt" \ | ||
-DC_INCLUDE_DIRS="$INC" | ||
|
||
hide_output make -j$(nproc) | ||
hide_output make install | ||
|
||
cd ../.. | ||
rm -rf llvm-project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
hide_output() { | ||
set +x | ||
on_err=" | ||
echo ERROR: An error was encountered with the build. | ||
cat /tmp/build.log | ||
exit 1 | ||
" | ||
trap "$on_err" ERR | ||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & | ||
PING_LOOP_PID=$! | ||
"$@" &> /tmp/build.log | ||
trap - ERR | ||
kill $PING_LOOP_PID | ||
set -x | ||
} |
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/ci/docker/host-x86_64/dist-aarch64-linux/aarch64-linux-gnu.defconfig
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters