FS#74616 - Updating TeXLive format files... fails

Attached to Project: Arch Linux
Opened by reactormonk (reactormonk) - Monday, 02 May 2022, 12:59 GMT
Last edited by Antonio Rojas (arojas) - Friday, 16 June 2023, 23:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When updating `texlive-core` or any related packages, I get the following error message:


(20/22) Updating TeXLive format files...
fmtutil [ERROR]: running `xetex -ini -jobname=xetex -progname=xetex -etex xetex.ini </dev/null' return status: 1
fmtutil [ERROR]: returning error due to option --strict
fmtutil [ERROR]: running `xetex -ini -jobname=xelatex-dev -progname=xelatex-dev -etex xelatex.ini </dev/null' return status: 1
fmtutil [ERROR]: returning error due to option --strict
error: command failed to execute correctly


Package versions: 2021.62793-1 -> 2022.63035-1
This task depends upon

Closed by  Antonio Rojas (arojas)
Friday, 16 June 2023, 23:46 GMT
Reason for closing:  No response
Comment by Antonio Rojas (arojas) - Monday, 29 May 2023, 12:24 GMT
is this still an issue?
Comment by Christian Cornelssen (ccorn) - Thursday, 15 June 2023, 21:22 GMT
Re-using this issue because:
With `pgkctl repo clone texlive-texmf` as of 2023-06-15,
the fmtutil script `/usr/share/libalpm/scripts/texlive-fmtutil` fails.

Warnings output begins with:

```
(5/7) Updating TeXLive format files...
fmtutil [ERROR]: no (or empty) hitex.fmt made by: hitex -ini -jobname=hitex -progname=hitex -etex -ltx hitex.ini </dev/null
```

To investigate, I ran the reported hitex command manually.
Turns out that etex expects hyphenation files. Lots of them.
I had to install all of the texlive-lang* packages except *arabic, *japanese, *korean to get the hitex format built again.

The reason for those language requirements seems to be that the two (initially identical) files

/etc/texmf/tex/generic/config/language.def
/usr/share/texmf-dist/tex/generic/config/language.def

from package `texlive-basic` includes all those hyphenation files.

That seems to call for a pacman hook to autogenerate the language.def similar to the fmtutil hook.

After installing all the *lang packages except the above-mentioned three, one warning by fmtutil-sys remains:

```
fmtutil [WARNING]: inifile fmttriggers=cm,hyphen-base,knuth-lib,plain for aleph/aleph not found.
```

and installing the remaining three texlive-lang* packs does not help to get rid of that warning.
Comment by Christian Cornelssen (ccorn) - Thursday, 15 June 2023, 21:28 GMT
The aleph warning seems to be due to a wrong entry in
/var/lib/texmf/arch/installedpkgs/formatsextra.fmts
owned by the package texlive-formatsextra.
Comment by Christian Cornelssen (ccorn) - Thursday, 15 June 2023, 22:41 GMT
Partial solution: Let a hook do

```
perl -pe 's{^\\addlanguage\{[^{}]+\}\{([^{}]+)\}}
{(!`kpsewhich $1` && "%").$&}e' \
/usr/share/texmf-dist/tex/generic/config/language.def \
> /etc/texmf/tex/generic/config/language.def
```

This reads the /usr/.../language.def, comments-out the commands with nonexisting hyphenation files. and writes the result to the /etc/.../language.def.

This seems to work for plain hitex formats.

Next stop: hilatex formats. Those use a `language.dat` instead.
Those are updated by `tlmgr install hyphen-xxx` and `tlmgr remove `hyphen-xxx`.
We do not use `tlmgr`, I suppose?
Comment by Christian Cornelssen (ccorn) - Friday, 16 June 2023, 00:00 GMT
For the language.dat, the corresponding hook command is:

```
perl -pe 's{^\w\S*\s+(\S+)|^=}
{($1 ? ($c = !`kpsewhich $1` && "%") : $c).$&}e' \
/usr/share/texmf-dist/tex/generic/config/language.dat \
> /etc/texmf/tex/generic/config/language.dat
```

This reads the /usr/.../language.dat, comments-out the languages with nonexisting hyphenation files, also comments out the subsequent alias definitions, and writes the result to the /etc/.../language.dat.

This works. I have been able to uninstall the unneeded texlive-lang* packages.

The commands for adapting language.def and language.dat have to run AFTER mktexlsr and BEFORE fmtutil-sys.
Since the hyphenation patterns mostly affect formats, it would make sense to incorporate these steps directly into `/usr/share/libalpm/scripts/texlive-fmtutil`.

Oh, and the hook trigger patterns should be updated to rerun those scripts when language packs have been installed or removed.
(Some language packs do not trigger the existing fmtutil hook.)
Comment by Christian Cornelssen (ccorn) - Friday, 16 June 2023, 01:34 GMT
I have attached a patch suitable for `git am`.

FIXME: Although the language.def and language.dat in /etc/... have
a comment that says not to edit by hand and use tlmgr instead,
this could previously be ignored because pacman would leave those
files untouched. Now the hook scripts overwrite them.

A better solution would be to mimic what tlmgr would do to those files.
Presumably tlmgr allows local tweaks somehow.
Comment by Antonio Rojas (arojas) - Friday, 16 June 2023, 23:46 GMT
Thanks. I have implemented a different fix in 2023.66594-10 based on the existing formats/maps splitting mechanism.

Closing this old issue, please post any follow up comments in the current bug report  FS#78799 

Loading...