2022-01-03 16:30:55

by Christoph Hellwig

[permalink] [raw]
Subject: make pdfdocs fails on Debian stable

Hi Jon and Mauro,

when trying to do a make pdfdocs on my Debian stable system I can't
get it to complete. The output below is from linux-next, but mainline
is the same.

------------
Running 'xelatex --no-pdf -interaction=batchmode -no-pdf -recorder "RCU.tex"'
------------
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
Latexmk: Examining 'RCU.log'
=== TeX engine is 'XeTeX'
Latexmk: Index file 'RCU.idx' was written
Latexmk: References changed.
Latexmk: Log file says output to 'RCU.xdv'
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
xelatex: Command for 'xelatex' gave return code 1
Refer to 'RCU.log' for details
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs, or warnings treated as errors.
make[2]: *** [Makefile:29: RCU.pdf] Error 12
make[1]: *** [Documentation/Makefile:115: pdfdocs] Error 2
make: *** [Makefile:1772: pdfdocs] Error 2



2022-01-03 16:58:27

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

Em Mon, 3 Jan 2022 17:30:50 +0100
Christoph Hellwig <[email protected]> escreveu:

> Hi Jon and Mauro,
>
> when trying to do a make pdfdocs on my Debian stable system I can't
> get it to complete. The output below is from linux-next, but mainline
> is the same.
>
> ------------
> Running 'xelatex --no-pdf -interaction=batchmode -no-pdf -recorder "RCU.tex"'
> ------------
> This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/Debian) (preloaded format=xelatex)
> restricted \write18 enabled.
> entering extended mode
> Latexmk: Examining 'RCU.log'
> === TeX engine is 'XeTeX'
> Latexmk: Index file 'RCU.idx' was written
> Latexmk: References changed.
> Latexmk: Log file says output to 'RCU.xdv'
> Latexmk: Errors, so I did not complete making targets
> Collected error summary (may duplicate other messages):
> xelatex: Command for 'xelatex' gave return code 1
> Refer to 'RCU.log' for details
> Latexmk: Use the -f option to force complete processing,
> unless error was exceeding maximum runs, or warnings treated as errors.
> make[2]: *** [Makefile:29: RCU.pdf] Error 12
> make[1]: *** [Documentation/Makefile:115: pdfdocs] Error 2
> make: *** [Makefile:1772: pdfdocs] Error 2
>

Weird... when you do a make, it should have checked for all
dependencies, when it internally runs:

./scripts/sphinx-pre-install

Basically, you need the xelatex package for it to work, as PDF
output is via LaTeX. This is not a mandatory requirement, though,
as most people are only interested on html output, and LaTeX
dependencies require to install lots of stuff. it should provide you
a list of packages required for PDF, with a suggestion of using
apt-get to install it.

In this specific case, I guess the package name is 'texlive-xetex'.

Thanks,
Mauro

2022-01-03 17:11:13

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Mon, Jan 03, 2022 at 05:58:14PM +0100, Mauro Carvalho Chehab wrote:
> Weird... when you do a make, it should have checked for all
> dependencies, when it internally runs:
>
> ./scripts/sphinx-pre-install

Detected OS: Debian GNU/Linux 11 (bullseye).
Sphinx version: 3.4.3


All optional dependencies are met.
Needed package dependencies are met.

> Basically, you need the xelatex package for it to work, as PDF
> output is via LaTeX. This is not a mandatory requirement, though,
> as most people are only interested on html output, and LaTeX
> dependencies require to install lots of stuff. it should provide you
> a list of packages required for PDF, with a suggestion of using
> apt-get to install it.
>
> In this specific case, I guess the package name is 'texlive-xetex'.

texlive-xetex is installed and seems to work find on various other
documents produced earlier by make pdfdocs

2022-01-03 20:58:41

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

Em Mon, 3 Jan 2022 18:11:08 +0100
Christoph Hellwig <[email protected]> escreveu:

> On Mon, Jan 03, 2022 at 05:58:14PM +0100, Mauro Carvalho Chehab wrote:
> > Weird... when you do a make, it should have checked for all
> > dependencies, when it internally runs:
> >
> > ./scripts/sphinx-pre-install
>
> Detected OS: Debian GNU/Linux 11 (bullseye).
> Sphinx version: 3.4.3
>
>
> All optional dependencies are met.
> Needed package dependencies are met.
>
> > Basically, you need the xelatex package for it to work, as PDF
> > output is via LaTeX. This is not a mandatory requirement, though,
> > as most people are only interested on html output, and LaTeX
> > dependencies require to install lots of stuff. it should provide you
> > a list of packages required for PDF, with a suggestion of using
> > apt-get to install it.
> >
> > In this specific case, I guess the package name is 'texlive-xetex'.
>
> texlive-xetex is installed and seems to work find on various other
> documents produced earlier by make pdfdocs

Ah, the error is specific to RCU.tex then?

You'll need to re-run xelatex with -interaction=interactive, in
order to be able to identify what's the root cause.

You could do this by using LATEXOPTS, e. g.:

$ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs

With that, LaTeX will stop at the offending line from the .tex file.

On a quick test here, I'm getting these at Fedora 35:

(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)

