[tex-live] Has anything changed in the order TL searches for packages?

Urs Liska lists at openlilylib.org
Thu May 17 10:26:21 CEST 2018

Am 17.05.2018 um 00:30 schrieb Karl Berry:
>      [fake dir already mentioned]
> Right, sorry.
> There is no intentional change in the path search list, and I doubt (but
> don't know for a fact) that Debian made such a change either.
> BTW, it does not reproduce for me with native TL.
>      lualatex finds the package in /usr/share/texlive
>      rather than that in ~/texmf. (While still kpsewhich finds the one
>      installed in $TEXMFHOME).
>      Anything I have to update or can do to investigate?
> 1) Since lualatex is involved, I'd start with mv ~/.texlive2018{,-prev}
> and see if it does any better. E.g., I wonder if the move of the
> lyluatex files in the update obsoleted its cache, but lualatex didn't
> notice. (The behavior of the lua(la)tex caching is unknown to me.)

When your post arrived I was just busy trying to remove *all* TeX from 
my system, since I suspected the issue might actually be caused by the 
fact that I have a home partition that has survived a number of 
installations over the years ...

After that I newly installed TeXLive from the downloaded installer.
Unfortunately still the same result.
I double-checked compiling documents with other custom packages that are 
accessed through that path, and they work, BTW, so the problem is 
clearly about the TeXLive version of the package being used first/instead.

> 2) The output of kpsewhich -var-value TEXMF might be interesting to
> ensure that $TEXMFHOME really does appear before $TEXMFDIST. I get:
> {{}/u/karl/.texlive2018/texmf-config,/u/karl/.texlive2018/texmf-var,/u/karl/texmf,!!/usr/local/texlive/texmf-local,!!/usr/local/texlive/2018/texmf-config,!!/usr/local/texlive/2018/texmf-var,!!/usr/local/texlive/2018/texmf-dist}
> (The empty braces at the beginning look weird but are ok.)

Well, my output looks similar and therefore correct too:


> 3) You can see exactly what is being searched with
>    lualatex -kpathsea-debug=-1 lyluatex.sty </dev/null 2>/tmp/debug
> The output will be lengthy but should be definitive. Feel free to send
> it to me (gzipped) if need be. --best, karl.

