From: Randy Dunlap <rdunlap@infradead.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] tools/docs: sphinx-build-wrapper: fix compat with recent Tumbleweed
Date: Tue, 23 Sep 2025 22:05:14 -0700 [thread overview]
Message-ID: <4d5757ff-5d63-4bb2-84e9-fb5618a696b3@infradead.org> (raw)
In-Reply-To: <8917f862e0b8484c68408c274129c9f37a7aefb4.1758539031.git.mchehab+huawei@kernel.org>
Hi Mauro,
On 9/22/25 4:27 AM, Mauro Carvalho Chehab wrote:
> On recent versions of openSUSE Tumbleweed, sphinx-buildis is no longer
> a Python script, but something else. Such change is due to how
> it now handles alternatives:
>
> https://en.opensuse.org/openSUSE:Migrating_to_libalternatives_with_alts
>
> The most common approach that distros use for alternatives is via
> symlinks:
>
> lrwxrwxrwx 1 root root 22 out 31 2024 /usr/bin/java -> /etc/alternatives/java
> lrwxrwxrwx 1 root root 37 mar 5 2025 /etc/alternatives/java -> /usr/lib/jvm/java-21-openjdk/bin/java
>
> With such approach, one can sun the script with either:
>
> <sphinx>
> python3 <script>
>
> However, openSUSE's implementation uses an ELF binary (/usr/bin/alts),
> which breaks the latter format.
>
> It is needed to allow users to specify the Python version to be
> used while building docs, as some distros like Leap 15.x are
> shipped with:
>
> - older, unsupported python3/python3-sphinx packages;
> - more modern python3xx/python3xx-sphinx packages that work
> properly.
>
> On such distros, building docs require running make with:
>
> make PYTHON3=python3.11 htmldocs
>
> Heh, even on more moderen distros where python3-sphinx
> is supported, one may still want to use a newer package,
> for instance, due to performance issues, as:
>
> - with Python < 3.11, kernel-doc is 3 times slower;
> - while building htmldocs with Python 3.13/Sphinx 8.x
> takes about 3 minutes on a modern machine, using
> Sphinx < 8.0 can take up to 16 minutes to build docs
> (7.x are the worse ones and require lots of RAM).
>
> So, even with not too old distros, one still may want to use
> for instance PYTHON3=python3.11.
>
> To acommodate using PYTHON3 without breaking on Tumbleweed,
> add a workaround that will only use:
>
> $(PYTHON3) sphinx-build
>
> if PYTHON3 env var is not default.
>
> While here, drop the special check for venv, as, with venv,
> we can just call sphinx-build directly without any extra
> checks.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Link: https://lore.kernel.org/all/883df949-0281-4a39-8745-bcdcce3a5594@infradead.org/
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> tools/docs/sphinx-build-wrapper | 25 ++++++++++++++++++++++---
> 1 file changed, 22 insertions(+), 3 deletions(-)
Works for me. Thanks.
Tested-by: Randy Dunlap <rdunlap@infradead.org>
--
~Randy
next prev parent reply other threads:[~2025-09-24 5:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 11:27 [PATCH v2 0/3] fixes/improvements for top of docs/build-script Mauro Carvalho Chehab
2025-09-22 11:27 ` [PATCH v2 1/3] tools/docs: sphinx-build-wrapper: fix compat with recent Tumbleweed Mauro Carvalho Chehab
2025-09-24 5:05 ` Randy Dunlap [this message]
2025-09-22 11:27 ` [PATCH v2 2/3] docs: Makefile: fix rustdoc detection Mauro Carvalho Chehab
2025-09-22 11:27 ` [PATCH v2 3/3] tools/docs/sphinx-build-wrapper: allow skipping sphinx-build step Mauro Carvalho Chehab
2025-09-25 17:17 ` [PATCH v2 0/3] fixes/improvements for top of docs/build-script Jonathan Corbet
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=4d5757ff-5d63-4bb2-84e9-fb5618a696b3@infradead.org \
--to=rdunlap@infradead.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@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®