! LaTeX Error: File `ctexhook.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

It seems that a recent change (probably to better address issues with
Chinese and Japanese translation) added an extra dependency to some
stylesheet.

I solved it by installing this package: "texlive-ctex".

The enclosed patch should fix the script for it to report such need.

Thanks,
Mauro

[PATCH] scripts: sphinx-pre-install: add required ctex dependency

After a change meant to fix support for oriental characters
(Chinese, Japanese, Korean), ctex stylesheet is now a requirement
for PDF output.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 288e86a9d1e5..46aaab414098 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -78,6 +78,7 @@ my %texlive = (
'ucs.sty' => 'texlive-ucs',
'upquote.sty' => 'texlive-upquote',
'wrapfig.sty' => 'texlive-wrapfig',
+ 'ctexhook.sty' => 'texlive-ctex',
);

#


2022-01-03 21:02:05

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: [PATCH 0/1] Detect the need of texlive-ctex

Hi Jon,

Based on Christoph's report, it seems we need to add an extra dependency
for PDF builds.

Mauro Carvalho Chehab (1):
scripts: sphinx-pre-install: add required ctex dependency

scripts/sphinx-pre-install | 1 +
1 file changed, 1 insertion(+)

--
2.33.1



2022-01-03 21:02:08

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

After a change meant to fix support for oriental characters
(Chinese, Japanese, Korean), ctex stylesheet is now a requirement
for PDF output.

Reported-by: Christoph Hellwig <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---

See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/

scripts/sphinx-pre-install | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 288e86a9d1e5..46aaab414098 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -78,6 +78,7 @@ my %texlive = (
'ucs.sty' => 'texlive-ucs',
'upquote.sty' => 'texlive-upquote',
'wrapfig.sty' => 'texlive-wrapfig',
+ 'ctexhook.sty' => 'texlive-ctex',
);

#
--
2.33.1


2022-01-03 22:46:31

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Mauro Carvalho Chehab <[email protected]> writes:

> After a change meant to fix support for oriental characters
> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
> for PDF output.
>
> Reported-by: Christoph Hellwig <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
>
> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>
> scripts/sphinx-pre-install | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index 288e86a9d1e5..46aaab414098 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -78,6 +78,7 @@ my %texlive = (
> 'ucs.sty' => 'texlive-ucs',
> 'upquote.sty' => 'texlive-upquote',
> 'wrapfig.sty' => 'texlive-wrapfig',
> + 'ctexhook.sty' => 'texlive-ctex',
> );

I've applied this, thanks.

jon

2022-01-04 00:04:37

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Hi,

On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
> Mauro Carvalho Chehab <[email protected]> writes:
>
>> After a change meant to fix support for oriental characters
>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
>> for PDF output.

FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
in June 2021.

Thanks, Akira

>>
>> Reported-by: Christoph Hellwig <[email protected]>
>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>> ---
>>
>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>>
>> scripts/sphinx-pre-install | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>> index 288e86a9d1e5..46aaab414098 100755
>> --- a/scripts/sphinx-pre-install
>> +++ b/scripts/sphinx-pre-install
>> @@ -78,6 +78,7 @@ my %texlive = (
>> 'ucs.sty' => 'texlive-ucs',
>> 'upquote.sty' => 'texlive-upquote',
>> 'wrapfig.sty' => 'texlive-wrapfig',
>> + 'ctexhook.sty' => 'texlive-ctex',
>> );
>
> I've applied this, thanks.>
> jon



2022-01-04 01:54:58

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Hi Mauro, see inline comments below.

On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
> Hi,
>
> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
>> Mauro Carvalho Chehab <[email protected]> writes:
>>
>>> After a change meant to fix support for oriental characters
>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
>>> for PDF output.
>
> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
> in June 2021.
>
> Thanks, Akira
>
>>>
>>> Reported-by: Christoph Hellwig <[email protected]>
>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>>> ---
>>>
>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>>>
>>> scripts/sphinx-pre-install | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>>> index 288e86a9d1e5..46aaab414098 100755
>>> --- a/scripts/sphinx-pre-install
>>> +++ b/scripts/sphinx-pre-install
>>> @@ -78,6 +78,7 @@ my %texlive = (
>>> 'ucs.sty' => 'texlive-ucs',
>>> 'upquote.sty' => 'texlive-upquote',
>>> 'wrapfig.sty' => 'texlive-wrapfig',
>>> + 'ctexhook.sty' => 'texlive-ctex',
>>> );
>>

I'm afraid this update of the list for Fedora/openSUSE won't help
Debian Stable (bullseye) users.

ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.

Thanks, Akria


>> I've applied this, thanks.>
>> jon
>
>

2022-01-04 02:01:18

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
> Hi,
>
> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
>> Mauro Carvalho Chehab <[email protected]> writes:
>>
>>> After a change meant to fix support for oriental characters
>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
>>> for PDF output.
>
> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
> in June 2021.

This is not the case. ctexhook.sty is required since xeCJK.sty v3.8.3
released in May 2020.

Sorry for the noise.

Thanks, Akira

>
> Thanks, Akira
>
>>>
>>> Reported-by: Christoph Hellwig <[email protected]>
>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>>> ---
>>>
>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>>>
>>> scripts/sphinx-pre-install | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>>> index 288e86a9d1e5..46aaab414098 100755
>>> --- a/scripts/sphinx-pre-install
>>> +++ b/scripts/sphinx-pre-install
>>> @@ -78,6 +78,7 @@ my %texlive = (
>>> 'ucs.sty' => 'texlive-ucs',
>>> 'upquote.sty' => 'texlive-upquote',
>>> 'wrapfig.sty' => 'texlive-wrapfig',
>>> + 'ctexhook.sty' => 'texlive-ctex',
>>> );
>>
>> I've applied this, thanks.>
>> jon
>
>

2022-01-04 06:47:20

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Mon, Jan 03, 2022 at 09:58:31PM +0100, Mauro Carvalho Chehab wrote:
> Ah, the error is specific to RCU.tex then?

Yes.

>
> You'll need to re-run xelatex with -interaction=interactive, in
> order to be able to identify what's the root cause.
>
> You could do this by using LATEXOPTS, e. g.:
>
> $ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs
>
> With that, LaTeX will stop at the offending line from the .tex file.
>
> On a quick test here, I'm getting these at Fedora 35:
>
> (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)
>
> ! LaTeX Error: File `ctexhook.sty' not found.
>
> Type X to quit or <RETURN> to proceed,
> or enter new name. (Default extension: sty)
>
> It seems that a recent change (probably to better address issues with
> Chinese and Japanese translation) added an extra dependency to some
> stylesheet.
>
> I solved it by installing this package: "texlive-ctex".

There is no texlive-ctex on Debian, but ctexhook.sty is installed as
part of texlive-extra-utils. Here are the last lines from the
interactive run:

