]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: kbuild: support `skip_clippy` for `rustc_procmacro`
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 8 Jun 2026 14:14:26 +0000 (16:14 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Jun 2026 02:13:22 +0000 (04:13 +0200)
Certain vendored crates, like the upcoming `zerocopy-derive`, do not
need to be built with Clippy since we `--cap-lints=allow` them anyway.

Thus add support to skip Clippy for proc macro crates.

Acked-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260608141439.182634-8-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/Makefile

index 9b5a3f9dd934ec0d96acaee29382feac3619a794..7b1db0d5d4233e621e828052f7070eb6e8589d37 100644 (file)
@@ -547,10 +547,10 @@ $(obj)/libsyn.rlib: private rustc_target_flags = $(syn-flags)
 $(obj)/libsyn.rlib: $(src)/syn/lib.rs $(obj)/libquote.rlib FORCE
        +$(call if_changed_dep,rustc_procmacrolibrary)
 
-quiet_cmd_rustc_procmacro = $(RUSTC_OR_CLIPPY_QUIET) P $@
+quiet_cmd_rustc_procmacro = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) P $@
       cmd_rustc_procmacro = \
        $(rustc_target_envs) \
-       $(RUSTC_OR_CLIPPY) $(rust_common_flags) $(rustc_target_flags) \
+       $(if $(skip_clippy),$(RUSTC),$(RUSTC_OR_CLIPPY)) $(rust_common_flags) $(rustc_target_flags) \
                -Clinker-flavor=gcc -Clinker=$(HOSTCC) \
                -Clink-args='$(call escsq,$(KBUILD_PROCMACROLDFLAGS))' \
                --emit=dep-info=$(depfile) --emit=link=$@ --extern proc_macro \