mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: corbet@lwn.net, jani.nikula@linux.intel.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	tmgross@umich.edu, Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH v4 08/19] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build
Date: Mon, 15 Sep 2025 17:27:17 +0900	[thread overview]
Message-ID: <aa2aa8d2-f7f1-4f04-a9b0-f08160f9ea81@gmail.com> (raw)
In-Reply-To: <6hhhn5go2yb7ecdrqtuti23i6pfgckqbdk5nhuhn2ijrhmvvmw@awswbm3tvmwp>

On Fri, 12 Sep 2025 16:50:36 +0200, Mauro Carvalho Chehab wrote:
> On Fri, Sep 12, 2025 at 11:03:43PM +0900, Akira Yokosawa wrote:
>> On Fri, 12 Sep 2025 13:04:20 +0200, Mauro Carvalho Chehab wrote:
[...]

>>> I saw it here on multiple distros including Fedora (which is the one
>>> I use on my desktop). Media jenkins CI running on Debian always suffered
>>> from such issues, up to the point I started ignoring pdf build results.
>>>
>>
>> So please provide exact steps for me to see such errors.
>
> Sorry, but I don't have enough time to try reproducing it again
> (plus, I'm ran out of disk space on my /var partition forcing me to
> reclaim the space used by my test containers).

There is no urgency on my side.  Please take your time.

>
>>
>> I don't have any issues after strictly following the suggestions from
>> sphinx-pre-install under Fedora.
>>
>> I even invoked [...]/output/latex/Makefile manually after running
>> "make latexdocs" by:
>>
>>   - cd [...]/output/latex/
>>   - make PDFLATEX="latexmk -xelatex" LATEXOPTS="-interaction=batchmode -no-shell-escape" -j6 -O all
>>
>> , and all the PDFs were built without any issues.
>>
>> Quite puzzling ...
>>
>> Or does your Fedora have some Noto CJK variable fonts installed?
>
> On my main desktop, yes, that's the case: it currently has some
> Noto CJK fonts installed. I wasn't aware about such issues
> with Fedora until today, when I noticed your check script.
>

Good. That should be a step forward, I guess.

I know you have repeatedly said it is not the purpose of this series
to fix those issues in your images, but I have an impression that it is
closely related to testing sphinx-pre-install, and the objective of this
series is to make the testing/debugging of sphinx-pre-install easier for
you.

But, at least for me, the behavior you want for "pdfdocs" is not
ideal for regular testing of .rst and kernel-doc changes in kernel
source side.  I want "make pdfdocs" to give up earlier rather than later.
It should leave relevant info near the bottom of terminal log.

Now, here are my responses to your arguments:

> In any case, this changeset fix it on several ways:
> 
> - A failure while building one pdf doesn't prevent building other
>   files. With make, it may stop before building them all (if we drop
>   the "|| exit");

Didn't you mean "(if we keep the "|| exit"); ???

If you drop the "|| exit", which will cause false-negatives.

And you are going to test every PDFs at the final stage of pdfdocs
to catch such false-positives.

Sounds like a plan.

> - It prints a summary reporting what PDF files were actually built,
>   so it is easy for the developer to know what broke (and it is
>   also easily parsed by a CI);
> - The return code is zero only if all docs were built.

I agree this is an improvement, but if we get rid of the loop construct
in the Makefile, we can forget about said false-negatives, can't we? 


How about something like the following approach?

Let's think of SPHINXDIRS="admin-guide core-api driver-api userspace-api"

In this case "make latexdocs" will generate

    output/admin-guide/latex/
    output/core-api/latex/
    output/driver-api/latex/
    output/userspace-api/latex/

They will have identical boiler-plate files latex builder would emit,
and subdir-specific files such as:

    output/admin-guide/latex/admin-guide.tex
                             c3-isp.dot
                             c3-isp.pdf
                             c3-isp.svg
                             conn-states-8.dot
                             conn-states-8.pdf
                             conn-states-8.svg
                             disk-states-8.dot
                             disk-states-8.pdf
                             disk-states-8.svg
                             ...
    output/core-api/latex/core-api.tex
    output/driver-api/latex/driver-api.tex
                            DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.dot
                            DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.pdf
                            DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.svg
                            DOT-289c17ebc0291f90ccaf431961707504464a78d4.dot
                            DOT-289c17ebc0291f90ccaf431961707504464a78d4.pdf
                            DOT-289c17ebc0291f90ccaf431961707504464a78d4.svg
                            ...
    output/userspace-api/latex/userspace-api.tex
                               DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.dot
                               DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.pdf
                               DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.svg
                               DOT-289c17ebc0291f90ccaf431961707504464a78d4.dot
                               DOT-289c17ebc0291f90ccaf431961707504464a78d4.pdf
                               DOT-289c17ebc0291f90ccaf431961707504464a78d4.svg
                               ...
                          

