maintainer-feedback requested: [Bug 262195] print/tex-luatex: 'make stage' fails (fmtutil / luatex error) if old tex-luatex installed

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 25 Feb 2022 16:31:21 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked Tex Mailing List (Nobody)
<tex@FreeBSD.org> for maintainer-feedback:
Bug 262195: print/tex-luatex: 'make stage' fails (fmtutil / luatex error) if
old tex-luatex installed
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262195



--- Description ---
If the old print/tex-luatex (0.80.0_24) is installed 'make -C
/usr/ports/print/tex-luatex stage' for the new version (1.12.0) fails.

It seems to be a problem where it looks in /usr/local (LOCALBASE) first for
files such as luatex.ini and others (like dvilualatex.ini and
lualatexiniconfig.tex perhaps) instead of in ${WRKDIR}.

Ideally the build should look in the working area first.

Additionally fmtutil prepends /usr/local/bin to the path so when it later
invokes luatex, it uses the one that is installed instead of the one in WRKDIR.
 In the current case (older 0.80.0_24 installed in PREFIX and 1.12.0 in
WRKDIR), it seems any differences in the luatex executable may not cause a
problem for the build (after a quick comparison of the build output results
using the old version against results using the new version), but there is
certainly no guarantee that a future update will not have a problem using the
old executable.  It definitely has a problem using the old tex-luatex data
files.

The build should take care to use the files in WRKDIR, and not use old versions
of files from tex-luatex that may be installed in /usr/local (it makes some
attempt to do that already by inserting WRKDIR/stage/usr/local/bin into the
PATH which helps some - it does not help for tools that use absolute paths, for
instance).  Worarounds: one can do 'sudo pkg delete -f tex-luatex' before doing
a build or do builds entirely in a clean isolated tree (such as poudriere
does).	But we can probably tweak this port to ensure it uses the files from
the new version of tex-luatex before the ones in PREFIX.

log attached