about summary refs log tree commit diff
path: root/src/ci/docker
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-26 03:04:21 +0000
committerbors <bors@rust-lang.org>2025-02-26 03:04:21 +0000
commita46c755c6ad2c9543a836a1ca134178b2345acc2 (patch)
treeda84b18922c2cec9a9176b540106a8969f78c266 /src/ci/docker
parentcb06d12710575a0d7ff71d6fe108f3bcff4f9195 (diff)
parentba7d5d11ae50554a56a789dbe7a5e8cf08d42c3c (diff)
downloadrust-a46c755c6ad2c9543a836a1ca134178b2345acc2.tar.gz
rust-a46c755c6ad2c9543a836a1ca134178b2345acc2.zip
Auto merge of #136921 - Kobzol:gcc-build, r=onur-ozkan
Build GCC on CI

Previously, we have downloaded a specific commit of GCC and prebuilt it inside Docker using the `build-gccjit.sh` script. This PR removes that scripts and uses the bootstrap GCC step. This allows us to use the `src/gcc` submodule for determining which GCC should be built, and it also moves the logic closer to LLVM, which is also built by bootstrap.

A few things to note:
- The `sccache` option is currently in the `llvm` block, so the GCC build uses `llvm.ccache`, which is a bit weird :) We could either add `gcc.ccache`, or (what I think would be better) to just move `ccache` to the `build` section, as I don't think that it will be necessary to use ccache for LLVM, but not for GCC.
- When the GCC codegen backend is built, it needs to depend on a step that first builds GCC. This is currently done in a hacky way. The proper solution is to create a separate step for the GCC codegen backend, but that is a larger change. Let me know what you think.

r? `@onur-ozkan`

try-job: i686-msvc-1
try-job: x86_64-mingw-1
Diffstat (limited to 'src/ci/docker')
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile4
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile3
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile3
-rwxr-xr-xsrc/ci/docker/scripts/build-gccjit.sh37
4 files changed, 1 insertions, 46 deletions
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile
index 0a58f337d9d..aefc0f376f6 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile
@@ -3,6 +3,7 @@ FROM ubuntu:24.04
 ARG DEBIAN_FRONTEND=noninteractive
 
 RUN apt-get update && apt-get install -y --no-install-recommends \
+  bzip2 \
   g++ \
   gcc-multilib \
   make \
@@ -55,9 +56,6 @@ ENV RUST_CONFIGURE_ARGS \
       --set rust.thin-lto-import-instr-limit=10
 
 COPY scripts/shared.sh /scripts/
-COPY scripts/build-gccjit.sh /scripts/
-
-RUN /scripts/build-gccjit.sh /scripts
 
 ARG SCRIPT_ARG
 
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile
index 092847cdfe0..e0ed2e227f8 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile
@@ -55,9 +55,6 @@ ENV RUST_CONFIGURE_ARGS \
       --set rust.thin-lto-import-instr-limit=10
 
 COPY scripts/shared.sh /scripts/
-COPY scripts/build-gccjit.sh /scripts/
-
-RUN /scripts/build-gccjit.sh /scripts
 
 ARG SCRIPT_ARG
 
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
index ab749b3fdd5..89806634c6c 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
@@ -90,9 +90,6 @@ ENV HOST_TARGET x86_64-unknown-linux-gnu
 #ENV FORCE_CI_RUSTC 1
 
 COPY scripts/shared.sh /scripts/
-COPY scripts/build-gccjit.sh /scripts/
-
-RUN /scripts/build-gccjit.sh /scripts
 
 # For now, we need to use `--unsafe-perm=true` to go around an issue when npm tries
 # to create a new folder. For reference:
diff --git a/src/ci/docker/scripts/build-gccjit.sh b/src/ci/docker/scripts/build-gccjit.sh
deleted file mode 100755
index 43ed2270d31..00000000000
--- a/src/ci/docker/scripts/build-gccjit.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-
-GIT_REPO="https://github.com/rust-lang/gcc"
-
-# This commit hash needs to be updated to use a more recent gcc fork version.
-GIT_COMMIT="45648c2edd4ecd862d9f08196d3d6c6ccba79f07"
-
-set -ex
-
-cd $1
-
-source shared.sh
-
-# Setting up folders for GCC
-curl -L "$GIT_REPO/archive/$GIT_COMMIT.tar.gz" |
-    tar -xz --transform "s/gcc-$GIT_COMMIT/gcc-src/"
-
-mkdir gcc-build gcc-install
-pushd gcc-build
-
-# Building GCC.
-hide_output \
-  ../gcc-src/configure \
-    --enable-host-shared \
-    --enable-languages=jit \
-    --enable-checking=release \
-    --disable-bootstrap \
-    --disable-multilib \
-    --prefix=$(pwd)/../gcc-install \
-
-hide_output make -j$(nproc)
-hide_output make install
-
-popd
-rm -rf gcc-src gcc-build
-ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
-ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so.0