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
Em Mon, 3 Jan 2022 17:30:50 +0100
Christoph Hellwig <[email protected]> escreveu:
Quoted 18 lines
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
Quoted 9 lines
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
Quoted 4 lines · Mauro Carvalho Chehab
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.
Quoted 8 lines
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
Em Mon, 3 Jan 2022 18:11:08 +0100
Christoph Hellwig <[email protected]> escreveu:
Quoted 20 lines · Mauro Carvalho Chehab
Quoted 4 lines
Weird... when you do a make, it should have checked for all dependencies, when it internally runs:
./scripts/sphinx-pre-installDetected OS: Debian GNU/Linux 11 (bullseye).
Sphinx version: 3.4.3All optional dependencies are met.
Needed package dependencies are met.Quoted 7 lines
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.
Quoted 4 lines
Quoted 1 line
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.
scripts/sphinx-pre-install +1 -0
@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', ); #
cover 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(+)
Signature · 1 line
2.33.1
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.
---
See [PATCH 0/1] at: https://lore.kernel.org/all/[email protected]/
scripts/sphinx-pre-install | 1 + 1 file changed, 1 insertion(+)
scripts/sphinx-pre-install +1 -0
@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', ); #
Signature · 1 line
2.33.1
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Quoted 18 lines · Mauro Carvalho Chehab
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(+)scripts/sphinx-pre-install +0
-0
scripts/sphinx-pre-install my %texlive = ( · line 82
Quoted 5 lines
scripts/sphinx-pre-install +1
-0@@ -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
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 23 lines
Quoted 15 lines
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(+)scripts/sphinx-pre-install +0
-0scripts/sphinx-pre-install my %texlive = ( · line 82
Quoted 5 lines
scripts/sphinx-pre-install +1
-0@@ -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
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Hi Mauro, see inline comments below.
Quoted 5 lines · Akira Yokosawa
Hi,
Quoted 2 lines · Jonathan Corbet
Mauro Carvalho Chehab <[email protected]> writes:
Quoted 30 lines
Quoted 3 lines
Quoted 3 lines
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -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
Quoted 4 lines
Quoted 2 lines
I've applied this, thanks.>
jon
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:
Quoted 39 lines
Hi Mauro, see inline comments below.
Quoted 5 lines · Akira Yokosawa
Hi,
Quoted 2 lines · Jonathan Corbet
Mauro Carvalho Chehab <[email protected]> writes:
Quoted 30 lines
Quoted 3 lines
Quoted 3 lines
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', );
Quoted 4 lines
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.
scripts/sphinx-pre-install +1 -0
@@ -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) {
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Quoted 42 lines · Mauro Carvalho Chehab
Em Tue, 4 Jan 2022 10:54:52 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 39 lines
Hi Mauro, see inline comments below.
Quoted 35 lines · Akira Yokosawa
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', );
Quoted 8 lines
Quoted 4 lines
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
Quoted 20 lines
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]>scripts/sphinx-pre-install +0
-0
scripts/sphinx-pre-install sub give_debian_hints() · line 373
Quoted 7 lines
scripts/sphinx-pre-install +1
-0@@ -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);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:
Quoted 85 lines · Mauro Carvalho Chehab
Quoted 42 lines
Em Tue, 4 Jan 2022 10:54:52 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 39 lines
Hi Mauro, see inline comments below.
Quoted 35 lines · Akira Yokosawa
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', );Quoted 8 lines
Quoted 4 lines
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
Quoted 27 lines
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]>scripts/sphinx-pre-install +1
-0@@ -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) {
Review sub give_debian_hints() · line 387
Quoted 7 lines
(quoted diff) +1
-0@@ -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.
scripts/sphinx-pre-install +11 -5
@@ -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";
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Quoted 93 lines · Mauro Carvalho Chehab
Em Tue, 4 Jan 2022 19:26:10 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 90 lines · Mauro Carvalho Chehab
Quoted 42 lines
Em Tue, 4 Jan 2022 10:54:52 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 39 lines
Hi Mauro, see inline comments below.
Quoted 35 lines · Akira Yokosawa
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', );Quoted 8 lines
Quoted 4 lines
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
Quoted 27 lines
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]>scripts/sphinx-pre-install +1
-0@@ -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) {scripts/sphinx-pre-install +1
-0@@ -380,6 +381,7 @@ sub give_debian_hints() } check_program("dvipng", 2) if ($pdf); + check_missing_tex(2) if ($pdf); check_missing(\%map);
Quoted 6 lines
Review sub give_debian_hints() · line 387
Quoted 2 lines
(quoted diff) +0
-0return 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...
Quoted 2 lines
Something like the following (possibly incomplete) patch.
I'll test it under various distros/setups.
It may take a while.
Thanks, Akira
Quoted 99 lines
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]>scripts/sphinx-pre-install +11
-5@@ -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";
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:
Quoted 101 lines · Mauro Carvalho Chehab
Quoted 93 lines
Em Tue, 4 Jan 2022 19:26:10 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 90 lines · Mauro Carvalho Chehab
Quoted 42 lines
Em Tue, 4 Jan 2022 10:54:52 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 39 lines
Hi Mauro, see inline comments below.
Quoted 35 lines · Akira Yokosawa
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 21 lines
Quoted 20 lines
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(+)scripts/sphinx-pre-install +1
-0@@ -78,6 +78,7 @@ my %texlive = ( 'ucs.sty' => 'texlive-ucs', 'upquote.sty' => 'texlive-upquote', 'wrapfig.sty' => 'texlive-wrapfig', + 'ctexhook.sty' => 'texlive-ctex', );Quoted 8 lines
Quoted 4 lines
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
Quoted 27 lines
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]>scripts/sphinx-pre-install +1
-0@@ -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) {scripts/sphinx-pre-install +1
-0@@ -380,6 +381,7 @@ sub give_debian_hints() } check_program("dvipng", 2) if ($pdf); + check_missing_tex(2) if ($pdf); check_missing(\%map);Quoted 6 lines
Review sub give_debian_hints() · line 387
Quoted 2 lines
(quoted diff) +0
-0return 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.
Quoted 8 lines
Thank you for looking into this!
I must admit I'm far from grasping how this perl script works...Quoted 2 lines
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 amd64If 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
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
Quoted 3 lines · Mauro Carvalho Chehab
Em Wed, 5 Jan 2022 21:09:59 +0900
Akira Yokosawa <[email protected]> escreveu:
[...]
Quoted 10 lines
Quoted 3 lines
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 amd64If 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.
Quoted 8 lines
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
Quoted 26 lines
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".
[...]
PATCH v2 1/1 scripts: sphinx-pre-install: Fix ctex support on Debian
The name of the package with ctexhook.sty is different on Debian/Ubuntu.
--- scripts/sphinx-pre-install | 3 +++ 1 file changed, 3 insertions(+)
scripts/sphinx-pre-install +3 -0
@@ -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);
Signature · 1 line
2.33.1
Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian
Quoted 5 lines · Mauro Carvalho Chehab
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]>
Quoted 20 lines
--- scripts/sphinx-pre-install | 3 +++ 1 file changed, 3 insertions(+)scripts/sphinx-pre-install +3
-0@@ -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);Signature · 1 line
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-ctexxeCJK.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.0Thanks, Akira
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian
Hi Maruo,
(+Cc: Jon, linux-doc)
Quoted 2 lines · Mauro Carvalho Chehab
Em Thu, 6 Jan 2022 11:00:08 +0900
Akira Yokosawa <[email protected]> escreveu:
[...]
Quoted 7 lines
Quoted 2 lines
Longer term (for CentOS stream9 or RHEL 9), we might need to ask EPEL maintainers to add texlive-ctex.
Longer term, the script is actually fixing a broken dependency issue on distros. So, bugzillas for Fedora/Debian & derivated ones should be opened for "texlive-xecjk" package to also select "texlive-ctex" (or whatever other name those packages have on distros).
FWIW, I asked Karl Berry, who is the chief maintainer of upstream TeX Live, to add a dependency on ctex to xecjk [1].
[1]: https://tug.org/pipermail/tex-live/2022-January/047648.html
Karl has added the dependency to xecjk as of rev 61529 [2].
[2]: https://tug.org/pipermail/tex-live/2022-January/047654.html
On up-to-date vanilla TeX Live 2021 (>= rev61529):
$ tlmgr info --data depends xecjk
ctexWith xecjk < rev61529
$ tlmgr info --data depends xecjk
(no output)This dependency is expected to be reflected in the TeX Live packaging for next Fedora release. OTOH, as I mentioned earlier, EPEL 9 (for CentOS stream9) doesn't have texlive-ctex at the moment, so we need to see what happens there when RHEL 9 is ready.
Note: the xecjk -> ctex dependency is already taken care of by openSUSE's TeX Live packages.
As for Ubuntu/Debian, it looks like TeX Live/Debian packaging maintainer, Norbert Preining, has no intention of adding dependency of texlive-xetex -> texlive-lang-chinese as can be seen in his responses to a Debian Bug report [3].
I think this is a reasonable choice as most xetex users don't use xecjk and texlive-lang-chinese is large in size.
[3]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961703
Thanks, Akira
Quoted 7 lines
Worth mentioning that the script dependency-checking is should be smart enough to not break once texlive distro maintainers fix such issues.
Thanks,
Mauro
Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian
Em Sun, 9 Jan 2022 13:09:19 +0900
Akira Yokosawa <[email protected]> escreveu:
Quoted 10 lines
Hi Maruo,
(+Cc: Jon, linux-doc)Quoted 2 lines · Mauro Carvalho Chehab
Em Thu, 6 Jan 2022 11:00:08 +0900
Akira Yokosawa <[email protected]> escreveu:[...]
Quoted 3 lines
Quoted 2 lines
Longer term (for CentOS stream9 or RHEL 9), we might need to ask EPEL maintainers to add texlive-ctex.
Quoted 7 lines
Quoted 4 lines
Longer term, the script is actually fixing a broken dependency issue on distros. So, bugzillas for Fedora/Debian & derivated ones should be opened for "texlive-xecjk" package to also select "texlive-ctex" (or whatever other name those packages have on distros).
FWIW, I asked Karl Berry, who is the chief maintainer of upstream TeX Live, to add a dependency on ctex to xecjk [1].
Thanks for forwarding this question to him and to address it on distros!
Quoted 9 lines
[1]: https://tug.org/pipermail/tex-live/2022-January/047648.html
Karl has added the dependency to xecjk as of rev 61529 [2].
[2]: https://tug.org/pipermail/tex-live/2022-January/047654.html
On up-to-date vanilla TeX Live 2021 (>= rev61529):
Quoted 7 lines
$ tlmgr info --data depends xecjk ctexWith xecjk < rev61529
$ tlmgr info --data depends xecjk (no output)
Nice! Yeah, this is the long term solution, but still won't prevent people/distros based on older packages to keep using packages without such requirements.
Quoted 2 lines
This dependency is expected to be reflected in the TeX Live packaging for next Fedora release.
Yeah, Fedora is usually keen to changes.
Quoted 3 lines
OTOH, as I mentioned earlier,
EPEL 9 (for CentOS stream9) doesn't have texlive-ctex at the moment, so we need to see what happens there when RHEL 9 is ready.
Yes. RHEL/EPEL is usually a lot more conservative.
Quoted 2 lines
Note: the xecjk -> ctex dependency is already taken care of by openSUSE's TeX Live packages.
On both Tumbleweed and on Leap?
Quoted 8 lines
As for Ubuntu/Debian, it looks like TeX Live/Debian packaging maintainer, Norbert Preining, has no intention of adding dependency of texlive-xetex -> texlive-lang-chinese as can be seen in his responses to a Debian Bug report [3].
I think this is a reasonable choice as most xetex users don't use xecjk and texlive-lang-chinese is large in size.[3]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961703
Debian package maintainer could reconsider it after the upstream dependency addition, but probably only for SID and yet-to-be-released versions. Debian is very conservative on their releases. Even if SID gains such dependency fix, I would be surprised if they end porting a dependency change like that to Bullseye (which should be the latest version for ~1.5 years - with LTS extending it for ~3.5 years).
It sounds worth mentioning about the texlive dependency decision at the Debian bug.
Quoted 9 lines
Thanks, Akira
Quoted 7 lines
Worth mentioning that the script dependency-checking is should be smart enough to not break once texlive distro maintainers fix such issues.
Thanks,
Mauro
Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian
Quoted 53 lines · Mauro Carvalho Chehab
Em Sun, 9 Jan 2022 13:09:19 +0900
Akira Yokosawa <[email protected]> escreveu:Quoted 10 lines
Hi Maruo,
(+Cc: Jon, linux-doc)Quoted 2 lines · Mauro Carvalho Chehab
Em Thu, 6 Jan 2022 11:00:08 +0900
Akira Yokosawa <[email protected]> escreveu:[...]
Quoted 3 lines
Quoted 2 lines
Longer term (for CentOS stream9 or RHEL 9), we might need to ask EPEL maintainers to add texlive-ctex.
Quoted 7 lines
Quoted 4 lines
Longer term, the script is actually fixing a broken dependency issue on distros. So, bugzillas for Fedora/Debian & derivated ones should be opened for "texlive-xecjk" package to also select "texlive-ctex" (or whatever other name those packages have on distros).
FWIW, I asked Karl Berry, who is the chief maintainer of upstream TeX Live, to add a dependency on ctex to xecjk [1].
Thanks for forwarding this question to him and to address it on distros!
Quoted 9 lines
[1]: https://tug.org/pipermail/tex-live/2022-January/047648.html
Karl has added the dependency to xecjk as of rev 61529 [2].
[2]: https://tug.org/pipermail/tex-live/2022-January/047654.html
On up-to-date vanilla TeX Live 2021 (>= rev61529):
Quoted 7 lines
$ tlmgr info --data depends xecjk ctexWith xecjk < rev61529
$ tlmgr info --data depends xecjk (no output)Nice! Yeah, this is the long term solution, but still won't prevent people/distros based on older packages to keep using packages without such requirements.
Quoted 2 lines
This dependency is expected to be reflected in the TeX Live packaging for next Fedora release.
Yeah, Fedora is usually keen to changes.
Quoted 3 lines
OTOH, as I mentioned earlier,
EPEL 9 (for CentOS stream9) doesn't have texlive-ctex at the moment, so we need to see what happens there when RHEL 9 is ready.
Quoted 6 lines
Yes. RHEL/EPEL is usually a lot more conservative.
Quoted 2 lines
Note: the xecjk -> ctex dependency is already taken care of by openSUSE's TeX Live packages.
On both Tumbleweed and on Leap?
I mean on Tumbleweed only.
Leap's xecjk is v3.4.8 and has no dependency on ctex.
Quoted 19 lines
Quoted 9 lines
As for Ubuntu/Debian, it looks like TeX Live/Debian packaging maintainer, Norbert Preining, has no intention of adding dependency of texlive-xetex -> texlive-lang-chinese as can be seen in his responses to a Debian Bug report [3].
I think this is a reasonable choice as most xetex users don't use xecjk and texlive-lang-chinese is large in size.[3]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961703
Debian package maintainer could reconsider it after the upstream dependency addition, but probably only for SID and yet-to-be-released versions.
Debian is very conservative on their releases.
Even if SID gains such dependency fix, I would be surprised if they end porting a dependency change like that to Bullseye (which should be the latest version for ~1.5 years - with LTS extending it for ~3.5 years).
Quoted 2 lines
It sounds worth mentioning about the texlive dependency decision at the Debian bug.
I'm afraid I don't think so.
At Debian Latex wiki [3], they say:
If you want to add support for your language (other than english) in TeX Live, search for texlive-lang [4] and install your language.
[3]: https://wiki.debian.org/Latex
[4]: https://packages.debian.org/search?keywords=texlive-lang
This is the Debian's policy of TeX Live packaging.
I wouldn't complain if they say "Just install both of texlive-xetex and texlive-lang-chinese if you want xecjk to work."
There are a lot of inter-collection dependencies in upstream TeX Live, but many of then are ignored in TeX Live/Debian packages. For example, ctex has a dependency on xecjk (reverse of the newly added one) in upstream, but Debian's texlive-lang-chinese does not depend on texlive-xetex.
Thanks, Akira
Quoted 10 lines
Quoted 10 lines
Thanks, Akira
Quoted 7 lines
Worth mentioning that the script dependency-checking is should be smart enough to not break once texlive distro maintainers fix such issues.
Thanks,
Mauro
Re: [PATCH v2] scripts: sphinx-pre-install: Fix ctex support on Debian
In reply to Mauro Carvalho ChehabQuoted 8 lines · Mauro Carvalho Chehab
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
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
In reply to Akira YokosawaEm Thu, 6 Jan 2022 07:57:22 +0900
Akira Yokosawa <[email protected]> escreveu:
Quoted 16 lines · Mauro Carvalho Chehab
Quoted 3 lines
Em Wed, 5 Jan 2022 21:09:59 +0900
Akira Yokosawa <[email protected]> escreveu:[...]
Quoted 10 lines
Quoted 3 lines
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 amd64If we add
check_missing_tex(), it will then complain about lots of packages that don't exist in Debian (se logs at the end).
Quoted 7 lines
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
Quoted 9 lines
Quoted 7 lines
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
Re: [PATCH 1/1] scripts: sphinx-pre-install: add required ctex dependency
In reply to Akira YokosawaQuoted 11 lines · Akira Yokosawa
Hi,
Quoted 5 lines · Jonathan Corbet
Quoted 3 lines · Mauro Carvalho Chehab
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
Quoted 28 lines
Thanks, Akira
Quoted 23 lines
Quoted 15 lines
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(+)scripts/sphinx-pre-install +0
-0scripts/sphinx-pre-install my %texlive = ( · line 82
Quoted 5 lines
scripts/sphinx-pre-install +1
-0@@ -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
Quoted 1 line · Mauro Carvalho Chehab
Ah, the error is specific to RCU.tex then?
Yes.
Quoted 16 lines
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" pdfdocsWith 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.
Quoted 8 lines
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}
?
Hi Christoph,
Quoted 46 lines · Christoph Hellwig
Quoted 1 line · Mauro Carvalho Chehab
Ah, the error is specific to RCU.tex then?
Yes.
Quoted 16 lines
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" pdfdocsWith 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.
Quoted 8 lines
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}
Quoted 1 line
?
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
Quoted 5 lines · Akira Yokosawa
I suspect you are suffering from corrupt RCU.aux (or whatever other intermediate files xelatex generates).
What happens you run
Quoted 7 lines
$ make cleandocsbefore
$ 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}
?
Quoted 29 lines · Christoph Hellwig
Quoted 5 lines · Akira Yokosawa
I suspect you are suffering from corrupt RCU.aux (or whatever other intermediate files xelatex generates).
What happens you run
Quoted 7 lines
$ make cleandocsbefore
$ 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.
Quoted 8 lines
[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
Quoted 2 lines · Akira Yokosawa
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.
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Akira Yokosawa
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?
Quoted 7 lines · Akira Yokosawa
Quoted 3 lines
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
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · Akira Yokosawa
Quoted 3 lines
Current linux-next. But I've also seen it with mainline from a few days ago.
Quoted 9 lines
Quoted 3 lines
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??
Quoted 29 lines · Christoph Hellwig
Quoted 5 lines · Akira Yokosawa
I suspect you are suffering from corrupt RCU.aux (or whatever other intermediate files xelatex generates).
What happens you run
Quoted 7 lines
$ make cleandocsbefore
$ 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.
Quoted 8 lines
[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
Quoted 9 lines · Akira Yokosawa
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?
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Akira Yokosawa
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 ; \
Quoted 8 lines
Quoted 1 line
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
Quoted 21 lines · Akira Yokosawa
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Akira Yokosawa
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 ; \Quoted 8 lines
Quoted 1 line
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:
Quoted 8 lines
https://lore.kernel.org/linux-doc/[email protected]
[PATCH v2 0/4] docs:sphinx/kfigure.py: Improve conversion to PDFThis 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
Quoted 3 lines
Thanks, Akira
Quoted 8 lines · Akira Yokosawa
Quoted 8 lines
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 PDFThis 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..
Quoted 11 lines
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-x11This will remove ImageMagick.
(You have ghostscript and gsfonts-x11 already installed, I guess.)
This works just fine, thanks.
Quoted 17 lines · Christoph Hellwig
Quoted 8 lines · Akira Yokosawa
Quoted 8 lines
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 PDFThis 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..
Quoted 5 lines
Alternatively, you can avoid ImageMagick by installing graphicsmagick-imagemagick-compat instead of imagemagick.
I'm not sure what you think of GraphicsMagick, though.
Quoted 8 lines
Quoted 6 lines
If you'd like to try, do:
$ sudo apt install graphicsmagick-imagemagick-compat ghostscript gsfonts-x11This 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