Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/docs: sphinx-build-wrapper: generate rust docs only once

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ßschuh <linux@weissschuh.net>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260118-docs-spurious-rust-v1-1-998e14b9ed9e@weissschuh.net>

authored by

Thomas Weißschuh and committed by
Jonathan Corbet
5094f7d5 36718450

+17 -17
+17 -17
tools/docs/sphinx-build-wrapper
··· 352 352 except (OSError, IOError) as e: 353 353 print(f"Warning: Failed to copy CSS: {e}", file=sys.stderr) 354 354 355 - if self.rustdoc: 356 - print("Building rust docs") 357 - if "MAKE" in self.env: 358 - cmd = [self.env["MAKE"]] 359 - else: 360 - cmd = ["make", "LLVM=1"] 361 - 362 - cmd += [ "rustdoc"] 363 - if self.verbose: 364 - print(" ".join(cmd)) 365 - 366 - try: 367 - subprocess.run(cmd, check=True) 368 - except subprocess.CalledProcessError as e: 369 - print(f"Ignored errors when building rustdoc: {e}. Is RUST enabled?", 370 - file=sys.stderr) 371 - 372 355 def build_pdf_file(self, latex_cmd, from_dir, path): 373 356 """Builds a single pdf file using latex_cmd""" 374 357 try: ··· 767 784 self.handle_pdf(output_dirs, deny_vf) 768 785 elif target == "infodocs": 769 786 self.handle_info(output_dirs) 787 + 788 + if self.rustdoc and target in ["htmldocs", "epubdocs"]: 789 + print("Building rust docs") 790 + if "MAKE" in self.env: 791 + cmd = [self.env["MAKE"]] 792 + else: 793 + cmd = ["make", "LLVM=1"] 794 + 795 + cmd += [ "rustdoc"] 796 + if self.verbose: 797 + print(" ".join(cmd)) 798 + 799 + try: 800 + subprocess.run(cmd, check=True) 801 + except subprocess.CalledProcessError as e: 802 + print(f"Ignored errors when building rustdoc: {e}. Is RUST enabled?", 803 + file=sys.stderr) 770 804 771 805 def jobs_type(value): 772 806 """