linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, "Jonathan Corbet" <corbet@lwn.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Andreas Hindborg" <mchehab+huawei@kernel.org>,
	"Benno Lossin" <mchehab+huawei@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Danilo Krummrich" <mchehab+huawei@kernel.org>,
	"Gary Guo" <gary@garyguo.net>,
	"Miguel Ojeda" <mchehab+huawei@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	rust-for-linux@vger.kernel.org
Subject: [PATCH v2 00/13] Split sphinx call logic from docs Makefile
Date: Mon, 25 Aug 2025 18:30:27 +0200	[thread overview]
Message-ID: <cover.1756138805.git.mchehab+huawei@kernel.org> (raw)

Hi Jon,

This series does a major cleanup at docs Makefile by moving the
actual doc build logic to a helper script (scripts/sphinx-build-wrapper).

Such script was written in a way that it can be called either
directly or via a makefile. When running via makefile, it will
use GNU jobserver to ensure that, when sphinx-build is
called, the number of jobs will match at most what it is
specified by the "-j" parameter.

The first 3 patches do a cleanup at scripts/jobserver-exec
and moves the actual code to a library. Such library is used
by both the jobserver-exec command line and by sphinx-build-wrappper.

The change also gets rid of parallel-wrapper.sh, whose
functions are now part of the wrapper code.

This series is now on top of:
	https://lore.kernel.org/linux-doc/0ad4fefca2855603c66d513474a687058e780931@intel.com/

As I'm expecting that the oner one (although it is bigger)
won't cause too much noise, as it impacts only the media builds,
and remove a hack that would otherwise require some code here.

While version 2 has the same features and almost the same code,
I did some changes to make easier to review:

- there's no generic exception handler anymore;
- it moves sphinx-pre-install to tools/docs;
- the logic which ensures a minimal Python version got moved
  to a library, which is now used by both pre-install and wrapper;
- The first wrapper (05/13) doesn't contain comments (except for
  shebang and SPDX). The goal is to help showing the size increase
  when moving from Makefile to Python. Some file increase is
  unavoidable, as Makefile is more compact: no includes, multple
  statements per line, no argparse, etc;
- The second patch adds docstrings and comments. It has almost
  the same size of the code itself;
- I moved the venv logic to a third wrapper patch;
- I fixed an issue at the paraller build logic;
- There are no generic except blocks anymore.

Mauro Carvalho Chehab (13):
  scripts/jobserver-exec: move the code to a class
  scripts/jobserver-exec: move its class to the lib directory
  scripts/jobserver-exec: add a help message
  scripts: sphinx-pre-install: move it to tools/docs
  tools/docs: sphinx-pre-install: move Python version handling to lib
  tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build
  tools/docs: sphinx-build-wrapper: add comments and blank lines
  tools/docs: sphinx-build-wrapper: add support to run inside venv
  docs: parallel-wrapper.sh: remove script
  docs: Makefile: document latex/PDF PAPER= parameter
  tools/docs: sphinx-build-wrapper: add an argument for LaTeX
    interactive mode
  tools/docs,scripts: sphinx-*: prevent sphinx-build crashes
  tools/docs: sphinx-build-wrapper: allow building PDF files in parallel

 Documentation/Makefile                     | 133 +----
 Documentation/sphinx/parallel-wrapper.sh   |  33 --
 scripts/jobserver-exec                     |  88 +--
 scripts/lib/jobserver.py                   | 149 +++++
 tools/docs/lib/python_version.py           | 133 +++++
 tools/docs/sphinx-build-wrapper            | 660 +++++++++++++++++++++
 {scripts => tools/docs}/sphinx-pre-install | 134 +----
 7 files changed, 1022 insertions(+), 308 deletions(-)
 delete mode 100644 Documentation/sphinx/parallel-wrapper.sh
 create mode 100755 scripts/lib/jobserver.py
 create mode 100644 tools/docs/lib/python_version.py
 create mode 100755 tools/docs/sphinx-build-wrapper
 rename {scripts => tools/docs}/sphinx-pre-install (93%)

-- 
2.51.0


             reply	other threads:[~2025-08-25 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 16:30 Mauro Carvalho Chehab [this message]
2025-08-25 16:30 ` [PATCH v2 01/13] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 02/13] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 03/13] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 04/13] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 05/13] tools/docs: sphinx-pre-install: move Python version handling to lib Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 06/13] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 07/13] tools/docs: sphinx-build-wrapper: add comments and blank lines Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 08/13] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 09/13] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 10/13] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 11/13] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 12/13] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-08-25 16:30 ` [PATCH v2 13/13] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel 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=cover.1756138805.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=corbet@lwn.net \
    --cc=gary@garyguo.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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;
as well as URLs for NNTP newsgroup(s).