From d584f7099a3c17c76a38f686a9af0b1d36a686ab Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Sat, 10 Aug 2024 16:47:20 +0200 Subject: [PATCH] CI: rfl: add a `rustfmt` run This change will also remove the current warnings in the build due to `rustfmt` not being available (for `bindgen` output): error: 'rustfmt' is not installed for the custom toolchain 'local'. note: this is a custom toolchain, which cannot use `rustup component add` help: if you built this toolchain from source, and used `rustup toolchain link`, then you may be able to build the component with `x.py` Failed to run rustfmt: Internal rustfmt error (non-fatal, continuing) Signed-off-by: Miguel Ojeda --- src/ci/docker/scripts/rfl-build.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/scripts/rfl-build.sh b/src/ci/docker/scripts/rfl-build.sh index 2f9ec3c23a8e..030b6f6ee176 100755 --- a/src/ci/docker/scripts/rfl-build.sh +++ b/src/ci/docker/scripts/rfl-build.sh @@ -4,8 +4,8 @@ set -euo pipefail LINUX_VERSION=4c7864e81d8bbd51036dacf92fb0a400e13aaeee -# Build rustc, rustdoc, cargo and clippy-driver -../x.py build --stage 2 library rustdoc clippy +# Build rustc, rustdoc, cargo, clippy-driver and rustfmt +../x.py build --stage 2 library rustdoc clippy rustfmt ../x.py build --stage 0 cargo # Install rustup so that we can use the built toolchain easily, and also @@ -90,3 +90,10 @@ make -C linux LLVM=1 -j$(($(nproc) + 1)) CLIPPY=1 \ samples/rust/rust_print.o \ drivers/net/phy/ax88796b_rust.o \ rust/doctests_kernel_generated.o + +# Format the code +# +# This returns successfully even if there were changes, i.e. it is not +# a check. +make -C linux LLVM=1 -j$(($(nproc) + 1)) \ + rustfmt