Skip to content

Commit 55e2f41

Browse files
authored
Unrolled build for rust-lang#128928
Rollup merge of rust-lang#128928 - ojeda:ci-rfl-more-tools, r=Kobzol CI: rfl: add more tools and steps This will add some time for the tool building -- the actual steps should be quick, though, and allows us to cover quite a few more tools and unstable features in use. Please see the individual commits for a few details. Cc: `@GuillaumeGomez` `@tgross35` r? `@Kobzol` try-job: x86_64-rust-for-linux
2 parents 009e738 + 778ff06 commit 55e2f41

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

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

+43-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -euo pipefail
44

55
LINUX_VERSION=4c7864e81d8bbd51036dacf92fb0a400e13aaeee
66

7-
# Build rustc, rustdoc and cargo
8-
../x.py build --stage 1 library rustdoc
7+
# Build rustc, rustdoc, cargo, clippy-driver and rustfmt
8+
../x.py build --stage 2 library rustdoc clippy rustfmt
99
../x.py build --stage 0 cargo
1010

1111
# Install rustup so that we can use the built toolchain easily, and also
@@ -16,7 +16,7 @@ sh rustup.sh -y --default-toolchain none
1616
source /cargo/env
1717

1818
BUILD_DIR=$(realpath ./build)
19-
rustup toolchain link local "${BUILD_DIR}"/x86_64-unknown-linux-gnu/stage1
19+
rustup toolchain link local "${BUILD_DIR}"/x86_64-unknown-linux-gnu/stage2
2020
rustup default local
2121

2222
mkdir -p rfl
@@ -62,11 +62,47 @@ make -C linux LLVM=1 -j$(($(nproc) + 1)) \
6262
defconfig \
6363
rfl-for-rust-ci.config
6464

65-
make -C linux LLVM=1 -j$(($(nproc) + 1)) \
66-
samples/rust/rust_minimal.o \
67-
samples/rust/rust_print.o \
68-
drivers/net/phy/ax88796b_rust.o \
65+
BUILD_TARGETS="
66+
samples/rust/rust_minimal.o
67+
samples/rust/rust_print.o
68+
drivers/net/phy/ax88796b_rust.o
6969
rust/doctests_kernel_generated.o
70+
"
71+
72+
# Build a few Rust targets
73+
#
74+
# This does not include building the C side of the kernel nor linking,
75+
# which can find other issues, but it is much faster.
76+
#
77+
# This includes transforming `rustdoc` tests into KUnit ones thanks to
78+
# `CONFIG_RUST_KERNEL_DOCTESTS=y` above (which, for the moment, uses the
79+
# unstable `--test-builder` and `--no-run`).
80+
make -C linux LLVM=1 -j$(($(nproc) + 1)) \
81+
$BUILD_TARGETS
7082

83+
# Generate documentation
7184
make -C linux LLVM=1 -j$(($(nproc) + 1)) \
7285
rustdoc
86+
87+
# Build macro expanded source (`-Zunpretty=expanded`)
88+
#
89+
# This target also formats the macro expanded code, thus it is also
90+
# intended to catch ICEs with formatting `-Zunpretty=expanded` output
91+
# like https://github.com/rust-lang/rustfmt/issues/6105.
92+
make -C linux LLVM=1 -j$(($(nproc) + 1)) \
93+
samples/rust/rust_minimal.rsi
94+
95+
# Re-build with Clippy enabled
96+
#
97+
# This should not introduce Clippy errors, since `CONFIG_WERROR` is not
98+
# set (thus no `-Dwarnings`) and the kernel uses `-W` for all Clippy
99+
# lints, including `clippy::all`. However, it could catch ICEs.
100+
make -C linux LLVM=1 -j$(($(nproc) + 1)) CLIPPY=1 \
101+
$BUILD_TARGETS
102+
103+
# Format the code
104+
#
105+
# This returns successfully even if there were changes, i.e. it is not
106+
# a check.
107+
make -C linux LLVM=1 -j$(($(nproc) + 1)) \
108+
rustfmt

0 commit comments

Comments
 (0)