(/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty)
(/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
Writing index file RCU.idx
(./RCU.aux)
Runaway argument?
{\contentsline {chapter}{\numberline {16}A Tour Through TREE\_RCU’s\ETC.
! File ended while scanning use of \@writefile.
<inserted text>
\par
l.191 \begin{document}

?


2022-01-04 07:32:39

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

Hi Christoph,

On Tue, 4 Jan 2022 07:47:08 +0100, Christoph Hellwig wrote:
> On Mon, Jan 03, 2022 at 09:58:31PM +0100, Mauro Carvalho Chehab wrote:
>> Ah, the error is specific to RCU.tex then?
>
> Yes.
>
>>
>> You'll need to re-run xelatex with -interaction=interactive, in
>> order to be able to identify what's the root cause.
>>
>> You could do this by using LATEXOPTS, e. g.:
>>
>> $ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs
>>
>> With that, LaTeX will stop at the offending line from the .tex file.
>>
>> On a quick test here, I'm getting these at Fedora 35:
>>
>> (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)
>>
>> ! LaTeX Error: File `ctexhook.sty' not found.
>>
>> Type X to quit or <RETURN> to proceed,
>> or enter new name. (Default extension: sty)
>>
>> It seems that a recent change (probably to better address issues with
>> Chinese and Japanese translation) added an extra dependency to some
>> stylesheet.
>>
>> I solved it by installing this package: "texlive-ctex".
>
> There is no texlive-ctex on Debian, but ctexhook.sty is installed as
> part of texlive-extra-utils. Here are the last lines from the
> interactive run:
>
> (/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty)
> (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
> (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
> Writing index file RCU.idx
> (./RCU.aux)
> Runaway argument?
> {\contentsline {chapter}{\numberline {16}A Tour Through TREE\_RCU’s\ETC.
> ! File ended while scanning use of \@writefile.
> <inserted text>
> \par
> l.191 \begin{document}
>
> ?

I suspect you are suffering from corrupt RCU.aux (or whatever other
intermediate files xelatex generates).

What happens you run

$ make cleandocs

before

$ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs

?

Thanks, Akira





2022-01-04 07:36:31

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, Jan 04, 2022 at 04:32:14PM +0900, Akira Yokosawa wrote:
> I suspect you are suffering from corrupt RCU.aux (or whatever other
> intermediate files xelatex generates).
>
> What happens you run
>
> $ make cleandocs
>
> before
>
> $ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs
>
> ?

The last lines of that below:

LaTeX Warning: Float too large for page by 8477.29312pt on input line 10581.


LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
:forcing-quiescent-states' on page 104 undefined on input line 10593.


LaTeX Warning: Float too large for page by 9533.29312pt on input line 11384.


LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
:forcing-quiescent-states' on page 104 undefined on input line 11394.

[104] [105] [106]
! Dimension too large.
\color@b@x ... #3}\kern \fboxsep }\dimen@ \ht \z@
\advance \dimen@ \fboxsep ...
l.12718 \end{sphinxVerbatim}

?

2022-01-04 07:53:23

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 08:36:25 +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 04:32:14PM +0900, Akira Yokosawa wrote:
>> I suspect you are suffering from corrupt RCU.aux (or whatever other
>> intermediate files xelatex generates).
>>
>> What happens you run
>>
>> $ make cleandocs
>>
>> before
>>
>> $ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs
>>
>> ?
>
> The last lines of that below:
>
> LaTeX Warning: Float too large for page by 8477.29312pt on input line 10581.
>
>
> LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> :forcing-quiescent-states' on page 104 undefined on input line 10593.
>
>
> LaTeX Warning: Float too large for page by 9533.29312pt on input line 11384.
>
>
> LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> :forcing-quiescent-states' on page 104 undefined on input line 11394.
>
> [104] [105] [106]
> ! Dimension too large.
> \color@b@x ... #3}\kern \fboxsep }\dimen@ \ht \z@
> \advance \dimen@ \fboxsep ...
> l.12718 \end{sphinxVerbatim}
>
> ?
>

Hmm, I can't reproduce this on docs-next.
On which tree are you building RCU.pdf?

Thanks, Akira


2022-01-04 07:57:00

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, Jan 04, 2022 at 04:53:15PM +0900, Akira Yokosawa wrote:
> Hmm, I can't reproduce this on docs-next.
> On which tree are you building RCU.pdf?

Current linux-next. But I've also seen it with mainline from a few days
ago.

2022-01-04 08:05:57

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Em Tue, 4 Jan 2022 10:54:52 +0900
Akira Yokosawa <[email protected]> escreveu:

> Hi Mauro, see inline comments below.
>
> On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
> > Hi,
> >
> > On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
> >> Mauro Carvalho Chehab <[email protected]> writes:
> >>
> >>> After a change meant to fix support for oriental characters
> >>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
> >>> for PDF output.
> >
> > FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
> > in June 2021.
> >
> > Thanks, Akira
> >
> >>>
> >>> Reported-by: Christoph Hellwig <[email protected]>
> >>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> >>> ---
> >>>
> >>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
> >>>
> >>> scripts/sphinx-pre-install | 1 +
> >>> 1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> >>> index 288e86a9d1e5..46aaab414098 100755
> >>> --- a/scripts/sphinx-pre-install
> >>> +++ b/scripts/sphinx-pre-install
> >>> @@ -78,6 +78,7 @@ my %texlive = (
> >>> 'ucs.sty' => 'texlive-ucs',
> >>> 'upquote.sty' => 'texlive-upquote',
> >>> 'wrapfig.sty' => 'texlive-wrapfig',
> >>> + 'ctexhook.sty' => 'texlive-ctex',
> >>> );
> >>
>
> I'm afraid this update of the list for Fedora/openSUSE won't help
> Debian Stable (bullseye) users.
>
> ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.

On such case, it is needed to map it for Debian/Ubuntu.
Could you please test the enclosed patch, applied on the top
of the previous one?

Thanks!
Mauro

-

[PATCH] scripts: sphinx-pre-install: Fix ctex support on Debian

The name of the package with ctexhook.sty is different on
Debian/Ubuntu.

Reported-by: Akira Yokosawa <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 46aaab414098..ea96d18ee946 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -367,6 +367,7 @@ sub give_debian_hints()
"Pod::Usage" => "perl-modules",
"xelatex" => "texlive-xetex",
"rsvg-convert" => "librsvg2-bin",
+ "texlive-ctex" => "texlive-lang-chinese",
);

if ($pdf) {

2022-01-04 08:07:28

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 08:56:55 +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 04:53:15PM +0900, Akira Yokosawa wrote:
>> Hmm, I can't reproduce this on docs-next.
>> On which tree are you building RCU.pdf?
>
> Current linux-next. But I've also seen it with mainline from a few days
> ago.
>

Still can't reproduce with sphinx-build 4.3.2 on Debian bullseye.

What version of Sphinx are you using?


2022-01-04 08:16:59

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, Jan 04, 2022 at 05:07:20PM +0900, Akira Yokosawa wrote:
> > Current linux-next. But I've also seen it with mainline from a few days
> > ago.
> >
>
> Still can't reproduce with sphinx-build 4.3.2 on Debian bullseye.
>
> What version of Sphinx are you using?

The one that comes from Debian:

hch@brick:~/work/linux-next$ sphinx-build --version
sphinx-build 3.4.3

2022-01-04 08:44:48

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 09:16:54 +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 05:07:20PM +0900, Akira Yokosawa wrote:
>>> Current linux-next. But I've also seen it with mainline from a few days
>>> ago.
>>>
>>
>> Still can't reproduce with sphinx-build 4.3.2 on Debian bullseye.
>>
>> What version of Sphinx are you using?
>
> The one that comes from Debian:
>
> hch@brick:~/work/linux-next$ sphinx-build --version
> sphinx-build 3.4.3
>

Ah, I'm not able to test distro Python packages at the moment.

At least I tried Sphinx 3.4.3 installed in a venv, but I could not
reproduce the error you encountered.

Hmm??


2022-01-04 09:31:08

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 08:36:25 +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 04:32:14PM +0900, Akira Yokosawa wrote:
>> I suspect you are suffering from corrupt RCU.aux (or whatever other
>> intermediate files xelatex generates).
>>
>> What happens you run
>>
>> $ make cleandocs
>>
>> before
>>
>> $ make SPHINXDIRS=RCU LATEXOPTS="-interaction=interactive" pdfdocs
>>
>> ?
>
> The last lines of that below:
>
> LaTeX Warning: Float too large for page by 8477.29312pt on input line 10581.
>
>
> LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> :forcing-quiescent-states' on page 104 undefined on input line 10593.
>
>
> LaTeX Warning: Float too large for page by 9533.29312pt on input line 11384.
>
>
> LaTeX Warning: Hyper reference `Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> :forcing-quiescent-states' on page 104 undefined on input line 11394.
>
> [104] [105] [106]
> ! Dimension too large.
> \color@b@x ... #3}\kern \fboxsep }\dimen@ \ht \z@
> \advance \dimen@ \fboxsep ...
> l.12718 \end{sphinxVerbatim}
>
> ?
>

Hi, getting back to the error message, I remember seeing a similar error
when I failed to permit PDF output of ImageMagick.

What I did back then was this (as root):

# cd /etc/ImageMagick-6
# sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml ; \

In case this resolves your issue.

Thanks, Akira

2022-01-04 10:26:17

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

On Tue, 4 Jan 2022 09:05:48 +0100, Mauro Carvalho Chehab wrote:
> Em Tue, 4 Jan 2022 10:54:52 +0900
> Akira Yokosawa <[email protected]> escreveu:
>
>> Hi Mauro, see inline comments below.
>>
>> On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
>>> Hi,
>>>
>>> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
>>>> Mauro Carvalho Chehab <[email protected]> writes:
>>>>
>>>>> After a change meant to fix support for oriental characters
>>>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
>>>>> for PDF output.
>>>
>>> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
>>> in June 2021.
>>>
>>> Thanks, Akira
>>>
>>>>>
>>>>> Reported-by: Christoph Hellwig <[email protected]>
>>>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>>>>> ---
>>>>>
>>>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>>>>>
>>>>> scripts/sphinx-pre-install | 1 +
>>>>> 1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>>>>> index 288e86a9d1e5..46aaab414098 100755
>>>>> --- a/scripts/sphinx-pre-install
>>>>> +++ b/scripts/sphinx-pre-install
>>>>> @@ -78,6 +78,7 @@ my %texlive = (
>>>>> 'ucs.sty' => 'texlive-ucs',
>>>>> 'upquote.sty' => 'texlive-upquote',
>>>>> 'wrapfig.sty' => 'texlive-wrapfig',
>>>>> + 'ctexhook.sty' => 'texlive-ctex',
>>>>> );
>>>>
>>
>> I'm afraid this update of the list for Fedora/openSUSE won't help
>> Debian Stable (bullseye) users.
>>
>> ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.
>
> On such case, it is needed to map it for Debian/Ubuntu.
> Could you please test the enclosed patch, applied on the top
> of the previous one?

Looks like we need an additional hunk. See below.

Thanks, Akira

>
> Thanks!
> Mauro
>
> -
>
> [PATCH] scripts: sphinx-pre-install: Fix ctex support on Debian
>
> The name of the package with ctexhook.sty is different on
> Debian/Ubuntu.
>
> Reported-by: Akira Yokosawa <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index 46aaab414098..ea96d18ee946 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -367,6 +367,7 @@ sub give_debian_hints()
> "Pod::Usage" => "perl-modules",
> "xelatex" => "texlive-xetex",
> "rsvg-convert" => "librsvg2-bin",
> + "texlive-ctex" => "texlive-lang-chinese",
> );
>
> if ($pdf) {
>
@@ -380,6 +381,7 @@ sub give_debian_hints()
}

check_program("dvipng", 2) if ($pdf);
+ check_missing_tex(2) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);


2022-01-04 13:19:59

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, Jan 04, 2022 at 06:31:01PM +0900, Akira Yokosawa wrote:
> Hi, getting back to the error message, I remember seeing a similar error
> when I failed to permit PDF output of ImageMagick.
>
> What I did back then was this (as root):
>
> # cd /etc/ImageMagick-6
> # sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml ; \
>
> In case this resolves your issue.

I've definitively seen permission denied errors earlier in the (rather
noisy) build log. But I absolutely do not feel comfortable changing
global security policies for a kernel build, especially for something
like ImageMagic that had its fair share of security issues. Is there any
way to side step this by using a different tool?

