From 267e1c1149dffc3c558890aba92f84b6d6a222dc Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Tue, 10 Mar 2026 00:51:44 -0400 Subject: [PATCH 1/2] gh-139588: Docs: fix PDF build --- Doc/Makefile | 7 ++++++- Doc/conf.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Doc/Makefile b/Doc/Makefile index 5b7fdf8ec08ed4..7bdabd8bf168fe 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -88,6 +88,7 @@ htmlhelp: build "build/htmlhelp/pydoc.hhp project file." .PHONY: latex +latex: _ensure-sphinxcontrib-svg2pdfconverter latex: BUILDER = latex latex: build @echo "Build finished; the LaTeX files are in build/latex." @@ -231,7 +232,7 @@ dist-text: @echo "Build finished and archived!" .PHONY: dist-pdf -dist-pdf: +dist-pdf: _ensure-sphinxcontrib-svg2pdfconverter # archive the A4 latex @echo "Building LaTeX (A4 paper)..." mkdir -p dist @@ -292,6 +293,10 @@ _ensure-pre-commit: _ensure-sphinx-autobuild: $(MAKE) _ensure-package PACKAGE=sphinx-autobuild +.PHONY: _ensure-sphinxcontrib-svg2pdfconverter +_ensure-sphinxcontrib-svg2pdfconverter: + $(MAKE) _ensure-package PACKAGE=sphinxcontrib-svg2pdfconverter + .PHONY: check check: _ensure-pre-commit $(VENVDIR)/bin/python3 -m pre_commit run --all-files diff --git a/Doc/conf.py b/Doc/conf.py index a6819d4af26440..1a40105797d3a5 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -45,6 +45,7 @@ 'linklint.ext', 'notfound.extension', 'sphinxext.opengraph', + 'sphinxcontrib.rsvgconverter', ) for optional_ext in _OPTIONAL_EXTENSIONS: try: From 65b95d559ba4d0ebbbc325be19c6a60424dfa435 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Tue, 10 Mar 2026 08:36:36 -0400 Subject: [PATCH 2/2] Doc/Makefile: fix race condition in latex target When running `make -j`, the `_ensure-sphinxcontrib-svg2pdfconverter` and `build` prerequisites of the `latex` target could execute in parallel. If `build` started before the venv was created by `_ensure-sphinxcontrib-svg2pdfconverter`, `sphinx-build` would not be found and the build would fail. Fix this by removing `build` from the prerequisites and invoking it explicitly from the recipe, ensuring the venv is fully set up before the Sphinx build begins. --- Doc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/Makefile b/Doc/Makefile index 7bdabd8bf168fe..6eb466a3417626 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -88,9 +88,9 @@ htmlhelp: build "build/htmlhelp/pydoc.hhp project file." .PHONY: latex -latex: _ensure-sphinxcontrib-svg2pdfconverter latex: BUILDER = latex -latex: build +latex: _ensure-sphinxcontrib-svg2pdfconverter + $(MAKE) build BUILDER=$(BUILDER) @echo "Build finished; the LaTeX files are in build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex."