Skip to content

Commit 4f0e781

Browse files
committed
split better
1 parent e67e9b4 commit 4f0e781

File tree

5 files changed

+105
-9
lines changed

5 files changed

+105
-9
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ 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
6362
ARG SCRIPT_ARG
64-
ENV SCRIPT="/tmp/script.sh && ${SCRIPT_ARG}"
63+
COPY scripts/{SCRIPT_ARG} /tmp/script.sh
64+
ENV SCRIPT="/tmp/script.sh"

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ 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
6362
ARG SCRIPT_ARG
64-
ENV SCRIPT="/tmp/script.sh && ${SCRIPT_ARG}"
63+
COPY scripts/{SCRIPT_ARG} /tmp/script.sh
64+
ENV SCRIPT="/tmp/script.sh"
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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
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
24+
--skip tests
25+
--skip coverage-map
26+
--skip coverage-run
27+
--skip library
28+
--skip tidyselftest
29+
fi
30+
31+
../x.py --stage 2 test
32+
--skip tests
33+
--skip coverage-map
34+
--skip coverage-run
35+
--skip library
36+
--skip tidyselftest
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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
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
24+
--skip compiler
25+
--skip src
26+
27+
# Run the `mir-opt` tests again but this time for a 32-bit target.
28+
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
29+
# both 32-bit and 64-bit outputs updated by the PR author, before
30+
# the PR is approved and tested for merging.
31+
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
32+
# despite having different output on 32-bit vs 64-bit targets.
33+
../x.py --stage 1 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu
34+
35+
# Run `ui-fulldeps` in `--stage=1`, which actually uses the stage0
36+
# compiler, and is sensitive to the addition of new flags.
37+
../x.py --stage 1 test tests/ui-fulldeps
38+
39+
# Rebuild the stdlib with the size optimizations enabled and run tests again.
40+
RUSTFLAGS_NOT_BOOTSTRAP="--cfg feature=\"optimize_for_size\"" ../x.py --stage 1 test \
41+
library/std library/alloc library/core
42+
fi
43+
44+
../x.py --stage 2 test
45+
--skip compiler
46+
--skip src
47+
48+
# Run the `mir-opt` tests again but this time for a 32-bit target.
49+
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
50+
# both 32-bit and 64-bit outputs updated by the PR author, before
51+
# the PR is approved and tested for merging.
52+
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
53+
# despite having different output on 32-bit vs 64-bit targets.
54+
../x --stage 2 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu
55+
56+
# Run the UI test suite again, but in `--pass=check` mode
57+
#
58+
# This is intended to make sure that both `--pass=check` continues to
59+
# work.
60+
../x.ps1 --stage 2 test tests/ui --pass=check --host='' --target=i686-unknown-linux-gnu

src/ci/github-actions/jobs.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,7 +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: python3 ../x.py --stage 2 test --skip src/tools/tidy
120+
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
121121
<<: *job-linux-16c
122122
- image: x86_64-gnu-tools
123123
<<: *job-linux-16c
@@ -319,15 +319,15 @@ auto:
319319
env:
320320
RUST_BACKTRACE: 1
321321
IMAGE: x86_64-gnu-llvm-19
322-
<<: *stage_2_test_set1
322+
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
323323
<<: *job-linux-4c
324324

325325
# Skip tests that run in x86_64-gnu-llvm-19-2
326326
- image: x86_64-gnu-llvm-19-2
327327
env:
328328
RUST_BACKTRACE: 1
329329
IMAGE: x86_64-gnu-llvm-19
330-
<<: *stage_2_test_set2
330+
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
331331
<<: *job-linux-4c
332332

333333
# The x86_64-gnu-llvm-18 job is split into multiple jobs to run tests in parallel.
@@ -337,7 +337,7 @@ auto:
337337
RUST_BACKTRACE: 1
338338
READ_ONLY_SRC: "0"
339339
IMAGE: x86_64-gnu-llvm-18
340-
<<: *stage_2_test_set1
340+
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
341341
<<: *job-linux-4c
342342

343343
# Skip tests that run in x86_64-gnu-llvm-18-2
@@ -346,7 +346,7 @@ auto:
346346
RUST_BACKTRACE: 1
347347
READ_ONLY_SRC: "0"
348348
IMAGE: x86_64-gnu-llvm-18
349-
<<: *stage_2_test_set2
349+
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
350350
<<: *job-linux-4c
351351

352352
- image: x86_64-gnu-nopt

0 commit comments

Comments
 (0)