[tex-live] strange discrepancy in running time of etex between TL2015 and TL2017

jfbu jfbu at free.fr
Sun Sep 3 09:50:23 CEST 2017


Hi Reinhard,

Le 3 sept. 2017 à 06:58, Reinhard Kotucha <reinhard.kotucha at web.de> a écrit :

> On 2017-09-02 at 14:52:25 +0200, jfbu wrote:
> 
>> [I don't know if really the TEXMFROOT is hard-coded
>> in the kpsewhich binary]
> 
> Hi Jean-François,
> TEXMFROOT is defined in
> 
>  /usr/local/texlive/2017/texmf-dist/web2c/texmf.cnf
> 
> Its value is relative to the location of the binaries.  TeX Live sets
> 
>  TEXMFROOT = $SELFAUTOPARENT
> 
> because binaries are in .../bin/<platform> and Linux distributors set
> 
>  TEXMFROOT = $SELFAUTODIR
> 
> because they only support one platform.  The value of TEXMFROOT should
> never be an absolute path, otherwise your TL installation isn't
> portable anymore.


thanks, I knew about texmf.cnf files but completely forgot about
checking out what MacPorts does.

Indeed, 
there is /opt/local/share/texmf/web2c/texmf.cnf which is a
symlink to /opt/local/etc/texmf/texmf.cnf, and the latter does contain 

TEXMFROOT = /opt/local/share

as you surmised.

There is also this comment right prior to that setting:

% Normally the root directory of all texmf trees, but we don't exactly
% have that. Mostly, we don't use it (and use absolute paths instead),
% but define it anyway with the most reasonable thing in case
% something else tries to use it.

I did the following experiment:

~$ cp /opt/local/libexec/texlive/binaries/kpsewhich ~/Downloads/kpsewhich

~$ ~/Downloads/kpsewhich -var-value TEXMFROOT
/opt/local/share

which indicates that the MacPorts kpsewhich binary has the location
of texmf.cnf hard-coded. (or perhaps some other binaries it may call)

I confirmed that by manual edit of /opt/local/etc/texmf/texmf.cnf
to modify the TEXMFROOT setting to some random path and I checked 
that after that modification
~/Downloads/kpsewhich -var-value TEXMFROOT
did produce that random path.

however, "strings kpsewhich" which I had tried first had not allowed
identifying a hardcoded texmf.cnf absolute path in the MacPorts kpsewhich.


> 
> Kpathsea variables can be overwritten by environment variables.  Does
> your environment overwrite TEXMFROOT?


It does not overwrite TEXMFROOT.

For info, it does set some such environment variables:

TEXMFSYSVAR
TEXMFLOCAL
TEXMFDIST
TEXMFMAIN
SYSTEXMF
TEXMFHOME

The first four are actually deduced dynamically from the TexmfSysVar,
TexmfLocal, Root/texmf-dist, and AllTexmf/texmf symlinks in
/Library/TeX/Distributions/.DefaultTeX/Contents/
which is a Mac specific thing (the "TeXDist" control panel whose
config files I maintain manually from year to year).

For example:

export TEXMFSYSVAR="`cd -P $TEXDISTRIBCONTENTS/TexmfSysVar && pwd`"

where 
TEXDISTRIBCONTENTS="/Library/TeX/Distributions/.DefaultTeX/Contents"


The only reason for setting them as environment variable is speed:
some years ago Emacs/AucTeX did 9 calls to kpsewhich -var-value
at each initial opening of a .tex file, which amounted to many
seconds. Then they reduced it to 3 calls, but still it was too
slow for something happening at least once a day.

My set-up however has this defect that if I switch say from
TL2017 to TL2015, then I must quit and relaunch Emacs for it
to get the new values, because the environment variables
must be re-initialized from my .bash_profile

Returning to:

> Its value is relative to the location of the binaries.  TeX Live sets
> 
>  TEXMFROOT = $SELFAUTOPARENT
> 
> because binaries are in .../bin/<platform> and Linux distributors set
> 
>  TEXMFROOT = $SELFAUTODIR
> 
> because they only support one platform.  The value of TEXMFROOT should
> never be an absolute path, otherwise your TL installation isn't
> portable anymore.

The MacPorts texlive binaries appear to be in 

/opt/local/libexec/texlive/binaries

and as far as I can tell this is supposed to work via the
/Library/TeX/Distributions mechanism as I see no symlinks
in /opt/local/bin (which MacPorts add to PATH)
but there is a 

 /opt/local/libexec/texlive/texdist-2017

which contains only the symlink

 x86_64-darwin -> /opt/local/libexec/texlive/texbin

This however has a non-existent destination,
it should perhaps be "binaries", not "texbin".

It could be that my MacPorts install was only too partial,
but anyway what I did was to extract its binaries
and translocate them to a sub-repertory of
/usr/local/texlive/2017/bin


(for the reasons explained earlier in the thread that
the darwinlegacy binaries which support an extended
range of "old" mac os x systems up to and inclusive
of Mavericks have a speed problem on Mavericks)


Jean-François




More information about the tex-live mailing list