From nobody Thu Oct 2 06:17:55 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 5F16E305053; Mon, 22 Sep 2025 11:28:16 +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=1758540496; cv=none; b=us2sVGyXKBMe3uhLMv+w0FGcfxx2O5xZrsz3zPvG4iJ+s9OU+FRgc3ybL4idjB8P4D2dZus8Zbr8G7+zIOr8Y/oYv+AZER+nriN5irraPWu9kHuBo31f7Wx6TNeggbHMr2HHdDLI6mVB/FwOOXCd9Lv5BmerLnQrgjl3prlj+Ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758540496; c=relaxed/simple; bh=PrZzCy2cGIvNKyqPlF29RNpkiBN75wr7qz5JmPP/oR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DtAYWfB4sBe0IaFa7Fhor8cfsG/SK0coQBYk/57b73sIfsHgnnxQdVh2G0g3XrjOPi+Aa0u9ko/XB7xQKGVh0YWO6YpiY9x1ntWCtFvLB3oSPtMW3J2PCCHtmBFHl0hupOGEpEio9UJfpOUBn1l8UgqJLEBw+3onZe5Eijx4js8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uDhIOwyI; 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="uDhIOwyI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD4F7C116B1; Mon, 22 Sep 2025 11:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758540495; bh=PrZzCy2cGIvNKyqPlF29RNpkiBN75wr7qz5JmPP/oR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uDhIOwyIaX/Jfz/QdWhfC1ByDLg2hRGYygbuzpqXa8H4XOYc8rDFWATznPlZy72I7 qMjZaMATotRcV97OxDC4Y9Nsigjz40HXl2bYRAKJG3U++Pp5LTgNgULcapNqvCc+le 7mmnxyX2npYLNPxIIVKVIQha+Bv+e6ui3w/5HhZVBxbpekgpCrpijoVWX8hBcQC8B2 3o8nUo9P0f+V3r+9hCp78tuUQghWbSGqVXiP3p+H8psgijvxNtUkfGbAc//vMuneDi FHlboFQDuA2mW+ga+lgSXCtj7yX4vg4QRcMynhJqaQEq8VMwFikfWq6VP56MqH2KOl RqZNJcmUI9bxw== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1v0eiL-00000005vOx-3c40; Mon, 22 Sep 2025 13:28:13 +0200 From: Mauro Carvalho Chehab To: "Jonathan Corbet" , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org, Akira Yokosawa Subject: [PATCH v2 3/3] tools/docs/sphinx-build-wrapper: allow skipping sphinx-build step Date: Mon, 22 Sep 2025 13:27:40 +0200 Message-ID: <30dae295606ae1735f3bbeef4ca041a76dcd4540.1758539031.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