I've done so.
When I search the result for lyluatex, the first occurences are those:

    kdebug:kpse_find_file: searching for lyluatex.sty of type tex (from
    kdebug:hash_lookup(try_std_extension_first.lualatex) => (nil)
    kdebug:hash_lookup(try_std_extension_first) => t
    kdebug:variable: try_std_extension_first = t
    kdebug:start generic search(files=[lyluatex.sty], must_exist=0,

So it seems the *first* location is  ~/.texlive2018 but if I'm not 
completely mistaken there is nothing in there except a font cache:

    ~$ cd .texlive2018/
    uliska at elitebook-debian:~/.texlive2018$
    uliska at elitebook-debian:~/.texlive2018$ ls
    uliska at elitebook-debian:~/.texlive2018$ ls -l
    insgesamt 4
    drwxr-xr-x 4 uliska uliska 4096 Mai 17 09:15 texmf-var
    uliska at elitebook-debian:~/.texlive2018$ ls -la
    insgesamt 12
    drwxr-xr-x  3 uliska uliska 4096 Mai 17 08:39 .
    drwxr-xr-x 91 uliska uliska 4096 Mai 17 09:00 ..
    drwxr-xr-x  4 uliska uliska 4096 Mai 17 09:15 texmf-var
    uliska at elitebook-debian:~/.texlive2018$ cd texmf-var/
    uliska at elitebook-debian:~/.texlive2018/texmf-var$ ls -la
    insgesamt 16
    drwxr-xr-x 4 uliska uliska 4096 Mai 17 09:15 .
    drwxr-xr-x 3 uliska uliska 4096 Mai 17 08:39 ..
    drwxr-xr-x 3 uliska uliska 4096 Mai 17 08:39 luatex-cache
    drwxr-xr-x 2 uliska uliska 4096 Mai 17 08:51 texdoc
    uliska at elitebook-debian:~/.texlive2018/texmf-var$ cd luatex-cache/
    uliska at elitebook-debian:~/.texlive2018/texmf-var/luatex-cache$ ls -la
    insgesamt 12
    drwxr-xr-x 3 uliska uliska 4096 Mai 17 08:39 .
    drwxr-xr-x 4 uliska uliska 4096 Mai 17 09:15 ..
    drwxr-xr-x 4 uliska uliska 4096 Mai 17 08:40 generic
    uliska at elitebook-debian:~/.texlive2018/texmf-var/luatex-cache$ cd
    uliska at elitebook-debian:~/.texlive2018/texmf-var/luatex-cache/generic$
    ls -la
    insgesamt 16
    drwxr-xr-x 4 uliska uliska 4096 Mai 17 08:40 .
    drwxr-xr-x 3 uliska uliska 4096 Mai 17 08:39 ..
    drwxr-xr-x 3 uliska uliska 4096 Mai 17 08:40 fonts
    drwxr-xr-x 2 uliska uliska 4096 Mai 17 08:50 names

The next location is /home/uliska/texmf/tex/lualatex/, and I think 
*there* my 'local' package should have been found, since

    ~/texmf/tex/lualatex$ ls -la
    insgesamt 12
    drwxr-xr-x 3 uliska uliska 4096 Mai 16 16:36 .
    drwxr-xr-x 4 uliska uliska 4096 Mai 16 16:35 ..
    drwxr-xr-x 2 uliska uliska 4096 Mai 16 16:35 .dummy
    lrwxrwxrwx 1 uliska uliska   22 Mai 16 16:36 latex-git ->

and lyluatex is a subdirectory of this 'latex-git'.

Looking for the exact location of the custom package file gives this:

    /tmp$ grep -n "latex-git/lyluatex/lyluatex.sty" debug-lyluatex
    => (nil)
    => -1
    1945:kdebug:returning from generic search([lyluatex.sty]) =>
    1949:kdebug:kpse_find_file: searching for
    /home/uliska/texmf/tex/lualatex/latex-git/lyluatex/lyluatex.sty of
    type tex (from texmf.cnf)
    1953:kdebug:start generic
    must_exist=0, find_all=0,
    => /home/uliska/texmf/tex/lualatex/latex-git/lyluatex/lyluatex.sty
    1955:kdebug:returning from generic
    => /home/uliska/texmf/tex/lualatex/latex-git/lyluatex/lyluatex.sty
    rb) => 0x361c580
    => (nil)
    => -1
    => -1
    => -1


    /tmp$ grep "/usr/*/lyluatex" debug-lyluatex

returns nothing.

I think all of this clearly shows that kpsewhich finds the package in 
the ~/texmf path.

On the other hand, if I compile a MWE that just loads lyluatex like this


I get the output

    $ lualatex mwe-lyluatex.tex
    This is LuaTeX, Version 1.07.0 (TeX Live 2018)
      restricted system commands enabled.
    LaTeX2e <2018-04-01> patch level 4
    (using write cache:
    sing read cache:
    /usr/local/texlive/2018/texmf-var/luatex-cache/generic /home/u
    luaotfload | main : initialization completed in 0.528 seconds
    Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
    luc: /home/u

which clearly shows that lyluatex is loaded from /usr/local/texlive.

Is there anything more I can investigate? I've also attached the log 
file, as compressing reduced the size from >8M to 200K.

Any further pointers or ideas would be highly appreciated. I really 
don't want to be forced to remove the texlive-music collection just to 
be able to run my own packages from the local repositories.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20180517/7da8077d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug-lyluatex.tar.xz
Type: application/x-xz
Size: 209980 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex-live/attachments/20180517/7da8077d/attachment-0001.xz>

More information about the tex-live mailing list