Skip to content

Rollup of 3 pull requests #133906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,18 @@ tidy:
prepare:
$(Q)$(BOOTSTRAP) build --stage 2 --dry-run

STAGE_2_TEST_SET1 := test --stage 2 --skip=compiler --skip=src
STAGE_2_TEST_SET2 := test --stage 2 --skip=tests --skip=coverage-map --skip=coverage-run --skip=library --skip=tidyselftest

## MSVC native builders

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

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

.PHONY: dist
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/i686-gnu-nopt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ RUN echo "[rust]" > /config/nopt-std-config.toml
RUN echo "optimize = false" >> /config/nopt-std-config.toml

ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
ENV SCRIPT python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std \
&& python3 ../x.py --stage 2 test
ARG SCRIPT_ARG
ENV SCRIPT=${SCRIPT_ARG}
9 changes: 2 additions & 7 deletions src/ci/docker/host-x86_64/i686-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
# Skip some tests that are unlikely to be platform specific, to speed up
# this slow job.
ENV SCRIPT python3 ../x.py --stage 2 test \
--skip src/bootstrap \
--skip tests/rustdoc-js \
--skip src/tools/error_index_generator \
--skip src/tools/linkchecker
ARG SCRIPT_ARG
ENV SCRIPT=${SCRIPT_ARG}
35 changes: 22 additions & 13 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# It seems that it cannot be the same as $IMAGE_TAG, otherwise it overwrites the cache
CACHE_IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci-cache:${cksum}

# Docker build arguments.
build_args=(
"build"
"--rm"
"-t" "rust-ci"
"-f" "$dockerfile"
"$context"
)

# If the environment variable DOCKER_SCRIPT is defined,
# set the build argument SCRIPT_ARG to DOCKER_SCRIPT.
# In this way, we run the script defined in CI,
# instead of the one defined in the Dockerfile.
if [ -n "${DOCKER_SCRIPT+x}" ]; then
build_args+=("--build-arg" "SCRIPT_ARG=${DOCKER_SCRIPT}")
fi

# On non-CI jobs, we try to download a pre-built image from the rust-lang-ci
# ghcr.io registry. If it is not possible, we fall back to building the image
# locally.
Expand All @@ -115,7 +132,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
docker tag "${IMAGE_TAG}" rust-ci
else
echo "Building local Docker image"
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
retry docker "${build_args[@]}"
fi
# On PR CI jobs, we don't have permissions to write to the registry cache,
# but we can still read from it.
Expand All @@ -127,13 +144,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# Build the image using registry caching backend
retry docker \
buildx \
build \
--rm \
-t rust-ci \
-f "$dockerfile" \
"${build_args[@]}" \
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
--output=type=docker \
"$context"
--output=type=docker
# On auto/try builds, we can also write to the cache.
else
# Log into the Docker registry, so that we can read/write cache and the final image
Expand All @@ -147,14 +160,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
# Build the image using registry caching backend
retry docker \
buildx \
build \
--rm \
-t rust-ci \
-f "$dockerfile" \
"${build_args[@]}" \
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
--cache-to type=registry,ref=${CACHE_IMAGE_TAG},compression=zstd \
--output=type=docker \
"$context"
--output=type=docker

# Print images for debugging purposes
docker images
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/scripts/rfl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

LINUX_VERSION=28e848386b92645f93b9f2fdba5882c3ca7fb3e2
LINUX_VERSION=v6.13-rc1

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

BUILD_TARGETS="
samples/rust/rust_minimal.o
samples/rust/rust_print.o
samples/rust/rust_print_main.o
drivers/net/phy/ax88796b_rust.o
rust/doctests_kernel_generated.o
"
Expand Down
68 changes: 61 additions & 7 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ envs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1

# Different set of tests to run tests in parallel in multiple jobs.
stage_2_test_set1: &stage_2_test_set1
DOCKER_SCRIPT: >-
python3 ../x.py --stage 2 test
--skip compiler
--skip src

stage_2_test_set2: &stage_2_test_set2
DOCKER_SCRIPT: >-
python3 ../x.py --stage 2 test
--skip tests
--skip coverage-map
--skip coverage-run
--skip library
--skip tidyselftest

production:
&production
DEPLOY_BUCKET: rust-lang-ci2
Expand Down Expand Up @@ -212,11 +228,42 @@ auto:
- image: dist-x86_64-netbsd
<<: *job-linux-4c

- image: i686-gnu
<<: *job-linux-8c
# The i686-gnu job is split into multiple jobs to run tests in parallel.
# i686-gnu-1 skips tests that run in i686-gnu-2.
- image: i686-gnu-1
env:
IMAGE: i686-gnu
<<: *stage_2_test_set1
<<: *job-linux-4c

- image: i686-gnu-nopt
<<: *job-linux-8c
# Skip tests that run in i686-gnu-1
- image: i686-gnu-2
env:
IMAGE: i686-gnu
<<: *stage_2_test_set2
<<: *job-linux-4c

# The i686-gnu-nopt job is split into multiple jobs to run tests in parallel.
# i686-gnu-nopt-1 skips tests that run in i686-gnu-nopt-2
- image: i686-gnu-nopt-1
env:
IMAGE: i686-gnu-nopt
<<: *stage_2_test_set1
<<: *job-linux-4c

# Skip tests that run in i686-gnu-nopt-1
- image: i686-gnu-nopt-2
env:
IMAGE: i686-gnu-nopt
DOCKER_SCRIPT: >-
python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std &&
python3 ../x.py --stage 2 test
--skip tests
--skip coverage-map
--skip coverage-run
--skip library
--skip tidyselftest
<<: *job-linux-4c

- image: mingw-check
<<: *job-linux-4c
Expand Down Expand Up @@ -373,11 +420,18 @@ auto:
# Windows Builders #
######################

- image: x86_64-msvc
# x86_64-msvc is split into two jobs to run tests in parallel.
- image: x86_64-msvc-1
env:
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
SCRIPT: make ci-msvc
<<: *job-windows-8c
SCRIPT: make ci-msvc-py
<<: *job-windows

- image: x86_64-msvc-2
env:
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
SCRIPT: make ci-msvc-ps1
<<: *job-windows

- image: i686-msvc
env:
Expand Down
Loading