From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context <ntg-context@ntg.nl>
Cc: Max Chernoff <mseven@telus.net>
Subject: [NTG-context] LuaMetaTeX doesn't find files when symlinked
Date: Thu, 27 Apr 2023 22:00:34 -0600 [thread overview]
Message-ID: <9338ba4d4d69bc3ce633ed9c0eebf116fa473a25.camel@telus.net> (raw)
Hi Hans,
With the LuaMetaTeX-based ConTeXt wrapper, it's not generally possible
to run ConTeXt from a symlinked binary in another directory. This shows
up if someone makes symlinks in "/usr/bin" so that they can avoid adding
anything to their $PATH.
If you make run a symlink to the LuaMetaTeX-based ConTeXt wrapper, it
looks for texmfcnf.lua relative to the symlink location, not the symlink
target. With the old LuaTeX/kpse-based wrapper, the script would look
for texmfcnf.lua relative to the symlink target.
I know that my description above is terrible, so here's a demo:
$ bin=$(mtxrun --expand-var TEXMFOS | head -1)/*
$ cd $(mktemp -d)
$ ln -s $bin/luatex $bin/luametatex $bin/context $bin/context.lua $bin/mtxrun $bin/mtxrun.lua .
$ ./context --nofile
$ ./context --luatex --nofile
Running the above commands used to work with the old LuaTeX/kpse-based
wrapper, but it doesn't work any more. I was able to ""fix"" this by
adding the lines
if os.selfpath then
environment.ownbin = lfs.symlinktarget(os.selfpath .. io.fileseparator .. os.selfname)
environment.ownpath = environment.ownbin:match("^.*" .. io.fileseparator)
else
environment.ownpath = kpse.new("luatex"):var_value("SELFAUTOLOC")
environment.ownbin = environment.ownpath .. io.fileseparator .. (arg[-2] or arg[-1] or arg[0] or "luatex"):match("[^" .. io.fileseparator .. "]*$")
end
to mtxrun.lua, right below the line
package.loaded["data-ini"] = package.loaded["data-ini"] or true
but this is obviously not a very good fix.
There are some threads with more details at:
https://tug.org/pipermail/tex-live/2023-March/049028.html
https://gitlab.com/islandoftex/images/texlive/-/issues/30
Those links only discuss TL, but I get the same issue if I make a symlink
to the standalone ConTeXt files.
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2023-04-28 4:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 4:00 Max Chernoff via ntg-context [this message]
2023-04-28 7:20 ` lynx--- via ntg-context
2023-04-28 8:28 ` Max Chernoff via ntg-context
2023-04-28 18:14 ` lynx--- via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9338ba4d4d69bc3ce633ed9c0eebf116fa473a25.camel@telus.net \
--to=ntg-context@ntg.nl \
--cc=mseven@telus.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).