From 287e458daed03604799ba5e5493286388dc403cc Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 10 Sep 2025 16:41:09 +0200 Subject: [PATCH] Run rust tests with GCC backend --- .../host-x86_64/x86_64-gnu-gcc/Dockerfile | 45 +++++++++++++++++++ src/ci/github-actions/jobs.yml | 7 +++ src/ci/run.sh | 4 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile new file mode 100644 index 000000000000..961e9dc473cb --- /dev/null +++ b/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + g++ \ + make \ + ninja-build \ + file \ + curl \ + ca-certificates \ + python3 \ + git \ + cmake \ + sudo \ + gdb \ + libssl-dev \ + pkg-config \ + xz-utils \ + mingw-w64 \ + zlib1g-dev \ + libzstd-dev \ + # libgccjit dependencies + flex \ + libmpfr-dev \ + libgmp-dev \ + libmpc3 \ + libmpc-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +ENV RUST_CONFIGURE_ARGS \ + --build=x86_64-unknown-linux-gnu \ + --enable-sanitizers \ + --enable-profiler \ + --enable-compiler-docs \ + --set llvm.libzstd=true \ + --set 'rust.codegen-backends=[\"llvm\",\"gcc\"]' +ENV SCRIPT python3 ../x.py \ + --stage 2 \ + test \ + --test-codegen-backend gcc \ + --set 'rust.codegen-backends=[\"llvm\",\"gcc\"]' diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 4384ec767697..eeef94483fda 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -141,6 +141,9 @@ pr: <<: *job-linux-4c - name: x86_64-gnu-miri <<: *job-linux-4c + - name: x86_64-gnu-gcc + doc_url: https://rustc-dev-guide.rust-lang.org/tests/codegen-backend-tests/cg_gcc.html + <<: *job-linux-4c # Jobs that run when you perform a try build (@bors try) # These jobs automatically inherit envs.try, to avoid repeating @@ -348,6 +351,10 @@ auto: - name: x86_64-gnu <<: *job-linux-4c + - name: x86_64-gnu-gcc + doc_url: https://rustc-dev-guide.rust-lang.org/tests/codegen-backend-tests/cg_gcc.html + <<: *job-linux-4c + # This job ensures commits landing on nightly still pass the full # test suite on the stable channel. There are some UI tests that # depend on the channel being built (for example if they include the diff --git a/src/ci/run.sh b/src/ci/run.sh index c9d81f1ff510..c892f157bcc2 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -188,7 +188,9 @@ else fi # Download GCC from CI on test builders - RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set gcc.download-ci-gcc=true" + # FIXME: Temporarily commented out until the GCC build/download strategy is cleared out or + # made dependent on GCC submodule changes. + # RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set gcc.download-ci-gcc=true" # download-rustc seems to be broken on CI after the stage0 redesign # Disable it until these issues are debugged and resolved