From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] tools/docs: sphinx-build-wrapper: handle sphinx-build errors
Date: Fri, 19 Sep 2025 17:09:59 +0200 [thread overview]
Message-ID: <fcdb49ce5aff559b54c7f8527eee9338f82e5975.1758294450.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1758294450.git.mchehab+huawei@kernel.org>
If sphinx-build returns an error, exit the script.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
tools/docs/sphinx-build-wrapper | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper
index 6ed3d58ec277..b7e97c10d7dc 100755
--- a/tools/docs/sphinx-build-wrapper
+++ b/tools/docs/sphinx-build-wrapper
@@ -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)}")
--
2.51.0
next prev parent reply other threads:[~2025-09-19 15:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 15:09 [PATCH 0/2] A couple patches for sphinx-build-wrapper Mauro Carvalho Chehab
2025-09-19 15:09 ` Mauro Carvalho Chehab [this message]
2025-09-19 15:10 ` [PATCH 2/2] docs: conf.py: get rid of load_config.py Mauro Carvalho Chehab
2025-09-19 21:38 ` Jonathan Corbet
2025-09-20 9:36 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fcdb49ce5aff559b54c7f8527eee9338f82e5975.1758294450.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®