From nobody Mon Feb 9 02:14:19 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 4928F2E8B87; Sat, 17 Jan 2026 23:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; cv=none; b=fMcoa1tUNcSr5EQQ48Wmfj0KI5RPBAu6iCiT285iI7sN5oOomnoE7KpSDvH1rKqQztZTHx7yFMSjWKnkFy+ljWd7g9zYyJkg/4t3CiplT2roWWzE9T+E0xqr5gE/B5eRGQnPwotkgHOIRNzYwid4m2ngynWck1QEyYhxycgjtKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; c=relaxed/simple; bh=ii9qu+5l4aZVIH06ic9LZOTxLw3sv2g705JFzfBG91k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VptBMB4yP73ONVFabdy/HtzcoxI9maljsSTr+pwoUYmvchZJ60x+cwXkqQID/NQAEJ7Whl67fsnMjZ1vE9HmWNfMuC8hIgrQmaZJb43vlQYcjbBmLXggvzMml2HP7x3a6U9hQeW12lzRviK9S57y+QckCZzXjWagB1KeUnbAQhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=AlIQ6NN2; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="AlIQ6NN2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1768692418; bh=ii9qu+5l4aZVIH06ic9LZOTxLw3sv2g705JFzfBG91k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AlIQ6NN2BKIvbLYZSr1s9kbqEa2Yo/BG4zIND1CfvMOM15II++7u+9yKR2IOmjP9u XhXqDYIFiToHINbUv9WK7huipTG12sweQiARsYXHMLYkuzzDIkQ4VAp0q2X74xm4C/ xkZ620GfVemGjDKG2GVjheRs880Oxy2d4MYsJXIM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 18 Jan 2026 00:26:21 +0100 Subject: [PATCH 1/4] tools/docs: sphinx-build-wrapper: generate rust docs only once Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260118-docs-spurious-rust-v1-1-998e14b9ed9e@weissschuh.net> References: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> In-Reply-To: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> To: Mauro Carvalho Chehab , Jonathan Corbet Cc: Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768692417; l=2322; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ii9qu+5l4aZVIH06ic9LZOTxLw3sv2g705JFzfBG91k=; b=nvKBT0gePqCVj+muxGNG2/DpCj/nI/Cjz4PzUXWzH3a+q3M2Q1Pt4auEJXegy/N9Jlv21Iku8 ZnGl+XcN7CbBaQiG7gYq9l2i02gvpTBCfC66jeyW2LitGNTNhY4169b X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Currently the rust docs are generated for each entry in SPHINXDIRS. This is unnecessary as they will be the same for each one. Move the generation, so it is executed only once. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Mauro Carvalho Chehab Tested-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 7a5fcef25429..4ce655a31061 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -352,23 +352,6 @@ class SphinxBuilder: except (OSError, IOError) as e: print(f"Warning: Failed to copy CSS: {e}", file=3Dsys.stde= rr) =20 - if self.rustdoc: - print("Building rust docs") - if "MAKE" in self.env: - cmd =3D [self.env["MAKE"]] - else: - cmd =3D ["make", "LLVM=3D1"] - - cmd +=3D [ "rustdoc"] - if self.verbose: - print(" ".join(cmd)) - - try: - subprocess.run(cmd, check=3DTrue) - except subprocess.CalledProcessError as e: - print(f"Ignored errors when building rustdoc: {e}. Is RUST= enabled?", - file=3Dsys.stderr) - def build_pdf_file(self, latex_cmd, from_dir, path): """Builds a single pdf file using latex_cmd""" try: @@ -786,6 +769,23 @@ class SphinxBuilder: elif target =3D=3D "infodocs": self.handle_info(output_dirs) =20 + if self.rustdoc and target in ["htmldocs", "epubdocs"]: + print("Building rust docs") + if "MAKE" in self.env: + cmd =3D [self.env["MAKE"]] + else: + cmd =3D ["make", "LLVM=3D1"] + + cmd +=3D [ "rustdoc"] + if self.verbose: + print(" ".join(cmd)) + + try: + subprocess.run(cmd, check=3DTrue) + except subprocess.CalledProcessError as e: + print(f"Ignored errors when building rustdoc: {e}. Is RUST= enabled?", + file=3Dsys.stderr) + def jobs_type(value): """ Handle valid values for -j. Accepts Sphinx "-jauto", plus a number --=20 2.52.0 From nobody Mon Feb 9 02:14:19 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 274AA2EC0B0; Sat, 17 Jan 2026 23:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; cv=none; b=fxnNqyUh7izD9CMzRDpmEkMn14Q06PFlODdAxm7vnPfge2v3kqqoGap8bPOhvf4Oi4F1mPBbNkOhmYIpxAhdw9bpMKYRQlMR9RZe/2bsWjBf1Q9K6jkRz0a/k3AzWMoiHGaj+vY5dPbW/39PCbLLTlh/rrIEHJmy4G3nZTtiCuQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; c=relaxed/simple; bh=jVwVOTQBl/8pg8Q675QHinGDembb460plAvRVUlOeJ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BtSG8cj05yF05n28MVGZl9lztXqxPMQjfyF+KEX/vmbe2qDJmnwFsxE0/UG9jF79zN0gK+xPF1e2qmGhbqXnbLJnY8FbjKM2z0x+UfdWWSnlu9JLBsSRBeP9wWQdHGcAuUgNiHy15yl4A59S7BcZoxpOIbZuF5kJ2Yqrr86B/Nk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=sfzaN0PW; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="sfzaN0PW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1768692418; bh=jVwVOTQBl/8pg8Q675QHinGDembb460plAvRVUlOeJ4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sfzaN0PW/VCHvFbpI7JqhG/4LEfODtgO8+x9AsOuKX1ocgKGOraipCjkTR/3H7QbS u1KG8XugVt2LeoShRY/2jlI2LCN4tmmAx98K9NamTO1s6LKS8lf4o/h3UGiVwjpEnn PpxvTQf910UvCrD/cm3PY7SYyA/A7RXlAVr1lJGw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 18 Jan 2026 00:26:22 +0100 Subject: [PATCH 2/4] tools/docs: sphinx-build-wrapper: make 'rustdoc' a local variable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260118-docs-spurious-rust-v1-2-998e14b9ed9e@weissschuh.net> References: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> In-Reply-To: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> To: Mauro Carvalho Chehab , Jonathan Corbet Cc: Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768692417; l=2248; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=jVwVOTQBl/8pg8Q675QHinGDembb460plAvRVUlOeJ4=; b=Ph5skPcHPojUYZ672d+uOXWvp9aPeFNjhkENu4bZ5euGJvsZUW/WvERslLz3ru2anrNaDCNLR R3RIDyieyZcCNxv+F9Nvh+LEvE4CyDKRqqbjT0MXKxjX0MPES5RH6IJ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= All users of this variable are now in the same method. Demote the instance variable to a local one. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Mauro Carvalho Chehab Tested-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 4ce655a31061..5f956c289c02 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -123,12 +123,10 @@ class SphinxBuilder: """ Checks if Rust is enabled """ - self.rustdoc =3D False - config =3D os.path.join(self.srctree, ".config") =20 if not os.path.isfile(config): - return + return False =20 re_rust =3D re.compile(r"CONFIG_RUST=3D(m|y)") =20 @@ -136,11 +134,13 @@ class SphinxBuilder: with open(config, "r", encoding=3D"utf-8") as fp: for line in fp: if re_rust.match(line): - self.rustdoc =3D True - return + return True =20 except OSError as e: print(f"Failed to open {config}", file=3Dsys.stderr) + return False + + return False =20 def get_sphinx_extra_opts(self, n_jobs): """ @@ -259,8 +259,6 @@ class SphinxBuilder: =20 self.get_sphinx_extra_opts(n_jobs) =20 - self.check_rust() - # # If venv command line argument is specified, run Sphinx from venv # @@ -680,7 +678,8 @@ class SphinxBuilder: =20 args.extend(["-D", f"latex_elements.papersize=3D{paper}paper"]) =20 - if self.rustdoc: + rustdoc =3D self.check_rust() + if rustdoc: args.extend(["-t", "rustdoc"]) =20 if not sphinxdirs: @@ -769,7 +768,7 @@ class SphinxBuilder: elif target =3D=3D "infodocs": self.handle_info(output_dirs) =20 - if self.rustdoc and target in ["htmldocs", "epubdocs"]: + if rustdoc and target in ["htmldocs", "epubdocs"]: print("Building rust docs") if "MAKE" in self.env: cmd =3D [self.env["MAKE"]] --=20 2.52.0 From nobody Mon Feb 9 02:14:19 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 274342EB87D; Sat, 17 Jan 2026 23:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692428; cv=none; b=S95z3qOMat9+HqhhuxnY4T44jEBPgOdUvymOvIkwPm8xs24tVtVZ/exMk9g8IllQIw+Pj0bNWfrbOZ5xQt9boZv0T7JyYtUk3zoc49moxMco/dna258shL2JkK6iR/ZbCsYc13r3SBIa5+DfcsePFEWszf4N3f2CWzkDcGQPiZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692428; c=relaxed/simple; bh=iu/Nqtn8dRHZka2LF2nKKKy85TSJtks1y7TCW8Th124=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nTF91VO9h8t9j6xPG0UUFFmU2XOpnn8k08mONtSK3jz20hPzyOKIKNJt8APg4foIcn0fhZkmDm6F7dtqLn3j+Tg8zs5M10xC/fmDs/uZYw+lsIXRgeDPFJ204eAF5Gviivz18mKQ7qr7GRtiBxtXYdqC2eIOf6FXGBdQ+R32JFE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=eX5xZY3s; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="eX5xZY3s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1768692418; bh=iu/Nqtn8dRHZka2LF2nKKKy85TSJtks1y7TCW8Th124=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eX5xZY3sWyPyYTNGvJbMLmgGiFh9EpZlKnWtuqWjKd8LnTXDnfCO3likfmF4B86EV ReLJliukwII2tdxTFY9NYV45oS/vg49ZIc7gxPwjwuCWZs6q6h9h1RCo0AwNE1hE5E 7Nuh4bJPDANr4SoE/LWaxf+mjUm3oKpFi36TSBWI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 18 Jan 2026 00:26:23 +0100 Subject: [PATCH 3/4] tools/docs: sphinx-build-wrapper: compute sphinxdirs_list earlier Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260118-docs-spurious-rust-v1-3-998e14b9ed9e@weissschuh.net> References: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> In-Reply-To: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> To: Mauro Carvalho Chehab , Jonathan Corbet Cc: Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768692417; l=2099; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=iu/Nqtn8dRHZka2LF2nKKKy85TSJtks1y7TCW8Th124=; b=zXEe6SzFXRWnNwB4HN3W+DDTGVVMHeECkvCg8P3tXadQlS+RIDtCXGP5H12Oy2praJKD82xc1 w6XvSVoDu5SCk7BI0TGidiqsNConUaAZ3GMkbaSU1PhjmXyJSKQGbbT X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= An upcoming patch will require sphinxdirs_list to be available before the call to check_rust(). Move it up in the function. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Mauro Carvalho Chehab Tested-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 5f956c289c02..a3cca4634355 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -670,6 +670,19 @@ class SphinxBuilder: if kerneldoc.startswith(self.srctree): kerneldoc =3D os.path.relpath(kerneldoc, self.srctree) =20 + if not sphinxdirs: + sphinxdirs =3D os.environ.get("SPHINXDIRS", ".") + + # + # sphinxdirs can be a list or a whitespace-separated string + # + sphinxdirs_list =3D [] + for sphinxdir in sphinxdirs: + if isinstance(sphinxdir, list): + sphinxdirs_list +=3D sphinxdir + else: + sphinxdirs_list +=3D sphinxdir.split() + args =3D [ "-b", builder, "-c", docs_dir ] =20 if builder =3D=3D "latex": @@ -682,9 +695,6 @@ class SphinxBuilder: if rustdoc: args.extend(["-t", "rustdoc"]) =20 - if not sphinxdirs: - sphinxdirs =3D os.environ.get("SPHINXDIRS", ".") - # # The sphinx-build tool has a bug: internally, it tries to set # locale with locale.setlocale(locale.LC_ALL, ''). This causes a @@ -695,16 +705,6 @@ class SphinxBuilder: except locale.Error: self.env["LC_ALL"] =3D "C" =20 - # - # sphinxdirs can be a list or a whitespace-separated string - # - sphinxdirs_list =3D [] - for sphinxdir in sphinxdirs: - if isinstance(sphinxdir, list): - sphinxdirs_list +=3D sphinxdir - else: - sphinxdirs_list +=3D sphinxdir.split() - # # Step 1: Build each directory in separate. # --=20 2.52.0 From nobody Mon Feb 9 02:14:19 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 4C3182E92C3; Sat, 17 Jan 2026 23:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; cv=none; b=k3a2kevY+AL+LlNxvBiEsiiO6aWmk9gyrKrAou0eiub9sNN3kXXbDPpJSrPkP6VsSnQF9ebeH7sxkXERHo6iNv5g/j5QrEudZuh6vp853RqHTSzGT1wTGURuPTJbB2DkotAnKJqv+qBvVwdxg1muuu+Aaz5EheOU8N60IyKcMB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768692427; c=relaxed/simple; bh=lJztgpeDqLimNIeL3NINiKQLdhg53c54+i6LgdsTomM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ouYbMW3vsDsuyEyuFna/XyDhxktjppJpc+WlOMyAgQIhAoqA+qTrLH1gDUQ7rxtEx6X8GJhbgYz+MlHbQXiYtHnE10A5vLxoHiH4L6JNZuU/o04JkASqyuQoQPpis6Bsi+MCNJ2XNAH6Qd292FMmT1bvw6Z5cNQIxeeRKo0ubbY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=BpSvBvsW; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="BpSvBvsW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1768692418; bh=lJztgpeDqLimNIeL3NINiKQLdhg53c54+i6LgdsTomM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BpSvBvsWvfWNAfyVo1Yhgbxn0QhXqQ3OjGzNQOcjxubpl4PADOKdTxzYCqwDzWaZc OFZ6rxFnoEiTr0RKCOZ5gSkj9pglxbxFXMZv6eoq6xMDjBcqMEikKVRpAqnFBhTH5s 1aNgVEKQQHw6xe1KmYy5r8MAL1Cx9i4PsuFmTydA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 18 Jan 2026 00:26:24 +0100 Subject: [PATCH 4/4] tools/docs: sphinx-build-wrapper: only generate rust docs when requested Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260118-docs-spurious-rust-v1-4-998e14b9ed9e@weissschuh.net> References: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> In-Reply-To: <20260118-docs-spurious-rust-v1-0-998e14b9ed9e@weissschuh.net> To: Mauro Carvalho Chehab , Jonathan Corbet Cc: Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768692417; l=1454; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=lJztgpeDqLimNIeL3NINiKQLdhg53c54+i6LgdsTomM=; b=zZUaVxWdQtmE8zw/iX68qPg735PcUIRXkFnrbX+lYsnaACzxLEFZNCVnKW+4jUHC/aW/nKss0 FjC2Eoq9pziAOj+jtvZ2oPrgsx4ZbqAsc286QYin+cb/+rNicK+5Ck9 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= When the user explicitly specifies SPHINXDIRS to build a specific subdirectory it is unexpected that the rust docs are also generated. Especially as their generation may dominate the execution time. Only generate the rust docs when they are part of the SPHINXDIRS requested by the user. 'rust/rustdocs' is not considered, as it is not a valid SPHINXDIRS anyways. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Mauro Carvalho Chehab Tested-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index a3cca4634355..f817497bb706 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -119,12 +119,15 @@ class SphinxBuilder: =20 return path =20 - def check_rust(self): + def check_rust(self, sphinxdirs): """ Checks if Rust is enabled """ config =3D os.path.join(self.srctree, ".config") =20 + if not {'.', 'rust'}.intersection(sphinxdirs): + return False + if not os.path.isfile(config): return False =20 @@ -691,7 +694,7 @@ class SphinxBuilder: =20 args.extend(["-D", f"latex_elements.papersize=3D{paper}paper"]) =20 - rustdoc =3D self.check_rust() + rustdoc =3D self.check_rust(sphinxdirs_list) if rustdoc: args.extend(["-t", "rustdoc"]) =20 --=20 2.52.0