linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/19] Split sphinx call logic from docs Makefile
@ 2025-09-04  7:33 Mauro Carvalho Chehab
  2025-09-04  7:33 ` [PATCH v4 01/19] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
                   ` (19 more replies)
  0 siblings, 20 replies; 67+ messages in thread
From: Mauro Carvalho Chehab @ 2025-09-04  7:33 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel,
	Matthew Wilcox

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.

I opted to pick patches from:
   https://lore.kernel.org/linux-doc/cover.1756916565.git.mchehab+huawei@kernel.org/T/#t

re-ordering them to make more sense.

The last patch breaks doc build when Python3 < 3.7, as requested,
or when sphinx-pre-install suggests to install an updated Sphinx
version. Matteu suggested adding a PYTHON env to allow overriding it,
but this won't would work with sphinx-pre-install, which is meant to
be executed with older python versions, but still requires to run
python from the suggested package to check if package install
succeded. Currently, sphinx-pre-install recomments to install a newer
Python on 3 distribution types:

    - 3.11 on openSuse Leap;
    - 3.9 on RHEL8 and RHEL8-based distros;
    - 3.13 on openSUSE Thumbleweed.

Patch 19 breaks sphinx-pre-install for those, and adding PYTHON
env won't properly fix it. ATM, I can't think on a good non-hacky
solution, as the only way I can think is to let sphinx-pre-install
(and sphinx-build-wrapper) execute python3.x instead of python3.

---

v4:
- updated references for sphinx-pre-install after its rename;
- added some extra patches to add more options to python_version,
  allowing it to bail out and suggest alternatives;
- added a patch at the end to explicitly break doc builds when
  python3 points to python3.6 or older.

v3:
- rebased on the top of docs-next;
- added two patches to build man files that were on a separate
  patch series.

v2:

- 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 (19):
  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: python_version: move version check from sphinx-pre-install
  tools/docs: python_version: drop a debug print
  tools/docs: python_version: allow check for alternatives and bail out
  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
  docs: add support to build manpages from kerneldoc output
  tools: kernel-doc: add a see also section at man pages
  scripts: kdoc_parser.py: warn about Python version only once
  tools/docs: sphinx-* break documentation bulds on openSUSE

 Documentation/Makefile                        | 136 +---
 Documentation/doc-guide/kernel-doc.rst        |  29 +-
 Documentation/doc-guide/sphinx.rst            |   4 +-
 Documentation/sphinx/kerneldoc-preamble.sty   |   2 +-
 Documentation/sphinx/parallel-wrapper.sh      |  33 -
 .../translations/it_IT/doc-guide/sphinx.rst   |   4 +-
 .../translations/zh_CN/doc-guide/sphinx.rst   |   4 +-
 Documentation/translations/zh_CN/how-to.rst   |   2 +-
 MAINTAINERS                                   |   3 +-
 Makefile                                      |   2 +-
 scripts/jobserver-exec                        |  88 +--
 scripts/lib/jobserver.py                      | 149 ++++
 scripts/lib/kdoc/kdoc_files.py                |   5 +-
 scripts/lib/kdoc/kdoc_output.py               |  84 +-
 scripts/lib/kdoc/kdoc_parser.py               |   7 +-
 scripts/split-man.pl                          |  28 -
 tools/docs/lib/python_version.py              | 178 +++++
 tools/docs/sphinx-build-wrapper               | 739 ++++++++++++++++++
 {scripts => tools/docs}/sphinx-pre-install    | 135 +---
 19 files changed, 1265 insertions(+), 367 deletions(-)
 delete mode 100644 Documentation/sphinx/parallel-wrapper.sh
 create mode 100755 scripts/lib/jobserver.py
 delete mode 100755 scripts/split-man.pl
 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


^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2025-09-15 15:05 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04  7:33 [PATCH v4 00/19] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 01/19] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 02/19] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 03/19] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 04/19] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-09-04 16:42   ` Jonathan Corbet
2025-09-05  7:39     ` Mauro Carvalho Chehab
2025-09-05 12:25     ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 05/19] tools/docs: python_version: move version check from sphinx-pre-install Mauro Carvalho Chehab
2025-09-10 10:14   ` Jani Nikula
2025-09-10 12:24     ` Mauro Carvalho Chehab
2025-09-11 10:28       ` Jani Nikula
2025-09-11 10:45         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 06/19] tools/docs: python_version: drop a debug print Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 07/19] tools/docs: python_version: allow check for alternatives and bail out Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 08/19] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-09-09 14:53   ` Jonathan Corbet
2025-09-09 15:59     ` Mauro Carvalho Chehab
2025-09-09 18:56       ` Jonathan Corbet
2025-09-09 20:53         ` Mauro Carvalho Chehab
2025-09-09 15:21   ` Jonathan Corbet
2025-09-09 16:06     ` Mauro Carvalho Chehab
2025-09-10 10:46   ` Jani Nikula
2025-09-10 12:59     ` Mauro Carvalho Chehab
2025-09-10 13:33       ` Mauro Carvalho Chehab
2025-09-12 10:15         ` Akira Yokosawa
2025-09-12 11:04           ` Mauro Carvalho Chehab
2025-09-12 14:03             ` Akira Yokosawa
2025-09-12 14:50               ` Mauro Carvalho Chehab
2025-09-15  8:27                 ` Akira Yokosawa
2025-09-15 10:58                   ` Mauro Carvalho Chehab
2025-09-15 12:54                     ` Jani Nikula
2025-09-15 13:50                       ` Mauro Carvalho Chehab
2025-09-15 14:33                         ` Jani Nikula
2025-09-15 15:05                           ` Mauro Carvalho Chehab
2025-09-11 10:23       ` Jani Nikula
2025-09-11 11:37         ` Mauro Carvalho Chehab
2025-09-11 13:38           ` Jonathan Corbet
2025-09-11 19:33             ` Jani Nikula
2025-09-11 19:47               ` Jonathan Corbet
2025-09-12  8:06                 ` Mauro Carvalho Chehab
2025-09-12 10:16                   ` Jani Nikula
2025-09-12 11:34                     ` Vegard Nossum
2025-09-13 10:18                       ` Mauro Carvalho Chehab
2025-09-12 11:41                     ` Mauro Carvalho Chehab
2025-09-12  8:28             ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 09/19] tools/docs: sphinx-build-wrapper: add comments and blank lines Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 10/19] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-09-10 10:51   ` Jani Nikula
2025-09-12  8:46     ` Mauro Carvalho Chehab
2025-09-12  9:22       ` Jani Nikula
2025-09-12 12:34         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 11/19] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 12/19] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-09-10 10:54   ` Jani Nikula
2025-09-12  8:56     ` Mauro Carvalho Chehab
2025-09-12  9:23       ` Jani Nikula
2025-09-12 10:34         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 13/19] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 14/19] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 15/19] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 16/19] docs: add support to build manpages from kerneldoc output Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 17/19] tools: kernel-doc: add a see also section at man pages Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 18/19] scripts: kdoc_parser.py: warn about Python version only once Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 19/19] tools/docs: sphinx-* break documentation bulds on openSUSE Mauro Carvalho Chehab
2025-09-05 16:07 ` [PATCH v4 00/19] Split sphinx call logic from docs Makefile Jonathan Corbet
2025-09-06  9:40   ` Mauro Carvalho Chehab

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).