Skip to content

Commit

Permalink
ci: Organise shared helper scripts
Browse files Browse the repository at this point in the history
Move shared helper scripts used by Docker builds under docker/scripts.
  • Loading branch information
mrkajetanp authored and davidtwco committed Dec 18, 2024
1 parent 8857b84 commit 3afda7e
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 199 deletions.
11 changes: 6 additions & 5 deletions src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ 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-aarch64/dist-aarch64-linux/shared.sh /tmp/
COPY scripts/shared.sh /tmp/

# Need at least GCC 5.1 to compile LLVM
COPY host-aarch64/dist-aarch64-linux/build-gcc.sh /tmp/
COPY scripts/build-gcc.sh /tmp/
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++

ENV CC=gcc CXX=g++
Expand All @@ -56,12 +56,13 @@ COPY scripts/cmake.sh /tmp/
RUN ./cmake.sh

# Build LLVM+Clang
COPY host-aarch64/dist-aarch64-linux/build-clang.sh /tmp/
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 host-aarch64/dist-aarch64-linux/build-zstd.sh /tmp/
COPY scripts/build-zstd.sh /tmp/
RUN ./build-zstd.sh

COPY scripts/sccache.sh /scripts/
Expand All @@ -82,7 +83,7 @@ ENV RUST_CONFIGURE_ARGS \
--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=false \
--set llvm.thin-lto=true \
--set llvm.libzstd=true \
--set llvm.ninja=false \
--set rust.debug-assertions=false \
Expand Down
46 changes: 0 additions & 46 deletions src/ci/docker/host-aarch64/dist-aarch64-linux/build-clang.sh

This file was deleted.

51 changes: 0 additions & 51 deletions src/ci/docker/host-aarch64/dist-aarch64-linux/build-gcc.sh

This file was deleted.

16 changes: 0 additions & 16 deletions src/ci/docker/host-aarch64/dist-aarch64-linux/shared.sh

This file was deleted.

8 changes: 5 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 @@ -46,18 +46,20 @@ 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_BUILD_TARGET=i686
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.

9 changes: 5 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 @@ -46,10 +46,10 @@ 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/
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++

# LLVM 17 needs cmake 3.20 or higher.
Expand All @@ -58,12 +58,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
29 changes: 0 additions & 29 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/build-zstd.sh

This file was deleted.

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
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -exu

source shared.sh

Expand Down Expand Up @@ -34,7 +34,7 @@ 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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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" ]]; 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
File renamed without changes.
File renamed without changes.

0 comments on commit 3afda7e

Please sign in to comment.