Skip to content

Commit b9306da

Browse files
committed
Auto merge of #134124 - MarcoIeni:split-llvm-jobs, r=<try>
CI: use free runners for x86_64-gnu-llvm jobs try-job: x86_64-gnu-llvm-19-1 try-job: x86_64-gnu-llvm-19-2 try-job: x86_64-gnu-llvm-19-3 try-job: x86_64-gnu-llvm-18-1 try-job: x86_64-gnu-llvm-18-2 try-job: x86_64-gnu-llvm-18-3
2 parents a94fce9 + ac078a4 commit b9306da

File tree

8 files changed

+143
-44
lines changed

8 files changed

+143
-44
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,10 @@ COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
5959

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

62-
COPY scripts/x86_64-gnu-llvm.sh /tmp/script.sh
63-
ENV SCRIPT /tmp/script.sh
62+
ARG SCRIPT_ARG
63+
COPY scripts/add_dummy_commit.sh /tmp/add_dummy_commit.sh
64+
COPY scripts/x86_64-gnu-llvm.sh /tmp/x86_64-gnu-llvm.sh
65+
COPY scripts/x86_64-gnu-llvm1.sh /tmp/x86_64-gnu-llvm1.sh
66+
COPY scripts/x86_64-gnu-llvm2.sh /tmp/x86_64-gnu-llvm2.sh
67+
COPY scripts/x86_64-gnu-llvm3.sh /tmp/x86_64-gnu-llvm3.sh
68+
ENV SCRIPT /tmp/${SCRIPT_ARG}

src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,10 @@ COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
5959

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

62-
COPY scripts/x86_64-gnu-llvm.sh /tmp/script.sh
63-
ENV SCRIPT /tmp/script.sh
62+
ARG SCRIPT_ARG
63+
COPY scripts/add_dummy_commit.sh /tmp/add_dummy_commit.sh
64+
COPY scripts/x86_64-gnu-llvm.sh /tmp/x86_64-gnu-llvm.sh
65+
COPY scripts/x86_64-gnu-llvm1.sh /tmp/x86_64-gnu-llvm1.sh
66+
COPY scripts/x86_64-gnu-llvm2.sh /tmp/x86_64-gnu-llvm2.sh
67+
COPY scripts/x86_64-gnu-llvm3.sh /tmp/x86_64-gnu-llvm3.sh
68+
ENV SCRIPT /tmp/${SCRIPT_ARG}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ "$READ_ONLY_SRC" = "0" ]; then
6+
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7+
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8+
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9+
# that test to make sure we never download CI rustc with a change on the compiler tree.
10+
echo "" >> ../compiler/rustc/src/main.rs
11+
git config --global user.email "dummy@dummy.com"
12+
git config --global user.name "dummy"
13+
git add ../compiler/rustc/src/main.rs
14+
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15+
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16+
-- core::builder::tests::ci_rustc_if_unchanged_logic
17+
# Revert the dummy commit
18+
git reset --hard HEAD~1
19+
fi

src/ci/docker/scripts/x86_64-gnu-llvm.sh

+1-36
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,7 @@
22

33
set -ex
44

5-
if [ "$READ_ONLY_SRC" = "0" ]; then
6-
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7-
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8-
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9-
# that test to make sure we never download CI rustc with a change on the compiler tree.
10-
echo "" >> ../compiler/rustc/src/main.rs
11-
git config --global user.email "dummy@dummy.com"
12-
git config --global user.name "dummy"
13-
git add ../compiler/rustc/src/main.rs
14-
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15-
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16-
-- core::builder::tests::ci_rustc_if_unchanged_logic
17-
# Revert the dummy commit
18-
git reset --hard HEAD~1
19-
fi
20-
21-
# Only run the stage 1 tests on merges, not on PR CI jobs.
22-
if [[ -z "${PR_CI_JOB}" ]]; then
23-
../x.py --stage 1 test --skip src/tools/tidy
24-
25-
# Run the `mir-opt` tests again but this time for a 32-bit target.
26-
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
27-
# both 32-bit and 64-bit outputs updated by the PR author, before
28-
# the PR is approved and tested for merging.
29-
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
30-
# despite having different output on 32-bit vs 64-bit targets.
31-
../x.py --stage 1 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu
32-
33-
# Run `ui-fulldeps` in `--stage=1`, which actually uses the stage0
34-
# compiler, and is sensitive to the addition of new flags.
35-
../x.py --stage 1 test tests/ui-fulldeps
36-
37-
# Rebuild the stdlib with the size optimizations enabled and run tests again.
38-
RUSTFLAGS_NOT_BOOTSTRAP="--cfg feature=\"optimize_for_size\"" ../x.py --stage 1 test \
39-
library/std library/alloc library/core
40-
fi
5+
/tmp/add_dummy_commit.sh
416

