Skip to content

Commit 7ce2944

Browse files
committed
test stage 1 in separate job
1 parent 1f38572 commit 7ce2944

File tree

5 files changed

+60
-58
lines changed

5 files changed

+60
-58
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,6 @@ if [ "$READ_ONLY_SRC" = "0" ]; then
1818
git reset --hard HEAD~1
1919
fi
2020

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
41-
4221
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
4322
../x.py --stage 2 test --skip src/tools/tidy
4423

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ if [ "$READ_ONLY_SRC" = "0" ]; then
1818
git reset --hard HEAD~1
1919
fi
2020

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-
3121
../x.py --stage 2 test \
3222
--skip tests \
3323
--skip coverage-map \

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,6 @@ if [ "$READ_ONLY_SRC" = "0" ]; then
1818
git reset --hard HEAD~1
1919
fi
2020

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-
4421
../x.py --stage 2 test \
4522
--skip compiler \
4623
--skip src
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 "[email protected]"
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+
##### Test stage 1 #####
22+
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

src/ci/github-actions/jobs.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,24 +314,32 @@ auto:
314314
<<: *job-linux-8c
315315

316316
# 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.
317+
# x86_64-gnu-llvm-19-1 skips tests that run in x86_64-gnu-llvm-19-{2,3}.
318318
- image: x86_64-gnu-llvm-19-1
319319
env:
320320
RUST_BACKTRACE: 1
321321
IMAGE: x86_64-gnu-llvm-19
322322
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
323323
<<: *job-linux-4c
324324

325-
# Skip tests that run in x86_64-gnu-llvm-19-2
325+
# Skip tests that run in x86_64-gnu-llvm-19-{1,3}
326326
- image: x86_64-gnu-llvm-19-2
327327
env:
328328
RUST_BACKTRACE: 1
329329
IMAGE: x86_64-gnu-llvm-19
330330
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
331331
<<: *job-linux-4c
332332

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+
333341
# The x86_64-gnu-llvm-18 job is split into multiple jobs to run tests in parallel.
334-
# x86_64-gnu-llvm-18-1 skips tests that run in x86_64-gnu-llvm-18-2.
342+
# x86_64-gnu-llvm-18-1 skips tests that run in x86_64-gnu-llvm-18-{2,3}.
335343
- image: x86_64-gnu-llvm-18-1
336344
env:
337345
RUST_BACKTRACE: 1
@@ -340,7 +348,7 @@ auto:
340348
DOCKER_SCRIPT: x86_64-gnu-llvm1.sh
341349
<<: *job-linux-4c
342350

343-
# Skip tests that run in x86_64-gnu-llvm-18-2
351+
# Skip tests that run in x86_64-gnu-llvm-18-{1,3}
344352
- image: x86_64-gnu-llvm-18-2
345353
env:
346354
RUST_BACKTRACE: 1
@@ -349,6 +357,15 @@ auto:
349357
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
350358
<<: *job-linux-4c
351359

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
368+
352369
- image: x86_64-gnu-nopt
353370
<<: *job-linux-4c
354371

0 commit comments

Comments
 (0)