Subject: bug#55113: [BUG] texlive-bin doesn't set $TEXMFCACHE properly

From: Christopher Rodriguez <[email-masked]>
Date: Thu, 28 Jul 2022 16:58:17 -0400

Sorry for the delay; I came down with the rona and was knocked out of
commission for a while.

Maxim Cournoyer <[email-masked]> writes:

> Could you share your workload to demonstrate the problem (reproducer),
> if it's not too complicated?  texlive-bin sets GUIX_TEXMF; perhaps
> TEXMFCACHE is derived from it in the default texlive config.

Absolutely. I've taken the liberty of uploading a terminal log[1] to
demonstrate.

Basically, as I'm using these piecemeal packages, I am trying to include
as few packages as possible, and therefore keep things minimal. When I
do so, however, the selection of packages does not set TEXMFCACHE. As I
use lualatex, this means it is autodefined, and incorrectly, as the
following (note the braces; might be a failed variable or something?):

{$GUIX_PROFILE/share/texmf-dist/}

This ends up creating a \{/ directory in the same directory as lualatex
is run, and thus doesn't ever create a cache for fonts to use. If the
braces weren't there, it would instead be pointing to a read-only
directory in the store (or rather, a symlink to one) I believe.

The guix shell I used in my example[1] was the following:

guix shell --pure texlive-luaotfload texlive-bin bash \
texlive-tex-ini-files texlive-latex-base tree coreutils

I feel this is the minimal packages needed to show this issue, though
the above will always fail to create a /usable/ cache: It includes none
of the fonts (and so I bail on the compilation while it is looking for a
default font with 'X'. However, the directory has already been created
at this point, and therefore the problem already exists. The same
behavior, minus the failed compilation, can be observed in my full
manifest of texlive packages[2], though some of those are self-defined
in my personal channel[3]).

If GUIX_TEXMF is being set by texlive-bin, perhaps that variable should
be used to set an otherwise-empty TEXMFCACHE in texlive-bin as well? If
overrides are needed, the user could then still set that variable in
their profile. And this would allow the out-of-the-box experience for
piecemeal texlive packages to be smoother. (Also, so long as it points
to a writable directory, it doesn't really matter to me /where/ that
directory is. I chose $HOME/.local/share/texmf-dist/ because it seemed
standard, but I'm necessarily saying it is the 'correct' one.)

What do You think?

[1]: http://paste.debian.net/1248671/
[2]: http://paste.debian.net/1248676/
[3]: https://git.sr.ht/~yewscion/yewscion-guix-channel

-- 

Christopher Rodriguez