void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.6k stars 2.16k forks source link

texlive-ConTeXt is broken #28727

Open r-ricci opened 3 years ago

r-ricci commented 3 years ago

System

Expected behavior

context --version (from the texlive-ConTeXt package) should print something like this (obtained with the texlive-bin package):

mtx-context     | ConTeXt Process Management 1.03
mtx-context     |
mtx-context     | main context file: /opt/texlive/2020/texmf-dist/tex/context/base/mkiv/context.mkiv
mtx-context     | current version: 2020.03.10 14:44
mtx-context     | main context file: /opt/texlive/2020/texmf-dist/tex/context/base/mkiv/context.mkxl
mtx-context     | current version: 2020.03.10 14:44

Actual behavior

If texlive-LuaTeX is not installed, it prints:

/usr/bin/env: ‘texlua’: No such file or directory

If texlive-LuaTeX is installed, it prints:

mtxrun          | unknown script 'context.lua' or 'mtx-context.lua'
ericonr commented 3 years ago
texlive-core-2020.57066_1   /usr/share/texmf-dist/scripts/context/lua/context.lua
texlive-core-2020.57066_1   /usr/share/texmf-dist/scripts/context/lua/mtx-context.lua

It does things very weirdly:

5965  open("/bin/mtx-t-context.lua", O_RDONLY) = -1 ENOENT (Arquivo ou diretório inexistente)
5965  getcwd("/home/ericonr", 4096)     = 14
5965  getcwd("/home/ericonr", 4096)     = 14
5965  stat("context.lua", 0x7ffda61ea580) = -1 ENOENT (Arquivo ou diretório inexistente)
5965  stat("./context.lua", 0x7ffda61ea580) = -1 ENOENT (Arquivo ou diretório inexistente)
5965  stat("context.lua", 0x7ffda61ea580) = -1 ENOENT (Arquivo ou diretório inexistente)
[... other attempts at weird paths ...]

So it would seem to be missing some information on how to locate those scripts, since they definitely exist.

applesud commented 3 years ago

Hi! Did anyone ever figure out a workaround for this?

I'm not sure, but it looks like it's something to do with the variable SELFAUTOPARENT. The Void Package seems to try to hard code it out:

sed -i -e 's:^\(TEXMFROOT *= *\)$SELFAUTOPARENT$:\1/usr/share:g'

But ConTeXt seems to use it. It seems to be set to / when I run kpsewhich, but when I run mtxrun --variables, it seems to resolve to ./.

Edit: I just looked into this a bit more, and apparently SELFAUTOPARENT is just 2 directories up from the location of kpsewhich (or some other executable that serves a similar role, I'm not sure). In a manually installed texlive disribution, this would end up being the texlive root directory. However, void puts kpsewhich in /usr/bin, so SELFAUTOPARENT is would be set to /. But, separately to that, there seems to be bug in ConTeXt's file.collapsepath which causes it to collapse /usr/bin/../.. into ..

github-actions[bot] commented 2 years ago

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.

r-ricci commented 2 years ago

Same thing with version 20210325_3.