2022-01-04 13:47:03

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 14:19:52 +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 06:31:01PM +0900, Akira Yokosawa wrote:
>> Hi, getting back to the error message, I remember seeing a similar error
>> when I failed to permit PDF output of ImageMagick.
>>
>> What I did back then was this (as root):
>>
>> # cd /etc/ImageMagick-6
>> # sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml ; \
>>
>> In case this resolves your issue.
>
> I've definitively seen permission denied errors earlier in the (rather
> noisy) build log. But I absolutely do not feel comfortable changing
> global security policies for a kernel build, especially for something
> like ImageMagic that had its fair share of security issues. Is there any
> way to side step this by using a different tool?
>

See my pending patch set at:

https://lore.kernel.org/linux-doc/[email protected]
[PATCH v2 0/4] docs: sphinx/kfigure.py: Improve conversion to PDF

This uses Inkscape if it is available instead of ImageMagick.
No imagemagick nor librsvg2-bin is required.
As long as if you can trust Inkscape...

Good luck!

Thanks, Akira

2022-01-05 01:47:47

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Tue, 4 Jan 2022 22:46:57 +0900, Akira Yokosawa wrote:
> On Tue, 4 Jan 2022 14:19:52 +0100, Christoph Hellwig wrote:
>> On Tue, Jan 04, 2022 at 06:31:01PM +0900, Akira Yokosawa wrote:
>>> Hi, getting back to the error message, I remember seeing a similar error
>>> when I failed to permit PDF output of ImageMagick.
>>>
>>> What I did back then was this (as root):
>>>
>>> # cd /etc/ImageMagick-6
>>> # sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml ; \
>>>
>>> In case this resolves your issue.
>>
>> I've definitively seen permission denied errors earlier in the (rather
>> noisy) build log. But I absolutely do not feel comfortable changing
>> global security policies for a kernel build, especially for something
>> like ImageMagic that had its fair share of security issues. Is there any
>> way to side step this by using a different tool?
>>
>
> See my pending patch set at:
>
> https://lore.kernel.org/linux-doc/[email protected]
> [PATCH v2 0/4] docs: sphinx/kfigure.py: Improve conversion to PDF
>
> This uses Inkscape if it is available instead of ImageMagick.
> No imagemagick nor librsvg2-bin is required.
> As long as if you can trust Inkscape...
>
> Good luck!

Alternatively, you can avoid ImageMagick by installing
graphicsmagick-imagemagick-compat instead of imagemagick.

I'm not sure what you think of GraphicsMagick, though.

If you'd like to try, do:

$ sudo apt install graphicsmagick-imagemagick-compat ghostscript gsfonts-x11

This will remove ImageMagick.
(You have ghostscript and gsfonts-x11 already installed, I guess.)

Thanks, Akira

>
> Thanks, Akira
>

2022-01-05 07:35:12

by Christoph Hellwig

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Wed, Jan 05, 2022 at 10:47:40AM +0900, Akira Yokosawa wrote:
> > See my pending patch set at:
> >
> > https://lore.kernel.org/linux-doc/[email protected]
> > [PATCH v2 0/4] docs: sphinx/kfigure.py: Improve conversion to PDF
> >
> > This uses Inkscape if it is available instead of ImageMagick.
> > No imagemagick nor librsvg2-bin is required.
> > As long as if you can trust Inkscape...

I haven't gotten to try that yet..

> Alternatively, you can avoid ImageMagick by installing
> graphicsmagick-imagemagick-compat instead of imagemagick.
>
> I'm not sure what you think of GraphicsMagick, though.
>
> If you'd like to try, do:
>
> $ sudo apt install graphicsmagick-imagemagick-compat ghostscript gsfonts-x11
>
> This will remove ImageMagick.
> (You have ghostscript and gsfonts-x11 already installed, I guess.)

This works just fine, thanks.

2022-01-05 07:48:19

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Em Tue, 4 Jan 2022 19:26:10 +0900
Akira Yokosawa <[email protected]> escreveu:

> On Tue, 4 Jan 2022 09:05:48 +0100, Mauro Carvalho Chehab wrote:
> > Em Tue, 4 Jan 2022 10:54:52 +0900
> > Akira Yokosawa <[email protected]> escreveu:
> >
> >> Hi Mauro, see inline comments below.
> >>
> >> On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
> >>> Hi,
> >>>
> >>> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
> >>>> Mauro Carvalho Chehab <[email protected]> writes:
> >>>>
> >>>>> After a change meant to fix support for oriental characters
> >>>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
> >>>>> for PDF output.
> >>>
> >>> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
> >>> in June 2021.
> >>>
> >>> Thanks, Akira
> >>>
> >>>>>
> >>>>> Reported-by: Christoph Hellwig <[email protected]>
> >>>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> >>>>> ---
> >>>>>
> >>>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
> >>>>>
> >>>>> scripts/sphinx-pre-install | 1 +
> >>>>> 1 file changed, 1 insertion(+)
> >>>>>
> >>>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> >>>>> index 288e86a9d1e5..46aaab414098 100755
> >>>>> --- a/scripts/sphinx-pre-install
> >>>>> +++ b/scripts/sphinx-pre-install
> >>>>> @@ -78,6 +78,7 @@ my %texlive = (
> >>>>> 'ucs.sty' => 'texlive-ucs',
> >>>>> 'upquote.sty' => 'texlive-upquote',
> >>>>> 'wrapfig.sty' => 'texlive-wrapfig',
> >>>>> + 'ctexhook.sty' => 'texlive-ctex',
> >>>>> );
> >>>>
> >>
> >> I'm afraid this update of the list for Fedora/openSUSE won't help
> >> Debian Stable (bullseye) users.
> >>
> >> ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.
> >
> > On such case, it is needed to map it for Debian/Ubuntu.
> > Could you please test the enclosed patch, applied on the top
> > of the previous one?
>
> Looks like we need an additional hunk. See below.
>
> Thanks, Akira
>
> >
> > Thanks!
> > Mauro
> >
> > -
> >
> > [PATCH] scripts: sphinx-pre-install: Fix ctex support on Debian
> >
> > The name of the package with ctexhook.sty is different on
> > Debian/Ubuntu.
> >
> > Reported-by: Akira Yokosawa <[email protected]>
> > Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> >
> > diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> > index 46aaab414098..ea96d18ee946 100755
> > --- a/scripts/sphinx-pre-install
> > +++ b/scripts/sphinx-pre-install
> > @@ -367,6 +367,7 @@ sub give_debian_hints()
> > "Pod::Usage" => "perl-modules",
> > "xelatex" => "texlive-xetex",
> > "rsvg-convert" => "librsvg2-bin",
> > + "texlive-ctex" => "texlive-lang-chinese",
> > );
> >
> > if ($pdf) {
> >
> @@ -380,6 +381,7 @@ sub give_debian_hints()
> }
>
> check_program("dvipng", 2) if ($pdf);
> + check_missing_tex(2) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
>

This would be more complex than that, and per-distro tests are
required, in order to avoid the script to fail on other
distros.

Something like the following (possibly incomplete) patch.

Thanks,
Mauro

[PATCH RFC] scripts: sphinx-pre-install: better handle pdf dependencies

Not all distro hints check for missing LaTeX dependencies.
So add a call for it for check_missing_tex() to all distros.

While here, change the parameters to pass the map hash, as
distro-specific mapping could be needed.

