From nobody Fri Dec 19 11:12:37 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3F45283FF3; Tue, 20 May 2025 19:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747770837; cv=none; b=qmPbxzerUkEFutczKGznU0wYZkGO9YmuE35KdzKoGS7Fd5Y0X0tyECZeSGNrBBr8vyZWQ4J7acDWypGc6j7OJNZokaAPpsbLfKLVlvNXEGYupxNJRsr1jfYv0VMoYhW9Th2wSUrGOO0SKZjGhAW5uZ1zNvdkJNwXTlgONxW5JEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747770837; c=relaxed/simple; bh=VxB9dZNjaO/CQfaln8AMXdGqbympMTXUc6XWHCuYKIo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RDL4PSL50X8QG1DARaqPouxu+DQlOzFmIEFStyIh4+bjH7+cjmhGgZtlUh4hDYEooax2sG239MQxt0jwvGQZYXC5NR62d1FdhslZUeBBRdqzp2MvS96/2L6MSt0cUrWdpwphHIODqSHvBqVPvLELHU88CPaUT/7XNhh1FPd7gbo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FKeIdF3Z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FKeIdF3Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5113C4CEE9; Tue, 20 May 2025 19:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747770837; bh=VxB9dZNjaO/CQfaln8AMXdGqbympMTXUc6XWHCuYKIo=; h=From:To:Cc:Subject:Date:From; b=FKeIdF3ZRzsVCO7fCWbmyehAqD4H8nwF7AXfcoNX2CIpI+5dS558KzCVHoS+9flwY McSy+OMqElInL4SHyicS9HDd/Z2VR0IQNVyAzSw0LPmXbe3aASgtm+vXG5ve8tqpN3 7f4ndOHqQS5m2ZMkzL51hnPaUjxguPxlActqXboDDJZ8tltmodnCyrOPYWeQZCvmzR gZ0iBz9D3RoGLQ4bKK+i2eSUzx7eeJw9YY8vM3Du3UOn2vz0l1Z8Jpto31z/MpABsR r8a40qeqmTdK89Ey2RZiqtgX62Yex82z1SUrgra7WxWa/N/6aEDXcvgaQviYbcFPU+ 6mmOYnYGv29kA== From: Miguel Ojeda To: Miguel Ojeda , Alex Gaynor , Masahiro Yamada Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , rust-for-linux@vger.kernel.org, Nathan Chancellor , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, stable@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2] rust: kbuild: rebuild if `.clippy.toml` changes Date: Tue, 20 May 2025 21:53:45 +0200 Message-ID: <20250520195345.905374-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We rarely modify `.clippy.toml`, but currently we do not rebuild if that happens, thus it is easy to miss possible changes in lints. Thus rebuild in case of changes. Cc: stable@vger.kernel.org Reported-by: Tamir Duberstein Closes: https://github.com/Rust-for-Linux/linux/issues/1151 Fixes: 7d56786edcbd ("rust: introduce `.clippy.toml`") Signed-off-by: Miguel Ojeda --- rust/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 3aca903a7d08..107299c32065 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -57,6 +57,10 @@ rustdoc_test_quiet=3D--test-args -q rustdoc_test_kernel_quiet=3D>/dev/null endif =20 +ifeq ($(KBUILD_CLIPPY),1) + clippy_toml :=3D $(srctree)/.clippy.toml +endif + core-cfgs =3D \ --cfg no_fp_fmt_parse =20 @@ -405,11 +409,12 @@ quiet_cmd_rustc_procmacro =3D $(RUSTC_OR_CLIPPY_QUIET= ) P $@ --crate-name $(patsubst lib%.$(libmacros_extension),%,$(notdir $@)) $< =20 # Procedural macros can only be used with the `rustc` that compiled it. -$(obj)/$(libmacros_name): $(src)/macros/lib.rs FORCE +$(obj)/$(libmacros_name): $(src)/macros/lib.rs $(clippy_toml) FORCE +$(call if_changed_dep,rustc_procmacro) =20 $(obj)/$(libpin_init_internal_name): private rustc_target_flags =3D --cfg = kernel -$(obj)/$(libpin_init_internal_name): $(src)/pin-init/internal/src/lib.rs F= ORCE +$(obj)/$(libpin_init_internal_name): $(src)/pin-init/internal/src/lib.rs \ + $(clippy_toml) FORCE +$(call if_changed_dep,rustc_procmacro) =20 quiet_cmd_rustc_library =3D $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QU= IET)) L $@ @@ -495,7 +500,8 @@ endif =20 $(obj)/compiler_builtins.o: private skip_gendwarfksyms =3D 1 $(obj)/compiler_builtins.o: private rustc_objcopy =3D -w -W '__*' -$(obj)/compiler_builtins.o: $(src)/compiler_builtins.rs $(obj)/core.o FORCE +$(obj)/compiler_builtins.o: $(src)/compiler_builtins.rs $(obj)/core.o \ + $(clippy_toml) FORCE +$(call if_changed_rule,rustc_library) =20 $(obj)/pin_init.o: private skip_gendwarfksyms =3D 1 base-commit: 22c3335c5dcd33063fe1894676a3a6ff1008d506 --=20 2.49.0