Some patches against build-script
Subsystems (2)
v2 cover Some patches against build-script
Hi Jon,
This small patch series contain 3 minor fixes/cleanups for sphinx-build-wrapper addressing some corner usecases.
Patch 1 was already submitted. It avoids 2 harmless warnings when texlive is not installed.
Patch 2 fixes the checker for latexmk (PDFLATEX env) when texlive is not installed.
Patch 3 restores the logic to store *.pyc files under builddir instead of sourcedir.
Mauro Carvalho Chehab (3):
docs: Makefile: avoid a warning when using without texlive tools/docs: sphinx-build-wrapper: pdflatex is needed only for pdf
docs: Makefile: use PYTHONPYCACHEPREFIX
Documentation/Makefile | 19 ++++++++----------- tools/docs/sphinx-build-wrapper | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-)
Signature · 1 line
2.51.0
PATCH v2 1/3 docs: Makefile: avoid a warning when using without texlive
As reported by Randy, running make htmldocs on a machine without textlive now produce warnings:
$ make O=DOCS htmldocs
../Documentation/Makefile:70: warning: overriding recipe for target 'pdfdocs'
../Documentation/Makefile:61: warning: ignoring old recipe for target 'pdfdocs'That's because the code has now two definitions for pdfdocs in case $PDFLATEX command is not found. With the new script, such special case is not needed anymore, as the script checks it.
Drop the special case. Even after dropping it, on a machine without LaTeX, it will still produce an error as expected, as running:
$ ./tools/docs/sphinx-build-wrapper pdfdocs
Error: pdflatex or latexmk required for PDF generationdoes the check. After applying the patch we have:
$ make SPHINXDIRS=peci htmldocs
Using alabaster theme
Using Python kernel-doc $ make SPHINXDIRS=peci pdfdocs
Error: pdflatex or latexmk required for PDF generation
make[2]: *** [Documentation/Makefile:64: pdfdocs] Error 1
make[1]: *** [/root/Makefile:1808: pdfdocs] Error 2
make: *** [Makefile:248: __sub-make] Error 2Which is the expected behavior.
--- Documentation/Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
Documentation/Makefile +4 -9
@@ -66,20 +66,15 @@ htmldocs mandocs infodocs texinfodocs latexdocs epubdocs xmldocs pdfdocs linkche --builddir="$(BUILDDIR)" --deny-vf=$(FONTS_CONF_DENY_VF) \ --theme=$(DOCS_THEME) --css=$(DOCS_CSS) --paper=$(PAPER) -# Special handling for pdfdocs -ifneq ($(shell which $(PDFLATEX) >/dev/null 2>&1; echo $$?),0) -pdfdocs: - $(warning The '$(PDFLATEX)' command was not found. Make sure you have it installed and in PATH to produce PDF output.) - @echo " SKIP Sphinx $@ target." -endif -htmldocs-redirects: $(srctree)/Documentation/.renames.txt - @tools/docs/gen-redirects.py --output $(BUILDDIR) < $< -endif # HAVE_SPHINX +endif # The following targets are independent of HAVE_SPHINX, and the rules should # work or silently pass without Sphinx. +htmldocs-redirects: $(srctree)/Documentation/.renames.txt + @tools/docs/gen-redirects.py --output $(BUILDDIR) < $< + refcheckdocs: $(Q)cd $(srctree);scripts/documentation-file-ref-check
Signature · 1 line
2.51.0
PATCH v2 2/3 tools/docs: sphinx-build-wrapper: pdflatex is needed only for pdf
In reply to Mauro Carvalho ChehabFix the logic which checks for pdflatex. Currently, it complains for both pdfdocs and latexdocs, but for the latter, all it is needed is Sphinx.
--- tools/docs/sphinx-build-wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/docs/sphinx-build-wrapper +1 -1
@@ -650,7 +650,7 @@ class SphinxBuilder: if not sphinxbuild and target != "mandocs": sys.exit(f"Error: {self.sphinxbuild} not found in PATH.\n") - if builder == "latex": + if target == "pdfdocs": if not self.pdflatex_cmd and not self.latexmk_cmd: sys.exit("Error: pdflatex or latexmk required for PDF generation")
Signature · 1 line
2.51.0
PATCH v2 3/3 docs: Makefile: use PYTHONPYCACHEPREFIX
In reply to Mauro Carvalho ChehabPrevious cleanup patches ended dropping it when sphinx-build-wrapper were added. Also, sphinx-pre-install can also generate caches.
So, re-add it for both.
--- Documentation/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/Makefile +4 -2
@@ -60,8 +60,10 @@ else # HAVE_SPHINX # Common documentation targets htmldocs mandocs infodocs texinfodocs latexdocs epubdocs xmldocs pdfdocs linkcheckdocs: - $(Q)@$(srctree)/tools/docs/sphinx-pre-install --version-check - +$(Q)$(PYTHON3) $(BUILD_WRAPPER) $@ \ + $(Q)PYTHONPYCACHEPREFIX="$(PYTHONPYCACHEPREFIX)" \ + $(srctree)/tools/docs/sphinx-pre-install --version-check + +$(Q)PYTHONPYCACHEPREFIX="$(PYTHONPYCACHEPREFIX)" \ + $(PYTHON3) $(BUILD_WRAPPER) $@ \ --sphinxdirs="$(SPHINXDIRS)" $(RUSTDOC) \ --builddir="$(BUILDDIR)" --deny-vf=$(FONTS_CONF_DENY_VF) \ --theme=$(DOCS_THEME) --css=$(DOCS_CSS) --paper=$(PAPER)
Signature · 1 line
2.51.0
Jonathan Corbet
maintainerQuoted 14 lines · Mauro Carvalho Chehab
Hi Jon,
This small patch series contain 3 minor fixes/cleanups for sphinx-build-wrapper addressing some corner usecases.
Patch 1 was already submitted. It avoids 2 harmless warnings when texlive is not installed.
Patch 2 fixes the checker for latexmk (PDFLATEX env) when texlive is not installed.
Patch 3 restores the logic to store *.pyc files under builddir instead of sourcedir.
Quoted 8 lines
Mauro Carvalho Chehab (3):
docs:Makefile: avoid a warning when using without texlivetools/docs: sphinx-build-wrapper: pdflatex is needed only for pdf
docs:Makefile: use PYTHONPYCACHEPREFIXDocumentation/Makefile | 19 ++++++++----------- tools/docs/sphinx-build-wrapper | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-)
Applied to the build-script branch, thanks.
jon