Reported-by: Akira Yokosawa <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index ea96d18ee946..03c252590e54 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -227,7 +227,8 @@ sub check_pacman_missing($$)

sub check_missing_tex($)
{
- my $is_optional = shift;
+ my $map = %{$_[0]};
+ my $is_optional = 2;
my $kpsewhich = findprog("kpsewhich");

foreach my $prog(keys %texlive) {
@@ -381,6 +382,7 @@ sub give_debian_hints()
}

check_program("dvipng", 2) if ($pdf);
+ check_missing_tex(\%map) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);
@@ -449,7 +451,7 @@ sub give_redhat_hints()

check_rpm_missing(\@fedora26_opt_pkgs, 2) if ($pdf && !$old);
check_rpm_missing(\@fedora_tex_pkgs, 2) if ($pdf);
- check_missing_tex(2) if ($pdf);
+ check_missing_tex(\%map) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);
@@ -503,7 +505,7 @@ sub give_opensuse_hints()
# "Noto Sans CJK SC" on openSUSE

check_rpm_missing(\@suse_tex_pkgs, 2) if ($pdf);
- check_missing_tex(2) if ($pdf);
+ check_missing_tex(\%map) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);
@@ -548,6 +550,7 @@ sub give_mageia_hints()
}

check_rpm_missing(\@tex_pkgs, 2) if ($pdf);
+ # check_missing_tex(\%map) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);
@@ -578,6 +581,7 @@ sub give_arch_linux_hints()
"noto-fonts-cjk", 2);
}

+ check_missing_tex(\%map) if ($pdf);
check_missing(\%map);

return if (!$need && !$optional);
@@ -604,6 +608,8 @@ sub give_gentoo_hints()
"media-fonts/noto-cjk", 2);
}

+ # Gentoo doesn't need to map tex, as there's a single package,
+ # and extra fonts are mapped via check_missing_file()
check_missing(\%map);

return if (!$need && !$optional);
@@ -622,7 +628,7 @@ sub give_gentoo_hints()
printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
}

- printf("\tsudo emerge --ask $install\n");
+ printf("\tsudo USE="-cjk" emerge --ask $install\n");

}

@@ -685,7 +691,7 @@ sub check_distros()
my %map = (
"sphinx-build" => "sphinx"
);
- check_missing_tex(2) if ($pdf);
+ check_missing_tex(\%map) if ($pdf);
check_missing(\%map);
print "I don't know distro $system_release.\n";
print "So, I can't provide you a hint with the install procedure.\n";


2022-01-05 12:03:26

by Akira Yokosawa

[permalink] [raw]
Subject: Re: make pdfdocs fails on Debian stable

On Wed, 5 Jan 2022 08:35:04 +0100, Christoph Hellwig wrote:
> On Wed, Jan 05, 2022 at 10:47:40AM +0900, Akira Yokosawa wrote:
>>> See my pending patch set at:
>>>
>>> https://lore.kernel.org/linux-doc/[email protected]
>>> [PATCH v2 0/4] docs: sphinx/kfigure.py: Improve conversion to PDF
>>>
>>> This uses Inkscape if it is available instead of ImageMagick.
>>> No imagemagick nor librsvg2-bin is required.
>>> As long as if you can trust Inkscape...
>
> I haven't gotten to try that yet..
>
>> Alternatively, you can avoid ImageMagick by installing
>> graphicsmagick-imagemagick-compat instead of imagemagick.
>>
>> I'm not sure what you think of GraphicsMagick, though.
>>
>> If you'd like to try, do:
>>
>> $ sudo apt install graphicsmagick-imagemagick-compat ghostscript gsfonts-x11
>>
>> This will remove ImageMagick.
>> (You have ghostscript and gsfonts-x11 already installed, I guess.)
>
> This works just fine, thanks.

Nice!

Glad to know I could help you.

Thanks, Akira

>

2022-01-05 12:10:08

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

On Wed, 5 Jan 2022 08:48:09 +0100, Mauro Carvalho Chehab wrote:
> Em Tue, 4 Jan 2022 19:26:10 +0900
> Akira Yokosawa <[email protected]> escreveu:
>
>> On Tue, 4 Jan 2022 09:05:48 +0100, Mauro Carvalho Chehab wrote:
>>> Em Tue, 4 Jan 2022 10:54:52 +0900
>>> Akira Yokosawa <[email protected]> escreveu:
>>>
>>>> Hi Mauro, see inline comments below.
>>>>
>>>> On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
>>>>> Hi,
>>>>>
>>>>> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
>>>>>> Mauro Carvalho Chehab <[email protected]> writes:
>>>>>>
>>>>>>> After a change meant to fix support for oriental characters
>>>>>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
>>>>>>> for PDF output.
>>>>>
>>>>> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
>>>>> in June 2021.
>>>>>
>>>>> Thanks, Akira
>>>>>
>>>>>>>
>>>>>>> Reported-by: Christoph Hellwig <[email protected]>
>>>>>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>>>>>>> ---
>>>>>>>
>>>>>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
>>>>>>>
>>>>>>> scripts/sphinx-pre-install | 1 +
>>>>>>> 1 file changed, 1 insertion(+)
>>>>>>>
>>>>>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>>>>>>> index 288e86a9d1e5..46aaab414098 100755
>>>>>>> --- a/scripts/sphinx-pre-install
>>>>>>> +++ b/scripts/sphinx-pre-install
>>>>>>> @@ -78,6 +78,7 @@ my %texlive = (
>>>>>>> 'ucs.sty' => 'texlive-ucs',
>>>>>>> 'upquote.sty' => 'texlive-upquote',
>>>>>>> 'wrapfig.sty' => 'texlive-wrapfig',
>>>>>>> + 'ctexhook.sty' => 'texlive-ctex',
>>>>>>> );
>>>>>>
>>>>
>>>> I'm afraid this update of the list for Fedora/openSUSE won't help
>>>> Debian Stable (bullseye) users.
>>>>
>>>> ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.
>>>
>>> On such case, it is needed to map it for Debian/Ubuntu.
>>> Could you please test the enclosed patch, applied on the top
>>> of the previous one?
>>
>> Looks like we need an additional hunk. See below.
>>
>> Thanks, Akira
>>
>>>
>>> Thanks!
>>> Mauro
>>>
>>> -
>>>
>>> [PATCH] scripts: sphinx-pre-install: Fix ctex support on Debian
>>>
>>> The name of the package with ctexhook.sty is different on
>>> Debian/Ubuntu.
>>>
>>> Reported-by: Akira Yokosawa <[email protected]>
>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>>>
>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
>>> index 46aaab414098..ea96d18ee946 100755
>>> --- a/scripts/sphinx-pre-install
>>> +++ b/scripts/sphinx-pre-install
>>> @@ -367,6 +367,7 @@ sub give_debian_hints()
>>> "Pod::Usage" => "perl-modules",
>>> "xelatex" => "texlive-xetex",
>>> "rsvg-convert" => "librsvg2-bin",
>>> + "texlive-ctex" => "texlive-lang-chinese",
>>> );
>>>
>>> if ($pdf) {
>>>
>> @@ -380,6 +381,7 @@ sub give_debian_hints()
>> }
>>
>> check_program("dvipng", 2) if ($pdf);
>> + check_missing_tex(2) if ($pdf);
>> check_missing(\%map);
>>
>> return if (!$need && !$optional);
>>
>
> This would be more complex than that, and per-distro tests are
> required, in order to avoid the script to fail on other
> distros.

Thank you for looking into this!
I must admit I'm far from grasping how this perl script works...

>
> Something like the following (possibly incomplete) patch.

I'll test it under various distros/setups.
It may take a while.

Thanks, Akira

