From nobody Fri Oct 3 12:13:09 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 094C3341AB1; Mon, 1 Sep 2025 14:42:37 +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=1756737758; cv=none; b=ftZlnbttbZl3v/A0u4jV/BlfKlYptKpMZJvLqrI6NDg/3jZr2w9K9ZSwMNLUf7D/8ti/9UgqnZAjIWCfN28/WnQPB75f/m+9QrWIyjWlRQ3SqMYeyV/hEaXIDv+ymJ5KnvMWRHOyv5oTUsVGuQzqI/UqzsbGsjmwrBiFN1Wgaxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756737758; c=relaxed/simple; bh=9q6X7vB/+UD8d5Co4DYpFC4MptFcOsSfJ/mYNLQGx24=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=cLlaB43Ki823k/Hs0ZF2pNsPWKWJr5vUOqLuGsYE2eOoA0ts5nEV7VnOL3SOCxkww/fsANRY9jTI6NuOZhjvPexQ2SaeX99C2Xz1GrOs+7U5ndTZrpHaqkmXE7ckTd3KIut4Nkp3q0mWuYNlHAkqC+XezTvFCPxtbHPVQXbb8wA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qx1fCkr0; 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="qx1fCkr0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75641C113CF; Mon, 1 Sep 2025 14:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756737757; bh=9q6X7vB/+UD8d5Co4DYpFC4MptFcOsSfJ/mYNLQGx24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qx1fCkr032WgtcAvyvOpm9R79Yv6R39CWG0aJUCC7iVKnPXLqWUiwLZe3Vxh61EFV dlrHEGVx6FlDxhZpWdrsG7GDTUhyRwwH0DrZ93QZDRIRaokIPsDQqOtyiLWi6g20LP YGVbNYlwHRE2GSq+p+aBKfUOr9UkxtqW4QNH6enMAObbNA8SaA9nP+lYKFrg7BsUFE TtTBhkOv3K52bWvluSPs1IJlqvCi8gE8FRtF32D0uCv+2CjAR7iyMCVn46n4M5lcvi akOoIvJKvvK7c105ZmXfHFZc1R3/8IwlwBWgYZ5yKrK7GJawSEMLKtKiyjzc7pCIHp yHMAG2PdCFgjg== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1ut5jv-00000003G3o-3ES7; Mon, 01 Sep 2025 16:42:35 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v3 11/15] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Date: Mon, 1 Sep 2025 16:42:27 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" 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 By default, we use LaTeX batch mode to build docs. This way, when an error happens, the build fails. This is good for normal builds, but when debugging problems with pdf generation, the best is to use interactive mode. We already support it via LATEXOPTS, but having a command line argument makes it easier: Interactive mode: ./scripts/sphinx-build-wrapper pdfdocs --sphinxdirs peci -v -i ... Running 'xelatex --no-pdf -no-pdf -recorder ".../Documentation/output/pe= ci/latex/peci.tex"' ... Default batch mode: ./scripts/sphinx-build-wrapper pdfdocs --sphinxdirs peci -v ... Running 'xelatex --no-pdf -no-pdf -interaction=3Dbatchmode -no-shell-esca= pe -recorder ".../Documentation/output/peci/latex/peci.tex"' ... Signed-off-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 9c5df50fb99d..4e87584a92cd 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -115,7 +115,7 @@ class SphinxBuilder: =20 return path =20 - def __init__(self, venv=3DNone, verbose=3DFalse, n_jobs=3DNone): + def __init__(self, venv=3DNone, verbose=3DFalse, n_jobs=3DNone, intera= ctive=3DNone): """Initialize internal variables""" self.venv =3D venv self.verbose =3D None @@ -126,7 +126,11 @@ class SphinxBuilder: self.kernelversion =3D os.environ.get("KERNELVERSION", "unknown") self.kernelrelease =3D os.environ.get("KERNELRELEASE", "unknown") self.pdflatex =3D os.environ.get("PDFLATEX", "xelatex") - self.latexopts =3D os.environ.get("LATEXOPTS", "-interaction=3Dbat= chmode -no-shell-escape") + + if not interactive: + self.latexopts =3D os.environ.get("LATEXOPTS", "-interaction= =3Dbatchmode -no-shell-escape") + else: + self.latexopts =3D os.environ.get("LATEXOPTS", "") =20 if not verbose: verbose =3D bool(os.environ.get("KBUILD_VERBOSE", "") !=3D "") @@ -548,6 +552,9 @@ def main(): parser.add_argument('-j', '--jobs', type=3Djobs_type, help=3D"Sets number of jobs to use with sphinx-bui= ld") =20 + parser.add_argument('-i', '--interactive', action=3D'store_true', + help=3D"Change latex default to run in interactive= mode") + 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})') @@ -557,7 +564,7 @@ def main(): PythonVersion.check_python(MIN_PYTHON_VERSION) =20 builder =3D SphinxBuilder(venv=3Dargs.venv, verbose=3Dargs.verbose, - n_jobs=3Dargs.jobs) + n_jobs=3Dargs.jobs, interactive=3Dargs.interac= tive) =20 builder.build(args.target, sphinxdirs=3Dargs.sphinxdirs, conf=3Dargs.c= onf, theme=3Dargs.theme, css=3Dargs.css, paper=3Dargs.paper) --=20 2.51.0