[BUG] mktextfm requires writable cache

Norbert Preining norbert at preining.info
Fri Aug 21 01:58:10 CEST 2020

On Fri, 21 Aug 2020, Henri Menke wrote:
> If the TeX Live cache is not writable, it is impossible to generate
> fonts.  A non-writable cache is common in sandboxed or otherwise
> restricted environments, like a CI service.  The key point here is that
> the generation fails, even if an absolute path is specified:
>     [homeless at arch tmp]$ mktextfm --destdir /tmp lhr10

Yo need to set TEXMFCACHE which should give about two options where
files might be saved. If both are not writable, then please provide a
writable space. If all of that fails, /tmp/texfonts will be used.

> This strikes me as rather odd, because I would have expected that the
> --destdir option is designed to work around exactly that situation.  To

No, --destdir is for the destination where the tfm file will be saved,
not where temporary files are created.

> reproduce, make sure that your TeX Live installation is not writable and
> run mktextfm as a user that doesn't have a home directory.

ACtually you need to do
	mkdir /tmp/texfonts
	chmod 0000 /tmp/texfonts
	env TEXMFVAR=/some/foobar/dir mktextfm --distdir /tmp lhr10
Then you should get something like

[~] env TEXMFVAR=/some/foobar/dir mktextfm --destdir /tmp lhr10
mkdir: cannot create directory ‘././some’: Permission denied
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input lhr10
This is METAFONT, Version 2.7182818 (TeX Live 2020/Debian) (preloaded base=mf)

kpathsea: Running mktexmf lhr10
mkdir: cannot create directory ‘././some’: Permission denied
mkdir: cannot create directory ‘././tmp/texfonts/source’: Permission denied
! I can't find file `lhr10'.
<*> ...=ljfour; mag:=1; ; nonstopmode; input lhr10

Please type another input file name
! Emergency stop.
<*> ...=ljfour; mag:=1; ; nonstopmode; input lhr10

Transcript written on mfput.log.
grep: lhr10.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input lhr10' failed to make lhr10.tfm.

But I really don't see the point. It is common that programs write to
some directory, and in CI settings, or debbuilders, one needs to provide
the space. Just set TEXMFCACHE variable correctly and it will work.



PREINING Norbert                              https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13

More information about the tex-live mailing list.