>
> Thanks,
> Mauro
>
> [PATCH RFC] scripts: sphinx-pre-install: better handle pdf dependencies
>
> Not all distro hints check for missing LaTeX dependencies.
> So add a call for it for check_missing_tex() to all distros.
>
> While here, change the parameters to pass the map hash, as
> distro-specific mapping could be needed.
>
> Reported-by: Akira Yokosawa <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index ea96d18ee946..03c252590e54 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -227,7 +227,8 @@ sub check_pacman_missing($$)
>
> sub check_missing_tex($)
> {
> - my $is_optional = shift;
> + my $map = %{$_[0]};
> + my $is_optional = 2;
> my $kpsewhich = findprog("kpsewhich");
>
> foreach my $prog(keys %texlive) {
> @@ -381,6 +382,7 @@ sub give_debian_hints()
> }
>
> check_program("dvipng", 2) if ($pdf);
> + check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -449,7 +451,7 @@ sub give_redhat_hints()
>
> check_rpm_missing(\@fedora26_opt_pkgs, 2) if ($pdf && !$old);
> check_rpm_missing(\@fedora_tex_pkgs, 2) if ($pdf);
> - check_missing_tex(2) if ($pdf);
> + check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -503,7 +505,7 @@ sub give_opensuse_hints()
> # "Noto Sans CJK SC" on openSUSE
>
> check_rpm_missing(\@suse_tex_pkgs, 2) if ($pdf);
> - check_missing_tex(2) if ($pdf);
> + check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -548,6 +550,7 @@ sub give_mageia_hints()
> }
>
> check_rpm_missing(\@tex_pkgs, 2) if ($pdf);
> + # check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -578,6 +581,7 @@ sub give_arch_linux_hints()
> "noto-fonts-cjk", 2);
> }
>
> + check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -604,6 +608,8 @@ sub give_gentoo_hints()
> "media-fonts/noto-cjk", 2);
> }
>
> + # Gentoo doesn't need to map tex, as there's a single package,
> + # and extra fonts are mapped via check_missing_file()
> check_missing(\%map);
>
> return if (!$need && !$optional);
> @@ -622,7 +628,7 @@ sub give_gentoo_hints()
> printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
> }
>
> - printf("\tsudo emerge --ask $install\n");
> + printf("\tsudo USE="-cjk" emerge --ask $install\n");
>
> }
>
> @@ -685,7 +691,7 @@ sub check_distros()
> my %map = (
> "sphinx-build" => "sphinx"
> );
> - check_missing_tex(2) if ($pdf);
> + check_missing_tex(\%map) if ($pdf);
> check_missing(\%map);
> print "I don't know distro $system_release.\n";
> print "So, I can't provide you a hint with the install procedure.\n";
>

2022-01-05 21:42:42

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Em Wed, 5 Jan 2022 21:09:59 +0900
Akira Yokosawa <[email protected]> escreveu:

> On Wed, 5 Jan 2022 08:48:09 +0100, Mauro Carvalho Chehab wrote:
> > Em Tue, 4 Jan 2022 19:26:10 +0900
> > Akira Yokosawa <[email protected]> escreveu:
> >
> >> On Tue, 4 Jan 2022 09:05:48 +0100, Mauro Carvalho Chehab wrote:
> >>> Em Tue, 4 Jan 2022 10:54:52 +0900
> >>> Akira Yokosawa <[email protected]> escreveu:
> >>>
> >>>> Hi Mauro, see inline comments below.
> >>>>
> >>>> On Tue, 4 Jan 2022 09:04:30 +0900, Akira Yokosawa wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On Mon, 03 Jan 2022 15:46:30 -0700, Jonathan Corbet <[email protected]> wrote:
> >>>>>> Mauro Carvalho Chehab <[email protected]> writes:
> >>>>>>
> >>>>>>> After a change meant to fix support for oriental characters
> >>>>>>> (Chinese, Japanese, Korean), ctex stylesheet is now a requirement
> >>>>>>> for PDF output.
> >>>>>
> >>>>> FWIW, ctexhook.sty is a new requirement of xeCJK.sty v3.8.7 released
> >>>>> in June 2021.
> >>>>>
> >>>>> Thanks, Akira
> >>>>>
> >>>>>>>
> >>>>>>> Reported-by: Christoph Hellwig <[email protected]>
> >>>>>>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> >>>>>>> ---
> >>>>>>>
> >>>>>>> See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
> >>>>>>>
> >>>>>>> scripts/sphinx-pre-install | 1 +
> >>>>>>> 1 file changed, 1 insertion(+)
> >>>>>>>
> >>>>>>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> >>>>>>> index 288e86a9d1e5..46aaab414098 100755
> >>>>>>> --- a/scripts/sphinx-pre-install
> >>>>>>> +++ b/scripts/sphinx-pre-install
> >>>>>>> @@ -78,6 +78,7 @@ my %texlive = (
> >>>>>>> 'ucs.sty' => 'texlive-ucs',
> >>>>>>> 'upquote.sty' => 'texlive-upquote',
> >>>>>>> 'wrapfig.sty' => 'texlive-wrapfig',
> >>>>>>> + 'ctexhook.sty' => 'texlive-ctex',
> >>>>>>> );
> >>>>>>
> >>>>
> >>>> I'm afraid this update of the list for Fedora/openSUSE won't help
> >>>> Debian Stable (bullseye) users.
> >>>>
> >>>> ctexhook.sty is in texlive-lang-chinese on Debian/Ubuntu.
> >>>
> >>> On such case, it is needed to map it for Debian/Ubuntu.
> >>> Could you please test the enclosed patch, applied on the top
> >>> of the previous one?
> >>
> >> Looks like we need an additional hunk. See below.
> >>
> >> Thanks, Akira
> >>
> >>>
> >>> Thanks!
> >>> Mauro
> >>>
> >>> -
> >>>
> >>> [PATCH] scripts: sphinx-pre-install: Fix ctex support on Debian
> >>>
> >>> The name of the package with ctexhook.sty is different on
> >>> Debian/Ubuntu.
> >>>
> >>> Reported-by: Akira Yokosawa <[email protected]>
> >>> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> >>>
> >>> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> >>> index 46aaab414098..ea96d18ee946 100755
> >>> --- a/scripts/sphinx-pre-install
> >>> +++ b/scripts/sphinx-pre-install
> >>> @@ -367,6 +367,7 @@ sub give_debian_hints()
> >>> "Pod::Usage" => "perl-modules",
> >>> "xelatex" => "texlive-xetex",
> >>> "rsvg-convert" => "librsvg2-bin",
> >>> + "texlive-ctex" => "texlive-lang-chinese",
> >>> );
> >>>
> >>> if ($pdf) {
> >>>
> >> @@ -380,6 +381,7 @@ sub give_debian_hints()
> >> }
> >>
> >> check_program("dvipng", 2) if ($pdf);
> >> + check_missing_tex(2) if ($pdf);
> >> check_missing(\%map);
> >>
> >> return if (!$need && !$optional);
> >>
> >
> > This would be more complex than that, and per-distro tests are
> > required, in order to avoid the script to fail on other
> > distros.
>
> Thank you for looking into this!
> I must admit I'm far from grasping how this perl script works...
>
> >
> > Something like the following (possibly incomplete) patch.
>
> I'll test it under various distros/setups.
> It may take a while.

Did a quick test here with this lxc container:

$ OS=debian REL=bullseye ;lxc-create -n ${OS} -t /usr/share/lxc/templates/lxc-download -- --dist ${OS} --release ${REL} --arch amd64

If we add check_missing_tex(), it will then complain about lots
of packages that don't exist in Debian (se logs at the end).

That's one of the biggest issue with texlive: each distro splits it on
different ways. So, basically, the %texlive hash at the script is meant
to the way Fedora and openSuse distros usually map packages. I would
expect that Mageia would also be similar if not identical, but other
distros map packages on different ways.

I'll prepare another patch for fixing the debian issue.

Regards,
Mauro

---

mchehab@debian:~/docs$ make pdfdocs
Documentation/Makefile:41: The 'sphinx-build' command was not found. Make sure you have Sphinx installed and in PATH, or set the SPHINXBUILD make variable to point to the full path of the 'sphinx-build' executable.