At a pre-processing stage of pdfdocs, you create output/latex/ and
symlink subdir-specific files needed for latexmk/xelatex into there.
(Copying them should work too.)

    output/latex/admin-guide.tex --> ../admin-guide/latex/
                 c3-isp.pdf      --> ../admin-guide/latex/
                 conn-states-8.pdf --> ../admin-guide/latex/
                 disk-states-8.pdf --> ../admin-guide/latex/
                 ...
                 core-api.tex --> ../core-api/latex/
                 driver-api.tex --> ../driver-api/latex/
                 DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.pdf --> ../driver-api/latex/
                 DOT-289c17ebc0291f90ccaf431961707504464a78d4.pdf --> ../driver-api/latex/
                 ...
                 userspace-api.tex --> ../userspace-api/
                 DOT-1e98886fceca6e25a115532f5efebb44c09dc98b.pdf --> ../userspace-api/latex/
                 DOT-289c17ebc0291f90ccaf431961707504464a78d4.pdf --> ../userspace-api/latex/
                 ...

The latexmk stage would now be identical to the SPHINXDIRS="." case,
meaning it won't need the loop in the recipe.
Furthermore, post-processing would be almost the same as the default
case.
 
As a bonus, "make -j -O" will work as the same as full pdfdocs build.

If you are interested, I think I can prepare a PoC patch, probably
after v6.18-rc1.

If your sphinx-build-wrapper's latexdocs stage can be adjusted so that
said pre-processing of pdfdocs can be made unnecessary, that would be
even better.

Regards,
Akira

  reply	other threads:[~2025-09-15  8:27 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  7:33 [PATCH v4 00/19] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 01/19] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 02/19] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 03/19] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 04/19] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-09-04 16:42   ` Jonathan Corbet
2025-09-05  7:39     ` Mauro Carvalho Chehab
2025-09-05 12:25     ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 05/19] tools/docs: python_version: move version check from sphinx-pre-install Mauro Carvalho Chehab
2025-09-10 10:14   ` Jani Nikula
2025-09-10 12:24     ` Mauro Carvalho Chehab
2025-09-11 10:28       ` Jani Nikula
2025-09-11 10:45         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 06/19] tools/docs: python_version: drop a debug print Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 07/19] tools/docs: python_version: allow check for alternatives and bail out Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 08/19] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-09-09 14:53   ` Jonathan Corbet
2025-09-09 15:59     ` Mauro Carvalho Chehab
2025-09-09 18:56       ` Jonathan Corbet
2025-09-09 20:53         ` Mauro Carvalho Chehab
2025-09-09 15:21   ` Jonathan Corbet
2025-09-09 16:06     ` Mauro Carvalho Chehab
2025-09-10 10:46   ` Jani Nikula
2025-09-10 12:59     ` Mauro Carvalho Chehab
2025-09-10 13:33       ` Mauro Carvalho Chehab
2025-09-12 10:15         ` Akira Yokosawa
2025-09-12 11:04           ` Mauro Carvalho Chehab
2025-09-12 14:03             ` Akira Yokosawa
2025-09-12 14:50               ` Mauro Carvalho Chehab
2025-09-15  8:27                 ` Akira Yokosawa [this message]
2025-09-15 10:58                   ` Mauro Carvalho Chehab
2025-09-15 12:54                     ` Jani Nikula
2025-09-15 13:50                       ` Mauro Carvalho Chehab
2025-09-15 14:33                         ` Jani Nikula
2025-09-15 15:05                           ` Mauro Carvalho Chehab
2025-09-11 10:23       ` Jani Nikula
2025-09-11 11:37         ` Mauro Carvalho Chehab
2025-09-11 13:38           ` Jonathan Corbet
2025-09-11 19:33             ` Jani Nikula
2025-09-11 19:47               ` Jonathan Corbet
2025-09-12  8:06                 ` Mauro Carvalho Chehab
2025-09-12 10:16                   ` Jani Nikula
2025-09-12 11:34                     ` Vegard Nossum
2025-09-13 10:18                       ` Mauro Carvalho Chehab
2025-09-12 11:41                     ` Mauro Carvalho Chehab
2025-09-12  8:28             ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 09/19] tools/docs: sphinx-build-wrapper: add comments and blank lines Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 10/19] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-09-10 10:51   ` Jani Nikula
2025-09-12  8:46     ` Mauro Carvalho Chehab
2025-09-12  9:22       ` Jani Nikula
2025-09-12 12:34         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 11/19] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 12/19] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-09-10 10:54   ` Jani Nikula
2025-09-12  8:56     ` Mauro Carvalho Chehab
2025-09-12  9:23       ` Jani Nikula
2025-09-12 10:34         ` Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 13/19] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 14/19] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 15/19] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 16/19] docs: add support to build manpages from kerneldoc output Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 17/19] tools: kernel-doc: add a see also section at man pages Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 18/19] scripts: kdoc_parser.py: warn about Python version only once Mauro Carvalho Chehab
2025-09-04  7:33 ` [PATCH v4 19/19] tools/docs: sphinx-* break documentation bulds on openSUSE Mauro Carvalho Chehab
2025-09-05 16:07 ` [PATCH v4 00/19] Split sphinx call logic from docs Makefile Jonathan Corbet
2025-09-06  9:40   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa2aa8d2-f7f1-4f04-a9b0-f08160f9ea81@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®