]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/docs: sphinx-build-wrapper: handle sphinx-build errors
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 20 Sep 2025 09:40:24 +0000 (11:40 +0200)
committerJonathan Corbet <corbet@lwn.net>
Sun, 21 Sep 2025 22:40:37 +0000 (16:40 -0600)
If sphinx-build returns an error, exit the script.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <b7e152291fadd91694cbb6b086caefa4b6470fdd.1758361087.git.mchehab+huawei@kernel.org>

tools/docs/sphinx-build-wrapper

index 6ed3d58ec277bf84ff6dfbd73c6c689787bd2358..b7e97c10d7dc4a66006dcb08eebfcc1fc5ab8ea2 100755 (executable)
@@ -275,7 +275,7 @@ class SphinxBuilder:
             if self.venv:
                 cmd = ["python"]
             else:
-                cmd = [sys.executable,]
+                cmd = [sys.executable]
 
             cmd += [sphinx_build]
             cmd += [f"-j{n_jobs}"]
@@ -718,7 +718,12 @@ class SphinxBuilder:
                 self.handle_man(kerneldoc, docs_dir, src_dir, output_dir)
             else:
                 try:
-                    self.run_sphinx(sphinxbuild, build_args, env=self.env)
+                    result = self.run_sphinx(sphinxbuild, build_args,
+                                             env=self.env)
+
+                    if result:
+                        sys.exit(f"Build failed: return code: {result}")
+
                 except (OSError, ValueError, subprocess.SubprocessError) as e:
                     sys.exit(f"Build failed: {repr(e)}")