Skip to contentSkip to conversation

fix rustdoc build detection

PATCH Applied Mauro Carvalho Chehab 2 participants 3 messages Nov 21, 2025 – Nov 29, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover fix rustdoc build detection

Current logic doesn't use the right value for CONFIG_RUST. Instead, it picks the value cached from a previous non-doc buid.

After analyzing the issue, it was not caused by changing the logic to use the wrapper, but, instead, to the way .config is currently parsed. For more details, see:

    https://lore.kernel.org/linux-doc/[email protected]/

---

v2: changed patch description to better explain the issue.

Mauro Carvalho Chehab (1):
docs: makefile: move rustdoc check to the build wrapper

 Documentation/Makefile          |  6 -----
 tools/docs/sphinx-build-wrapper | 41 +++++++++++++++++++++++++--------
 2 files changed, 32 insertions(+), 15 deletions(-)
Signature · 1 line
2.51.1
#1 lore raw

PATCH v2 1/1 docs: makefile: move rustdoc check to the build wrapper

The makefile logic to detect if rust is enabled is not working the way it was expected: instead of using the current setup for CONFIG_RUST, it uses a cached version from a previous build.

The root cause is that the current logic inside docs/Makefile uses a cached version of CONFIG_RUST, from the last time a non documentation target was executed. That's perfectly fine for Sphinx build, as it doesn't need to read or depend on any CONFIG_*.

So, instead of relying at the cache, move the logic to the wrapper script and let it check the current content of .config, to verify if CONFIG_RUST was selected.

---
 Documentation/Makefile          |  6 -----
 tools/docs/sphinx-build-wrapper | 41 +++++++++++++++++++++++++--------
 2 files changed, 32 insertions(+), 15 deletions(-)
Documentation/Makefile +0 -6
index fda2bef8d9d8..e96ac6dcac4f 100644
@@ -42,12 +42,6 @@ FONTS_CONF_DENY_VF ?= $(HOME)/deny-vf
 # User-friendly check for sphinx-build
 HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi)
 
-ifneq ($(wildcard $(srctree)/.config),)
-ifeq ($(CONFIG_RUST),y)
-	RUSTDOC=--rustdoc
-endif
-endif
-
 ifeq ($(HAVE_SPHINX),0)
 
 .DEFAULT:
tools/docs/sphinx-build-wrapper +32 -9

95 lines not on this page · raw message

Signature · 1 line
2.51.1
maintainer Applied
#2 lore raw

Re: [PATCH v2 1/1] docs: makefile: move rustdoc check to the build wrapper

Quoted 14 lines · Mauro Carvalho Chehab

The makefile logic to detect if rust is enabled is not working the way it was expected: instead of using the current setup for CONFIG_RUST, it uses a cached version from a previous build.

The root cause is that the current logic inside docs/Makefile uses a cached version of CONFIG_RUST, from the last time a non documentation target was executed. That's perfectly fine for Sphinx build, as it doesn't need to read or depend on any CONFIG_*.

So, instead of relying at the cache, move the logic to the wrapper script and let it check the current content of .config, to verify if CONFIG_RUST was selected.

Quoted 5 lines
---
 Documentation/Makefile          |  6 -----
 tools/docs/sphinx-build-wrapper | 41 +++++++++++++++++++++++++--------
 2 files changed, 32 insertions(+), 15 deletions(-)

Applied, thanks.

jon