[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250730130716.3278285-4-ojeda@kernel.org>
Date: Wed, 30 Jul 2025 15:07:16 +0200
From: Miguel Ojeda <ojeda@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Andreas Hindborg <a.hindborg@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
rust-for-linux@...r.kernel.org,
linux-block@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Onur Özkan <work@...rozkan.dev>
Subject: [PATCH 3/3] rust: warn if `srctree/` links do not exist
`srctree/` links may point to nonexistent files, e.g. due to renames
that missed to update the files or simply because of typos.
Since they can be easily checked for validity, do so and print a warning
in the file does not exist.
This found the following cases already in-tree:
warning: srctree/ link to include/linux/blk_mq.h does not exist
warning: srctree/ link to include/linux/drm/drm_gem.h does not exist
warning: srctree/ link to include/linux/drm/drm_drv.h does not exist
warning: srctree/ link to include/linux/drm/drm_ioctl.h does not exist
warning: srctree/ link to include/linux/drm/drm_file.h does not exist
warning: srctree/ link to include/linux/drm/drm_device.h does not exist
Inspired-by: "Onur Özkan" <work@...rozkan.dev>
Link: https://lore.kernel.org/rust-for-linux/CANiq72=xCYA7z7_rxpzzKkkhJs6m7L_xEaLMuArVn3ZAcyeHdA@mail.gmail.com/
Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
---
rust/Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/rust/Makefile b/rust/Makefile
index 4e675d210dd8..a27503028216 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -93,6 +93,12 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
# and then retouch the generated files.
rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \
rustdoc-kernel rustdoc-pin_init
+ $(Q)grep -Ehro '<a href="srctree/([^"]+)"' $(rustdoc_output) | \
+ cut -d'"' -f2 | cut -d/ -f2- | while read f; do \
+ if [ ! -e "$(srctree)/$$f" ]; then \
+ echo "warning: srctree/ link to $$f does not exist"; \
+ fi \
+ done
$(Q)cp $(srctree)/Documentation/images/logo.svg $(rustdoc_output)/static.files/
$(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output)/static.files/
$(Q)find $(rustdoc_output) -name '*.html' -type f -print0 | xargs -0 sed -Ei \
--
2.50.1
Powered by blists - more mailing lists