Problem with mktex* generated files when running latex on GCP cloud run
Norbert Preining
norbert at preining.info
Sat Jul 12 04:06:09 CEST 2025
Hi Karl,
> Hi Norbert - re you wrote me separately, what is the filesystem of /tmp,
Here are the two relevant entries of the output of mount:
none on / type overlay (rw,mode=755,uid=0,gid=0)
none on /tmp type overlay (rw,mode=1777)
> and the output of ls -lR /tmp/foobar? In any case, how about using
ls -lR shows all the files/dirs as expected (including the .tfm).
> TEXMFVAR=./mytmp or some such instead of /tmp? If . is a more normal
> filesystem.
Tried that already, that was the original place
(~/.texlive2023/texmf-var). Same effect.
> Those dir_links values do seem suspicious at first glance, and that can
> cause kpse not to descend, namely if nlinks != 2; see "Subdirectory
> expansion" in the kpathsea manual, and kpathsea/{elt-dirs.c,config.h}.
I guess I need to check the source code and hte overlay file system.
There is something in the source code of overlayfs:
https://github.com/torvalds/linux/blob/master/fs/overlayfs/inode.c#L203-L236
mentioned, not sure this is relevant.
> Unfortunately I don't seem to have defined a way to turn off the
> st_nlinks trick at runtime (i.e., it's not per-filesystem). Maybe we
> should do that for next year. If that's really the problem.
Ahhh:
/* Should we recurse? To see if the subdirectory is a
leaf, check if it has two links (one for . and one for
..). This means that symbolic links to directories do
not affect the leaf-ness. This is arguably wrong, but
the only alternative I know of is to stat every entry
in the directory, and that is unacceptably slow.
The #ifdef here makes all this configurable at
compile-time, so that if we're using VMS directories or
some such, we can still find subdirectories, even if it
is much slower. */
#ifdef ST_NLINK_TRICK
/* With SAS/C++ 6.55 on the Amiga, stat sets the st_nlink
field to -1 for a file, or to 1 for a directory.
Cygwin 1.7 also leaves st_nlink as 1:
http://cygwin.com/ml/cygwin-developers/2008-04/msg00110.html
*/
if (links != 2)
#endif /* ST_NLINK_TRICK */
/* All criteria are met; find subdirectories. */
do_subdir (kpse, str_list_ptr, FN_STRING (name),
potential_len, post);
#ifdef ST_NLINK_TRICK
else if (*post == 0)
/* Nothing to match, no recursive subdirectories to
look for: we're done with this branch. Add it. */
dir_list_add (str_list_ptr, FN_STRING (name));
#endif
}
I have searched a bit about what an overlayfs returns for this, but
without success.
Will restart on Monday, maybe try manually building one with the trick
turned off and see how it goes on GCP cloud.
Best regards
Norbert
--
DI Dr Norbert Preining https://www.preining.info
arXiv / Cornell University + IFMGA Guide + TU Wien + TeX Live
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
More information about the texhax
mailing list.