Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b4fab91

Browse files
committedDec 5, 2024
Auto merge of rust-lang#133906 - jhpratt:rollup-rj8matx, r=jhpratt
Rollup of 3 pull requests Successful merges: - rust-lang#133256 (CI: use free runners for i686-gnu jobs) - rust-lang#133632 (CI: split x86_64-msvc job) - rust-lang#133827 (CI: rfl: move job forward to Linux v6.13-rc1) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0e98766 + 89de4f9 commit b4fab91

File tree

6 files changed

+98
-35
lines changed

6 files changed

+98
-35
lines changed
 

‎src/bootstrap/mk/Makefile.in

+9-4
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,18 @@ tidy:
9797
prepare:
9898
$(Q)$(BOOTSTRAP) build --stage 2 --dry-run
9999

100+
STAGE_2_TEST_SET1 := test --stage 2 --skip=compiler --skip=src
101+
STAGE_2_TEST_SET2 := test --stage 2 --skip=tests --skip=coverage-map --skip=coverage-run --skip=library --skip=tidyselftest
102+
100103
## MSVC native builders
101104

105+
# Set of tests that should represent half of the time of the test suite.
106+
# Used to split tests across multiple CI runners.
102107
# this intentionally doesn't use `$(BOOTSTRAP)` so we can test the shebang on Windows
103108
ci-msvc-py:
104-
$(Q)$(CFG_SRC_DIR)/x.py test --stage 2 tidy
109+
$(Q)$(CFG_SRC_DIR)/x.py $(STAGE_2_TEST_SET1)
105110
ci-msvc-ps1:
106-
$(Q)$(CFG_SRC_DIR)/x.ps1 test --stage 2 --skip tidy
111+
$(Q)$(CFG_SRC_DIR)/x.ps1 $(STAGE_2_TEST_SET2)
107112
ci-msvc: ci-msvc-py ci-msvc-ps1
108113

109114
## MingW native builders
@@ -112,9 +117,9 @@ ci-msvc: ci-msvc-py ci-msvc-ps1
112117
# Used to split tests across multiple CI runners.
113118
# Test both x and bootstrap entrypoints.
114119
ci-mingw-x:
115-
$(Q)$(CFG_SRC_DIR)/x test --stage 2 --skip=compiler --skip=src
120+
$(Q)$(CFG_SRC_DIR)/x $(STAGE_2_TEST_SET1)
116121
ci-mingw-bootstrap:
117-
$(Q)$(BOOTSTRAP) test --stage 2 --skip=tests --skip=coverage-map --skip=coverage-run --skip=library --skip=tidyselftest
122+
$(Q)$(BOOTSTRAP) $(STAGE_2_TEST_SET2)
118123
ci-mingw: ci-mingw-x ci-mingw-bootstrap
119124

120125
.PHONY: dist

‎src/ci/docker/host-x86_64/i686-gnu-nopt/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ RUN echo "[rust]" > /config/nopt-std-config.toml
2727
RUN echo "optimize = false" >> /config/nopt-std-config.toml
2828

2929
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
30-
ENV SCRIPT python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std \
31-
&& python3 ../x.py --stage 2 test
30+
ARG SCRIPT_ARG
31+
ENV SCRIPT=${SCRIPT_ARG}

‎src/ci/docker/host-x86_64/i686-gnu/Dockerfile

+2-7
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,5 @@ COPY scripts/sccache.sh /scripts/
2424
RUN sh /scripts/sccache.sh
2525

2626
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
27-
# Skip some tests that are unlikely to be platform specific, to speed up
28-
# this slow job.
29-
ENV SCRIPT python3 ../x.py --stage 2 test \
30-
--skip src/bootstrap \
31-
--skip tests/rustdoc-js \
32-
--skip src/tools/error_index_generator \
33-
--skip src/tools/linkchecker
27+
ARG SCRIPT_ARG
28+
ENV SCRIPT=${SCRIPT_ARG}

‎src/ci/docker/run.sh

+22-13
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
105105
# It seems that it cannot be the same as $IMAGE_TAG, otherwise it overwrites the cache
106106
CACHE_IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci-cache:${cksum}
107107

108+
# Docker build arguments.
109+
build_args=(
110+
"build"
111+
"--rm"
112+
"-t" "rust-ci"
113+
"-f" "$dockerfile"
114+
"$context"
115+
)
116+
117+
# If the environment variable DOCKER_SCRIPT is defined,
118+
# set the build argument SCRIPT_ARG to DOCKER_SCRIPT.
119+
# In this way, we run the script defined in CI,
120+
# instead of the one defined in the Dockerfile.
121+
if [ -n "${DOCKER_SCRIPT+x}" ]; then
122+
build_args+=("--build-arg" "SCRIPT_ARG=${DOCKER_SCRIPT}")
123+
fi
124+
108125
# On non-CI jobs, we try to download a pre-built image from the rust-lang-ci
109126
# ghcr.io registry. If it is not possible, we fall back to building the image
110127
# locally.
@@ -115,7 +132,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
115132
docker tag "${IMAGE_TAG}" rust-ci
116133
else
117134
echo "Building local Docker image"
118-
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
135+
retry docker "${build_args[@]}"
119136
fi
120137
# On PR CI jobs, we don't have permissions to write to the registry cache,
121138
# but we can still read from it.
@@ -127,13 +144,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
127144
# Build the image using registry caching backend
128145
retry docker \
129146
buildx \
130-
build \
131-
--rm \
132-
-t rust-ci \
133-
-f "$dockerfile" \
147+
"${build_args[@]}" \
134148
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
135-
--output=type=docker \
136-
"$context"
149+
--output=type=docker
137150
# On auto/try builds, we can also write to the cache.
138151
else
139152
# Log into the Docker registry, so that we can read/write cache and the final image
@@ -147,14 +160,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
147160
# Build the image using registry caching backend
148161
retry docker \
149162
buildx \
150-
build \
151-
--rm \
152-
-t rust-ci \
153-
-f "$dockerfile" \
163+
"${build_args[@]}" \
154164
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
155165
--cache-to type=registry,ref=${CACHE_IMAGE_TAG},compression=zstd \
156-
--output=type=docker \
157-
"$context"
166+
--output=type=docker
158167