427
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
438
../x.py --stage 2 test --skip src/tools/tidy
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
/tmp/add_dummy_commit.sh
6+
7+
../x.py --stage 2 test \
8+
--skip tests \
9+
--skip coverage-map \
10+
--skip coverage-run \
11+
--skip library \
12+
--skip tidyselftest
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
/tmp/add_dummy_commit.sh
6+
7+
##### Test stage 2 #####
8+
9+
../x.py --stage 2 test \
10+
--skip compiler \
11+
--skip src
12+
13+
# Run the `mir-opt` tests again but this time for a 32-bit target.
14+
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
15+
# both 32-bit and 64-bit outputs updated by the PR author, before
16+
# the PR is approved and tested for merging.
17+
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
18+
# despite having different output on 32-bit vs 64-bit targets.
19+
../x --stage 2 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu
20+
21+
# Run the UI test suite again, but in `--pass=check` mode
22+
#
23+
# This is intended to make sure that both `--pass=check` continues to
24+
# work.
25+
../x.ps1 --stage 2 test tests/ui --pass=check --host='' --target=i686-unknown-linux-gnu
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
/tmp/add_dummy_commit.sh
6+
7+
##### Test stage 1 #####
8+
9+
../x.py --stage 1 test --skip src/tools/tidy
10+
11+
# Run the `mir-opt` tests again but this time for a 32-bit target.
12+
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
13+
# both 32-bit and 64-bit outputs updated by the PR author, before
14+
# the PR is approved and tested for merging.
15+
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
16+
# despite having different output on 32-bit vs 64-bit targets.
17+
../x.py --stage 1 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu
18+
19+
# Run `ui-fulldeps` in `--stage=1`, which actually uses the stage0
20+
# compiler, and is sensitive to the addition of new flags.
21+
../x.py --stage 1 test tests/ui-fulldeps
22+
23+
# Rebuild the stdlib with the size optimizations enabled and run tests again.
24+
RUSTFLAGS_NOT_BOOTSTRAP="--cfg feature=\"optimize_for_size\"" ../x.py --stage 1 test \
25+
library/std library/alloc library/core

src/ci/github-actions/jobs.yml

+47-4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pr:
117117
ENABLE_GCC_CODEGEN: "1"
118118
# We are adding (temporarily) a dummy commit on the compiler
119119
READ_ONLY_SRC: "0"
120+
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
120121
<<: *job-linux-16c
121122
- image: x86_64-gnu-tools
122123
<<: *job-linux-16c
@@ -312,16 +313,58 @@ auto:
312313
- image: x86_64-gnu-distcheck
313314
<<: *job-linux-8c
314315

315-
- image: x86_64-gnu-llvm-19
316+
# The x86_64-gnu-llvm-19 job is split into multiple jobs to run tests in parallel.
317+
# x86_64-gnu-llvm-19-1 skips tests that run in x86_64-gnu-llvm-19-{2,3}.
318+
- image: x86_64-gnu-llvm-19-1
316319
env:
317320
RUST_BACKTRACE: 1
318-
<<: *job-linux-8c
321+
IMAGE: x86_64-gnu-llvm-19
322+
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
323+
<<: *job-linux-4c
319324

320-
- image: x86_64-gnu-llvm-18
325+
# Skip tests that run in x86_64-gnu-llvm-19-{1,3}
326+
- image: x86_64-gnu-llvm-19-2
327+
env:
328+
RUST_BACKTRACE: 1
329+
IMAGE: x86_64-gnu-llvm-19
330+
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
331+
<<: *job-linux-4c
332+
333+
# Skip tests that run in x86_64-gnu-llvm-19-{1,2}
334+
- image: x86_64-gnu-llvm-19-3
335+
env:
336+
RUST_BACKTRACE: 1
337+
IMAGE: x86_64-gnu-llvm-19
338+
DOCKER_SCRIPT: x86_64-gnu-llvm3.sh
339+
<<: *job-linux-4c
340+
341+
# The x86_64-gnu-llvm-18 job is split into multiple jobs to run tests in parallel.
342+
# x86_64-gnu-llvm-18-1 skips tests that run in x86_64-gnu-llvm-18-{2,3}.
343+
- image: x86_64-gnu-llvm-18-1
321344
env:
322345
RUST_BACKTRACE: 1
323346
READ_ONLY_SRC: "0"
324-
<<: *job-linux-8c
347+
IMAGE: x86_64-gnu-llvm-18
348+
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
349+
<<: *job-linux-4c
350+
351+
# Skip tests that run in x86_64-gnu-llvm-18-{1,3}
352+
- image: x86_64-gnu-llvm-18-2
353+
env:
354+
RUST_BACKTRACE: 1
355+
READ_ONLY_SRC: "0"
356+
IMAGE: x86_64-gnu-llvm-18
357+
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
358+
<<: *job-linux-4c
359+
360+
# Skip tests that run in x86_64-gnu-llvm-18-{1,2}
361+
- image: x86_64-gnu-llvm-18-3
362+
env:
363+
RUST_BACKTRACE: 1
364+
READ_ONLY_SRC: "0"
365+
IMAGE: x86_64-gnu-llvm-18
366+
DOCKER_SCRIPT: x86_64-gnu-llvm3.sh
367+
<<: *job-linux-4c
325368

326369
- image: x86_64-gnu-nopt
327370
<<: *job-linux-4c

0 commit comments

Comments
 (0)