Detected OS: Debian GNU/Linux 11.
Warning: better to also install "convert".
Warning: better to also install "dot".
Warning: better to also install "dvipng".
Warning: better to also install "fonts-dejavu".
Warning: better to also install "fonts-noto-cjk".
ERROR: please install "gcc", otherwise, build won't work.
Warning: better to also install "latexmk".
ERROR: please install "python", otherwise, build won't work.
Warning: better to also install "rsvg-convert".
Warning: better to also install "texlive-amscls".
Warning: better to also install "texlive-amsfonts".
Warning: better to also install "texlive-amsmath".
Warning: better to also install "texlive-anyfontsize".
Warning: better to also install "texlive-capt-of".
Warning: better to also install "texlive-cmap".
Warning: better to also install "texlive-ctex".
Warning: better to also install "texlive-ec".
Warning: better to also install "texlive-eqparbox".
Warning: better to also install "texlive-euenc".
Warning: better to also install "texlive-fancybox".
Warning: better to also install "texlive-fancyvrb".
Warning: better to also install "texlive-float".
Warning: better to also install "texlive-fncychap".
Warning: better to also install "texlive-framed".
Warning: better to also install "texlive-luatex85".
Warning: better to also install "texlive-mdwtools".
Warning: better to also install "texlive-multirow".
Warning: better to also install "texlive-needspace".
Warning: better to also install "texlive-oberdiek".
Warning: better to also install "texlive-parskip".
Warning: better to also install "texlive-polyglossia".
Warning: better to also install "texlive-psnfss".
Warning: better to also install "texlive-tabulary".
Warning: better to also install "texlive-threeparttable".
Warning: better to also install "texlive-titlesec".
Warning: better to also install "texlive-tools".
Warning: better to also install "texlive-ucs".
Warning: better to also install "texlive-upquote".
Warning: better to also install "texlive-wrapfig".
Warning: better to also install "xelatex".
You should run:

sudo apt-get install imagemagick graphviz dvipng fonts-dejavu fonts-noto-cjk gcc latexmk python librsvg2-bin texlive-amscls texlive-amsfonts texlive-amsmath texlive-anyfontsize texlive-capt-of texlive-cmap texlive-lang-chinese texlive-ec texlive-eqparbox texlive-euenc texlive-fancybox texlive-fancyvrb texlive-float texlive-fncychap texlive-framed texlive-luatex85 texlive-mdwtools texlive-multirow texlive-needspace texlive-oberdiek texlive-parskip texlive-polyglossia texlive-psnfss texlive-tabulary texlive-threeparttable texlive-titlesec texlive-tools texlive-ucs texlive-upquote texlive-wrapfig texlive-xetex
Can't build as 2 mandatory dependencies are missing at ./scripts/sphinx-pre-install line 943.
Documentation/Makefile:41: The 'sphinx-build' command was not found. Make sure you have Sphinx installed and in PATH, or set the SPHINXBUILD make variable to point to the full path of the 'sphinx-build' executable.

Detected OS: Debian GNU/Linux 11.
Warning: better to also install "convert".
Warning: better to also install "dot".
Warning: better to also install "dvipng".
Warning: better to also install "fonts-dejavu".
Warning: better to also install "fonts-noto-cjk".
ERROR: please install "gcc", otherwise, build won't work.
Warning: better to also install "latexmk".
ERROR: please install "python", otherwise, build won't work.
Warning: better to also install "rsvg-convert".
Warning: better to also install "texlive-amscls".
Warning: better to also install "texlive-amsfonts".
Warning: better to also install "texlive-amsmath".
Warning: better to also install "texlive-anyfontsize".
Warning: better to also install "texlive-capt-of".
Warning: better to also install "texlive-cmap".
Warning: better to also install "texlive-ctex".
Warning: better to also install "texlive-ec".
Warning: better to also install "texlive-eqparbox".
Warning: better to also install "texlive-euenc".
Warning: better to also install "texlive-fancybox".
Warning: better to also install "texlive-fancyvrb".
Warning: better to also install "texlive-float".
Warning: better to also install "texlive-fncychap".
Warning: better to also install "texlive-framed".
Warning: better to also install "texlive-luatex85".
Warning: better to also install "texlive-mdwtools".
Warning: better to also install "texlive-multirow".
Warning: better to also install "texlive-needspace".
Warning: better to also install "texlive-oberdiek".
Warning: better to also install "texlive-parskip".
Warning: better to also install "texlive-polyglossia".
Warning: better to also install "texlive-psnfss".
Warning: better to also install "texlive-tabulary".
Warning: better to also install "texlive-threeparttable".
Warning: better to also install "texlive-titlesec".
Warning: better to also install "texlive-tools".
Warning: better to also install "texlive-ucs".
Warning: better to also install "texlive-upquote".
Warning: better to also install "texlive-wrapfig".
Warning: better to also install "xelatex".
You should run:

sudo apt-get install imagemagick graphviz dvipng fonts-dejavu fonts-noto-cjk gcc latexmk python librsvg2-bin texlive-amscls texlive-amsfonts texlive-amsmath texlive-anyfontsize texlive-capt-of texlive-cmap texlive-lang-chinese texlive-ec texlive-eqparbox texlive-euenc texlive-fancybox texlive-fancyvrb texlive-float texlive-fncychap texlive-framed texlive-luatex85 texlive-mdwtools texlive-multirow texlive-needspace texlive-oberdiek texlive-parskip texlive-polyglossia texlive-psnfss texlive-tabulary texlive-threeparttable texlive-titlesec texlive-tools texlive-ucs texlive-upquote texlive-wrapfig texlive-xetex
Can't build as 2 mandatory dependencies are missing at ./scripts/sphinx-pre-install line 943.
make[1]: *** [Documentation/Makefile:43: pdfdocs] Error 2
make: *** [Makefile:1772: pdfdocs] Error 2
mchehab@debian:~/docs$ sudo apt-get install imagemagick graphviz dvipng fonts-dejavu fonts-noto-cjk gcc latexmk python librsvg2-bin texlive-amscls texlive-amsfonts texlive-amsmath texlive-anyfontsize texlive-capt-of texlive-cmap texlive-lang-chinese texlive-ec texlive-eqparbox texlive-euenc texlive-fancybox texlive-fancyvrb texlive-float texlive-fncychap texlive-framed texlive-luatex85 texlive-mdwtools texlive-multirow texlive-needspace texlive-oberdiek texlive-parskip texlive-polyglossia texlive-psnfss texlive-tabulary texlive-threeparttable texlive-titlesec texlive-tools texlive-ucs texlive-upquote texlive-wrapfig texlive-xetex
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
E: Unable to locate package texlive-amscls
E: Unable to locate package texlive-amsfonts
E: Unable to locate package texlive-amsmath
E: Unable to locate package texlive-anyfontsize
E: Unable to locate package texlive-capt-of
E: Unable to locate package texlive-cmap
E: Unable to locate package texlive-ec
E: Unable to locate package texlive-eqparbox
E: Unable to locate package texlive-euenc
E: Unable to locate package texlive-fancybox
E: Unable to locate package texlive-fancyvrb
E: Unable to locate package texlive-float
E: Unable to locate package texlive-fncychap
E: Unable to locate package texlive-framed
E: Unable to locate package texlive-luatex85
E: Unable to locate package texlive-mdwtools
E: Unable to locate package texlive-multirow
E: Unable to locate package texlive-needspace
E: Unable to locate package texlive-oberdiek
E: Unable to locate package texlive-parskip
E: Unable to locate package texlive-polyglossia
E: Unable to locate package texlive-psnfss
E: Unable to locate package texlive-tabulary
E: Unable to locate package texlive-threeparttable
E: Unable to locate package texlive-titlesec
E: Unable to locate package texlive-tools
E: Unable to locate package texlive-ucs
E: Unable to locate package texlive-upquote
E: Unable to locate package texlive-wrapfig

2022-01-05 22:57:45

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

