Skip to content

Commit 4f7d0c2

Browse files
committed
Auto merge of rust-lang#128928 - ojeda:ci-rfl-more-tools, r=<try>
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 8291d68 + 9c011ce commit 4f7d0c2

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

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

+42-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -euo pipefail
44

55
LINUX_VERSION=v6.11-rc1
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 1 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
@@ -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)