[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260118-docs-spurious-rust-v1-3-998e14b9ed9e@weissschuh.net>
Date: Sun, 18 Jan 2026 00:26:23 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Jonathan Corbet <corbet@....net>
Cc: Shuah Khan <skhan@...uxfoundation.org>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 3/4] tools/docs: sphinx-build-wrapper: compute
sphinxdirs_list earlier
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ßschuh <linux@...ssschuh.net>
---
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-wrapper
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 = os.path.relpath(kerneldoc, self.srctree)
+ if not sphinxdirs:
+ sphinxdirs = os.environ.get("SPHINXDIRS", ".")
+
+ #
+ # sphinxdirs can be a list or a whitespace-separated string
+ #
+ sphinxdirs_list = []
+ for sphinxdir in sphinxdirs:
+ if isinstance(sphinxdir, list):
+ sphinxdirs_list += sphinxdir
+ else:
+ sphinxdirs_list += sphinxdir.split()
+
args = [ "-b", builder, "-c", docs_dir ]
if builder == "latex":
@@ -682,9 +695,6 @@ class SphinxBuilder:
if rustdoc:
args.extend(["-t", "rustdoc"])
- if not sphinxdirs:
- sphinxdirs = 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"] = "C"
- #
- # sphinxdirs can be a list or a whitespace-separated string
- #
- sphinxdirs_list = []
- for sphinxdir in sphinxdirs:
- if isinstance(sphinxdir, list):
- sphinxdirs_list += sphinxdir
- else:
- sphinxdirs_list += sphinxdir.split()
-
#
# Step 1: Build each directory in separate.
#
--
2.52.0
Powered by blists - more mailing lists