From nobody Wed Oct 1 22:26:38 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFD2D2EB873; Fri, 26 Sep 2025 10:16:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758881791; cv=none; b=ZrkQsmeDwyyuXLA4XkLIux+pceIZBH4XbJCGEaWFTTyKWGMyA2uW9i/x2ccuDJO/9AZsljS96ZqbUimeuDW6zMlDErABRV2HiLhuh8e4u6ir/V/Sn/an43Ndw8KFgwO8QAYN8tQNfee2jhIat/rvnJ5DxEddPQvDYRegPs0TgbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758881791; c=relaxed/simple; bh=PrZzCy2cGIvNKyqPlF29RNpkiBN75wr7qz5JmPP/oR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoXOI1eVxgl3gmhgehg4l0UFfO6u7uxR+3LutVKHvpzF3MskYASLZSv509gPvto+V1ff2W/ahJe32/fBDpI9LsXXKtndTIIFsXyX2OLYQVP5BkcRMq0PKJZJxrkFjYJk+dHgmWKLSvxyDoPxS5cgcY0A8GtTHm0Llx0pvENzbQE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g0FKX8p5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g0FKX8p5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52674C4CEF4; Fri, 26 Sep 2025 10:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758881791; bh=PrZzCy2cGIvNKyqPlF29RNpkiBN75wr7qz5JmPP/oR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0FKX8p5Ky3NFMI8lBsHmgdZcuwskAo/j8NUIQl8F9pDjIVy41NvwJcyoC+IEavfj 05L2FEH/oPwWSceHpi5UIYynLcHS484IpMLpS33ZBWiAXhtKuYRXXDCH7RDRpeP1Iq htqUcvg08T763klpDp9SX6lsYGscKiTMX1bOq2eKuPgZGFBkx04ZuZa7v9PS0MVb2F 3lUbVRKzVN1DXtRMFpzdyWKJATtFE1uMjnXaz5vz19iX29vr0YW9B4vtVJ7awWcwTt xuIwwYd5SapGr60Ycp5yf11rTrEHBeHIInhabwfsiaNQ1Lj3qT2XvYRWGQMPmPuELl foNShE29H60gA== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1v25V7-00000005Xom-1BFQ; Fri, 26 Sep 2025 12:16:29 +0200 From: Mauro Carvalho Chehab To: "Jonathan Corbet" , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , "Randy Dunlap" , linux-kernel@vger.kernel.org, Akira Yokosawa Subject: [PATCH 1/2] tools/docs/sphinx-build-wrapper: allow skipping sphinx-build step Date: Fri, 26 Sep 2025 12:16:18 +0200 Message-ID: <30dae295606ae1735f3bbeef4ca041a76dcd4540.1758881658.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Most targets have two steps: - step 1: run sphinx-build; - step 2: run a post-build logic. The second step can be as simple as copying static files like CSS, but may may also envolve running make. allowing to skip the first step helps debugging what's broken, and also allows using make command line arguments like --ignore-errors. Add an option to skip step 1. Requested-by: Akira Yokosawa Link: https://lore.kernel.org/linux-doc/5031e0c4-f17e-41b8-8955-959989e797f= 2@gmail.com/ Signed-off-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 98c4db5b7c47..cce985dced00 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -622,7 +622,8 @@ class SphinxBuilder: shutil.rmtree(self.builddir, ignore_errors=3DTrue) =20 def build(self, target, sphinxdirs=3DNone, - theme=3DNone, css=3DNone, paper=3DNone, deny_vf=3DNone, rust= doc=3DFalse): + theme=3DNone, css=3DNone, paper=3DNone, deny_vf=3DNone, rust= doc=3DFalse, + skip_sphinx=3DFalse): """ Build documentation using Sphinx. This is the core function of this module. It prepares all arguments required by sphinx-build. @@ -644,9 +645,10 @@ class SphinxBuilder: # # Other targets require sphinx-build, so check if it exists # - sphinxbuild =3D shutil.which(self.sphinxbuild, path=3Dself.env["PA= TH"]) - if not sphinxbuild and target !=3D "mandocs": - sys.exit(f"Error: {self.sphinxbuild} not found in PATH.\n") + if not skip_sphinx: + sphinxbuild =3D shutil.which(self.sphinxbuild, path=3Dself.env= ["PATH"]) + if not sphinxbuild and target !=3D "mandocs": + sys.exit(f"Error: {self.sphinxbuild} not found in PATH.\n") =20 if builder =3D=3D "latex": if not self.pdflatex_cmd and not self.latexmk_cmd: @@ -732,7 +734,7 @@ class SphinxBuilder: =20 if target =3D=3D "mandocs": self.handle_man(kerneldoc, docs_dir, src_dir, output_dir) - else: + elif not skip_sphinx: try: result =3D self.run_sphinx(sphinxbuild, build_args, env=3Dself.env) @@ -814,6 +816,9 @@ def main(): parser.add_argument('-i', '--interactive', action=3D'store_true', help=3D"Change latex default to run in interactive= mode") =20 + parser.add_argument('-s', '--skip-sphinx-build', action=3D'store_true', + help=3D"Skip sphinx-build step") + parser.add_argument("-V", "--venv", nargs=3D'?', const=3Df'{VENV_DEFAU= LT}', default=3DNone, help=3Df'If used, run Sphinx from a venv dir (defa= ult dir: {VENV_DEFAULT})') @@ -829,7 +834,8 @@ def main(): =20 builder.build(args.target, sphinxdirs=3Dargs.sphinxdirs, theme=3Dargs.theme, css=3Dargs.css, paper=3Dargs.paper, - rustdoc=3Dargs.rustdoc, deny_vf=3Dargs.deny_vf) + rustdoc=3Dargs.rustdoc, deny_vf=3Dargs.deny_vf, + skip_sphinx=3Dargs.skip_sphinx_build) =20 if __name__ =3D=3D "__main__": main() --=20 2.51.0 From nobody Wed Oct 1 22:26:38 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFDAB2EB87B; Fri, 26 Sep 2025 10:16:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758881791; cv=none; b=ss0eUmVJVYZc1MxcFM2rtzuyBAyxHVR9RJRyPPfZDvISuW/m3wmgVYaQnoVTDIY/+l1xSJFEt2VWtncXlRA5cb1cffROkK53v1jMv9WG1/Z4dWDh7YH/qHVi4fHRbQbSvovqKhC7R7JhRdvuBWmPKrUEmlea9AACYDqf4nRBa7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758881791; c=relaxed/simple; bh=qmAx3BU5iYpF0BhCqjMwryZ9h4swiPNSkQhkpvI834A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K1qVzUXXt+QHsry6GBuzuopmikdJvS6W4tCd8MS6fzG5euELmCyxPNMJmEFcetH2NG50yRaeEtVuEKYe63DrvUjjkL13PEdxdxITnUBUf56CFILbK0tg/qhlmPtEKhBwzcenJ1MkzjOo7VUklL/ZomCcwAEYTTQEJCwlStLZOKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WHU4CKYc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WHU4CKYc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55DD7C4CEF7; Fri, 26 Sep 2025 10:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758881791; bh=qmAx3BU5iYpF0BhCqjMwryZ9h4swiPNSkQhkpvI834A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHU4CKYcKEJrNeZpNzhUfnHeMgRON0t7giyIYvluFOB0MulNggBwnCXb5jdOp3mB/ Oj6YsxL68tV08KGwtlwMFWG53JottQXEeQZzVTlzPPhHHm8QhUzodNB8JCkh8wWdBh kcvGm1g4jDsNfcMup8D6jzV0xugfYB9doCoYAKoTaGsw1a2D3Tb44yv0z3d/dCxOWC pYMEAXglJjvOVhH8Xd+abi/O9QDkVHjaOlY4idD3gGWqHCnhygejR07FIoqz90Zsi+ mmCTvotO6566A7NlNLgbSSZWRc/vOs6laIGNQunkxKNcmoXtGBTkqqP7zw0HXSuKjz AzFIPRQzHHk7w== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1v25V7-00000005Xoq-1LRq; Fri, 26 Sep 2025 12:16:29 +0200 From: Mauro Carvalho Chehab To: "Jonathan Corbet" , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , "Randy Dunlap" , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] docs: Makefile: avoid a warning when using without texlive Date: Fri, 26 Sep 2025 12:16:19 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" As reported by Randy, running make htmldocs on a machine without textlive now produce warnings: $ make O=3DDOCS htmldocs ../Documentation/Makefile:70: warning: overriding recipe for target 'pd= fdocs' ../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 generation does the check. After applying the patch we have: $ make SPHINXDIRS=3Dpeci htmldocs Using alabaster theme Using Python kernel-doc $ make SPHINXDIRS=3Dpeci 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 2 Which is the expected behavior. Reported-by: Randy Dunlap Link: https://lore.kernel.org/linux-doc/e7c29532-71de-496b-a89f-743cef28736= e@infradead.org/ Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- Documentation/Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index c60db1038c9c..f764604fa1ac 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -66,20 +66,15 @@ htmldocs mandocs infodocs texinfodocs latexdocs epubdoc= s xmldocs pdfdocs linkche --builddir=3D"$(BUILDDIR)" --deny-vf=3D$(FONTS_CONF_DENY_VF) \ --theme=3D$(DOCS_THEME) --css=3D$(DOCS_CSS) --paper=3D$(PAPER) =20 -# 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 =20 -htmldocs-redirects: $(srctree)/Documentation/.renames.txt - @tools/docs/gen-redirects.py --output $(BUILDDIR) < $< -endif # HAVE_SPHINX +endif =20 # The following targets are independent of HAVE_SPHINX, and the rules shou= ld # work or silently pass without Sphinx. =20 +htmldocs-redirects: $(srctree)/Documentation/.renames.txt + @tools/docs/gen-redirects.py --output $(BUILDDIR) < $< + refcheckdocs: $(Q)cd $(srctree);scripts/documentation-file-ref-check =20 --=20 2.51.0