159168
# Print images for debugging purposes
160169
docker images

‎src/ci/docker/scripts/rfl-build.sh

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

33
set -euo pipefail
44

5-
LINUX_VERSION=28e848386b92645f93b9f2fdba5882c3ca7fb3e2
5+
LINUX_VERSION=v6.13-rc1
66

77
# Build rustc, rustdoc, cargo, clippy-driver and rustfmt
88
../x.py build --stage 2 library rustdoc clippy rustfmt
@@ -64,7 +64,7 @@ make -C linux LLVM=1 -j$(($(nproc) + 1)) \
6464

6565
BUILD_TARGETS="
6666
samples/rust/rust_minimal.o
67-
samples/rust/rust_print.o
67+
samples/rust/rust_print_main.o
6868
drivers/net/phy/ax88796b_rust.o
6969
rust/doctests_kernel_generated.o
7070
"

‎src/ci/github-actions/jobs.yml

+61-7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ envs:
5858
NO_DEBUG_ASSERTIONS: 1
5959
NO_OVERFLOW_CHECKS: 1
6060

61+
# Different set of tests to run tests in parallel in multiple jobs.
62+
stage_2_test_set1: &stage_2_test_set1
63+
DOCKER_SCRIPT: >-
64+
python3 ../x.py --stage 2 test
65+
--skip compiler
66+
--skip src
67+
68+
stage_2_test_set2: &stage_2_test_set2
69+
DOCKER_SCRIPT: >-
70+
python3 ../x.py --stage 2 test
71+
--skip tests
72+
--skip coverage-map
73+
--skip coverage-run
74+
--skip library
75+
--skip tidyselftest
76+
6177
production:
6278
&production
6379
DEPLOY_BUCKET: rust-lang-ci2
@@ -212,11 +228,42 @@ auto:
212228
- image: dist-x86_64-netbsd
213229
<<: *job-linux-4c
214230

215-
- image: i686-gnu
216-
<<: *job-linux-8c
231+
# The i686-gnu job is split into multiple jobs to run tests in parallel.
232+
# i686-gnu-1 skips tests that run in i686-gnu-2.
233+
- image: i686-gnu-1
234+
env:
235+
IMAGE: i686-gnu
236+
<<: *stage_2_test_set1
237+
<<: *job-linux-4c
217238

218-
- image: i686-gnu-nopt
219-
<<: *job-linux-8c
239+
# Skip tests that run in i686-gnu-1
240+
- image: i686-gnu-2
241+
env:
242+
IMAGE: i686-gnu
243+
<<: *stage_2_test_set2
244+
<<: *job-linux-4c
245+
246+
# The i686-gnu-nopt job is split into multiple jobs to run tests in parallel.
247+
# i686-gnu-nopt-1 skips tests that run in i686-gnu-nopt-2
248+
- image: i686-gnu-nopt-1
249+
env:
250+
IMAGE: i686-gnu-nopt
251+
<<: *stage_2_test_set1
252+
<<: *job-linux-4c
253+
254+
# Skip tests that run in i686-gnu-nopt-1
255+
- image: i686-gnu-nopt-2
256+
env:
257+
IMAGE: i686-gnu-nopt
258+
DOCKER_SCRIPT: >-
259+
python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std &&
260+
python3 ../x.py --stage 2 test
261+
--skip tests
262+
--skip coverage-map
263+
--skip coverage-run
264+
--skip library
265+
--skip tidyselftest
266+
<<: *job-linux-4c
220267

221268
- image: mingw-check
222269
<<: *job-linux-4c
@@ -373,11 +420,18 @@ auto:
373420
# Windows Builders #
374421
######################
375422

376-
- image: x86_64-msvc
423+
# x86_64-msvc is split into two jobs to run tests in parallel.
424+
- image: x86_64-msvc-1
377425
env:
378426
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
379-
SCRIPT: make ci-msvc
380-
<<: *job-windows-8c
427+
SCRIPT: make ci-msvc-py
428+
<<: *job-windows
429+
430+
- image: x86_64-msvc-2
431+
env:
432+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
433+
SCRIPT: make ci-msvc-ps1
434+
<<: *job-windows
381435

382436
- image: i686-msvc
383437
env:

0 commit comments

Comments
 (0)
Failed to load comments.