Skip to content

Commit 3afda7e

Browse files
mrkajetanpdavidtwco
authored andcommitted
ci: Organise shared helper scripts
Move shared helper scripts used by Docker builds under docker/scripts.
1 parent 8857b84 commit 3afda7e

File tree

17 files changed

+31
-199
lines changed

17 files changed

+31
-199
lines changed

Diff for: src/ci/docker/host-aarch64/dist-aarch64-linux/Dockerfile

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
4343
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
4444
WORKDIR /tmp
4545
RUN mkdir /home/user
46-
COPY host-aarch64/dist-aarch64-linux/shared.sh /tmp/
46+
COPY scripts/shared.sh /tmp/
4747

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

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

5858
# Build LLVM+Clang
59-
COPY host-aarch64/dist-aarch64-linux/build-clang.sh /tmp/
59+
COPY scripts/build-clang.sh /tmp/
60+
ENV LLVM_BUILD_TARGETS=AArch64
6061
RUN ./build-clang.sh
6162
ENV CC=clang CXX=clang++
6263

6364
# Build zstd to enable `llvm.libzstd`.
64-
COPY host-aarch64/dist-aarch64-linux/build-zstd.sh /tmp/
65+
COPY scripts/build-zstd.sh /tmp/
6566
RUN ./build-zstd.sh
6667

6768
COPY scripts/sccache.sh /scripts/
@@ -82,7 +83,7 @@ ENV RUST_CONFIGURE_ARGS \
8283
--set target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
8384
--set target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
8485
--set llvm.link-shared=true \
85-
--set llvm.thin-lto=false \
86+
--set llvm.thin-lto=true \
8687
--set llvm.libzstd=true \
8788
--set llvm.ninja=false \
8889
--set rust.debug-assertions=false \

Diff for: src/ci/docker/host-aarch64/dist-aarch64-linux/build-clang.sh

-46
This file was deleted.

Diff for: src/ci/docker/host-aarch64/dist-aarch64-linux/build-gcc.sh

-51
This file was deleted.

Diff for: src/ci/docker/host-aarch64/dist-aarch64-linux/shared.sh

-16
This file was deleted.

Diff for: src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
4646
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
4747
WORKDIR /tmp
4848
RUN mkdir /home/user
49-
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
49+
COPY scripts/shared.sh /tmp/
5050

5151
# Need at least GCC 5.1 to compile LLVM nowadays
52-
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
52+
COPY scripts/build-gcc.sh /tmp/
53+
ENV GCC_BUILD_TARGET=i686
5354
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
5455

5556
COPY scripts/cmake.sh /tmp/
5657
RUN ./cmake.sh
5758

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

Diff for: src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN /scripts/crosstool-ng-build.sh
1818
WORKDIR /build
1919

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

2424
COPY scripts/sccache.sh /scripts/

Diff for: src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh

-16
This file was deleted.

Diff for: src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
4646
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
4747
WORKDIR /tmp
4848
RUN mkdir /home/user
49-
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
49+
COPY scripts/shared.sh /tmp/
5050

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

5555
# LLVM 17 needs cmake 3.20 or higher.
@@ -58,12 +58,13 @@ RUN ./cmake.sh
5858

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

6566
# Build zstd to enable `llvm.libzstd`.
66-
COPY host-x86_64/dist-x86_64-linux/build-zstd.sh /tmp/
67+
COPY scripts/build-zstd.sh /tmp/
6768
RUN ./build-zstd.sh
6869

6970
COPY scripts/sccache.sh /scripts/

Diff for: src/ci/docker/host-x86_64/dist-x86_64-linux/build-zstd.sh

-29
This file was deleted.

Diff for: src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh

-16
This file was deleted.

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
5454
--set rust.randomize-layout=true \
5555
--set rust.thin-lto-import-instr-limit=10
5656

57-
COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
58-
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
57+
COPY scripts/shared.sh /scripts/
58+
COPY scripts/build-gccjit.sh /scripts/
5959

6060
RUN /scripts/build-gccjit.sh /scripts
6161

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
5454
--set rust.randomize-layout=true \
5555
--set rust.thin-lto-import-instr-limit=10
5656

57-
COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
58-
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
57+
COPY scripts/shared.sh /scripts/
58+
COPY scripts/build-gccjit.sh /scripts/
5959

6060
RUN /scripts/build-gccjit.sh /scripts
6161

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ ENV HOST_TARGET x86_64-unknown-linux-gnu
8989
# assertions enabled! Therefore, we cannot force download CI rustc.
9090
#ENV FORCE_CI_RUSTC 1
9191

92-
COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
93-
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
92+
COPY scripts/shared.sh /scripts/
93+
COPY scripts/build-gccjit.sh /scripts/
9494

9595
RUN /scripts/build-gccjit.sh /scripts
9696

Diff for: src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh renamed to src/ci/docker/scripts/build-clang.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -exu
44

55
source shared.sh
66

@@ -34,7 +34,7 @@ hide_output \
3434
-DCOMPILER_RT_BUILD_XRAY=OFF \
3535
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
3636
-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF \
37-
-DLLVM_TARGETS_TO_BUILD=X86 \
37+
-DLLVM_TARGETS_TO_BUILD=$LLVM_BUILD_TARGETS \
3838
-DLLVM_INCLUDE_BENCHMARKS=OFF \
3939
-DLLVM_INCLUDE_TESTS=OFF \
4040
-DLLVM_INCLUDE_EXAMPLES=OFF \

Diff for: src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh renamed to src/ci/docker/scripts/build-gcc.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ cd ..
5050
rm -rf gcc-build
5151
rm -rf gcc-$GCC
5252

53-
# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
54-
# but it does look all the way under /rustroot/lib/[...]/32,
55-
# so we can link stuff there to help it out.
56-
ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/
53+
if [[ $GCC_BUILD_TARGET == "i686" ]]; then
54+
# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib,
55+
# but it does look all the way under /rustroot/lib/[...]/32,
56+
# so we can link stuff there to help it out.
57+
ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/
58+
fi

0 commit comments

Comments
 (0)