On Wed, 5 Jan 2022 22:42:30 +0100, Mauro Carvalho Chehab wrote:
> Em Wed, 5 Jan 2022 21:09:59 +0900
> Akira Yokosawa <[email protected]> escreveu:
>
[...]
>>
>> I'll test it under various distros/setups.
>> It may take a while.
>
> Did a quick test here with this lxc container:
>
> $ OS=debian REL=bullseye ;lxc-create -n ${OS} -t /usr/share/lxc/templates/lxc-download -- --dist ${OS} --release ${REL} --arch amd64
>
> If we add check_missing_tex(), it will then complain about lots
> of packages that don't exist in Debian (se logs at the end).

Now I think I understand what kind of tests we need.

My plan was to intentionally uninstall texlive-ctex (or whichever
package contains ctexhook.sty) and see if the lack of ctexhook.sty
is detected or not.

Apparently, such a test would mean little for sphinx_pre_install.

>
> That's one of the biggest issue with texlive: each distro splits it on
> different ways. So, basically, the %texlive hash at the script is meant
> to the way Fedora and openSuse distros usually map packages. I would
> expect that Mageia would also be similar if not identical, but other
> distros map packages on different ways.
>
> I'll prepare another patch for fixing the debian issue.

Then I'll wait for it.

Thanks, Akira

>
> Regards,
> Mauro
>
> ---
>
> mchehab@debian:~/docs$ make pdfdocs
> Documentation/Makefile:41: The 'sphinx-build' command was not found. Make sure you have Sphinx installed and in PATH, or set the SPHINXBUILD make variable to point to the full path of the 'sphinx-build' executable.
>
> Detected OS: Debian GNU/Linux 11.
> Warning: better to also install "convert".
> Warning: better to also install "dot".
> Warning: better to also install "dvipng".
> Warning: better to also install "fonts-dejavu".
> Warning: better to also install "fonts-noto-cjk".
> ERROR: please install "gcc", otherwise, build won't work.
> Warning: better to also install "latexmk".
> ERROR: please install "python", otherwise, build won't work.
> Warning: better to also install "rsvg-convert".
> Warning: better to also install "texlive-amscls".
> Warning: better to also install "texlive-amsfonts".
> Warning: better to also install "texlive-amsmath".
> Warning: better to also install "texlive-anyfontsize".
> Warning: better to also install "texlive-capt-of".
> Warning: better to also install "texlive-cmap".
> Warning: better to also install "texlive-ctex".
[...]


2022-01-06 00:41:13

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian

The name of the package with ctexhook.sty is different on
Debian/Ubuntu.

Reported-by: Akira Yokosawa <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
scripts/sphinx-pre-install | 3 +++
1 file changed, 3 insertions(+)

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 46aaab414098..f126ecbb0494 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -370,6 +370,9 @@ sub give_debian_hints()
);

if ($pdf) {
+ check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
+ "texlive-lang-chinese", 2);
+
check_missing_file(["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"],
"fonts-dejavu", 2);

--
2.33.1


2022-01-06 00:42:30

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency

Em Thu, 6 Jan 2022 07:57:22 +0900
Akira Yokosawa <[email protected]> escreveu:

> On Wed, 5 Jan 2022 22:42:30 +0100, Mauro Carvalho Chehab wrote:
> > Em Wed, 5 Jan 2022 21:09:59 +0900
> > Akira Yokosawa <[email protected]> escreveu:
> >
> [...]
> >>
> >> I'll test it under various distros/setups.
> >> It may take a while.
> >
> > Did a quick test here with this lxc container:
> >
> > $ OS=debian REL=bullseye ;lxc-create -n ${OS} -t /usr/share/lxc/templates/lxc-download -- --dist ${OS} --release ${REL} --arch amd64
> >
> > If we add check_missing_tex(), it will then complain about lots
> > of packages that don't exist in Debian (se logs at the end).
>
> Now I think I understand what kind of tests we need.
>
> My plan was to intentionally uninstall texlive-ctex (or whichever
> package contains ctexhook.sty) and see if the lack of ctexhook.sty
> is detected or not.
>
> Apparently, such a test would mean little for sphinx_pre_install.

Yes. The best way is to use lxc (or something similar) to install
a minimal container, install git (and make) and then run the script
directly or via "make pdfdocs".

This way, the script will test all dependencies.

It should be noticed that, on a minimal install like that, the script
will first report the basic dependencies, which, once installed, may
require other ones.

For instance, in order for the script to detect that python3-venv
is needed, the python package would need to be installed.

On Debian with the above container, I had to run it 2 times.

First run:
$ make pdfdocs
...
You should run:

sudo apt-get install imagemagick graphviz dvipng fonts-dejavu fonts-noto-cjk gcc latexmk python librsvg2-bin texlive-lang-chinese texlive-xetex

Second run:
$ make pdfdocs
...
You should run:

sudo apt-get install python3-venv
note: If you want pdf, you need at least Sphinx 2.4.4.
To upgrade Sphinx, use:

/usr/bin/python3 -m venv sphinx_2.4.4
. sphinx_2.4.4/bin/activate
pip install -r ./Documentation/sphinx/requirements.txt

> > That's one of the biggest issue with texlive: each distro splits it on
> > different ways. So, basically, the %texlive hash at the script is meant
> > to the way Fedora and openSuse distros usually map packages. I would
> > expect that Mageia would also be similar if not identical, but other
> > distros map packages on different ways.
> >
> > I'll prepare another patch for fixing the debian issue.
>
> Then I'll wait for it.

Patch for Debian sent.

Thanks,
Mauro

2022-01-06 02:00:19

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian

On Thu, 6 Jan 2022 01:41:02 +0100, Mauro Carvalho Chehab wrote:
> The name of the package with ctexhook.sty is different on
> Debian/Ubuntu.
>
> Reported-by: Akira Yokosawa <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>

Tested-by: Akira Yokosawa <[email protected]>

> ---
> scripts/sphinx-pre-install | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index 46aaab414098..f126ecbb0494 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -370,6 +370,9 @@ sub give_debian_hints()
> );
>
> if ($pdf) {
> + check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
> + "texlive-lang-chinese", 2);
> +
> check_missing_file(["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"],
> "fonts-dejavu", 2);
>
> --
> 2.33.1

So are you planing to add similar checks incrementally for the
other distros ?

There are two things I'd like to mention.

First, on Debian buster, Ubuntu Bionic, and Ubuntu Focal,
xeCJK.sty are younger then v3.8.3 and ctexhook.sty is not necessary.
As texlive-lang-chinese is a fairly large package, it would be better
not to require the unnecessary package.

The new dependency can be checked by:

$ grep ctex `kpsewhich xeCJK.sty`

If there is no hit, no need of ctexhook.sty.

It would be nice if the check can be made conditional.
But it would not be possible to check before you have xeCJK.sty
on your system.

Hmm??

Second, on CentOS stream8, texlive-ctex is not available.
Following is the error from "dnf install":

$ sudo dnf install texlive-ctex
Last metadata expiration check: 0:00:35 ago on Thu Jan 6 01:43:50 2022.
No match for argument: texlive-ctex
Error: Unable to find a match: texlive-ctex

xeCJK.sty there is also younger then v3.8.3.

So again, if the check of ctexhook.sty could be made conditional,
we would be able to list CentOS stream8 (or RHEL 8) as capable
of "make pdfdocs".

Longer term (for CentOS stream9 or RHEL 9), we might need to ask
EPEL maintainers to add texlive-ctex.

Thoughts?

List of xeCJK.sty version:

Debian buster v3.7.1
Ubuntu Bionic v3.6.1
Ubuntu Focal v3.8.1
CentOS stream8 v3.5.0

Thanks, Akira

2022-01-06 22:35:19

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian

Mauro Carvalho Chehab <[email protected]> writes:

> The name of the package with ctexhook.sty is different on
> Debian/Ubuntu.
>
> Reported-by: Akira Yokosawa <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
> scripts/sphinx-pre-install | 3 +++
> 1 file changed, 3 insertions(+)

Applied, thanks.

jon