termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.07k stars 3k forks source link

[Bug]: After upgrading texlive-bin: "I can't find the format file `pdflatex.fmt` #19637

Closed natebragg closed 6 months ago

natebragg commented 6 months ago

Problem description

Before upgrading to version 2024031 of texlive-bin, everything worked fine. After upgrading, I get the following when running pdflatex:

kpathsea: Running mktexfmt pdflatex.fmt
Can't locate mktexlsr.pl in @INC (@INC entries checked: /data/data/com.termux/files/usr/share/texlive/2024/tlpkg /data/data/com.termux/files/usr/share/texlive/2024/texmf-dist/scripts/texlive /data/data/com.termux/files/usr/lib/perl5/site_perl/5.38.2/aarch64-android /data/data/com.termux/files/usr/lib/perl5/site_perl/5.38.2 /data/data/com.termux/files/usr/lib/perl5/5.38.2/aarch64-android /data/data/com.termux/files/usr/lib/perl5/5.38.2) at /data/data/com.termux/files/usr/bin/texlive/mktexfmt line 23.
BEGIN failed--compilation aborted at /data/data/com.termux/files/usr/bin/texlive/mktexfmt line 25.
I can't find the format file `pdflatex.fmt'!

I followed some suggestions from non-termux related sources (e.g., texhash) to no avail.

To fix it, I had to pkg remove texlive-bin; rm -rf $PREFIX/bin/texlive/; rm -rf $PREFIX/share/texlive; pkg install texlive-bin; termux-install-tl; termux-patch-texlive; texlinks, which seems pretty excessive.

What steps will reproduce the bug?

Upgrade an existing texlive-bin installation. Create a .tex file and run pdflatex on it.

What is the expected behavior?

That pdflatex runs as before the upgrade

System information

termux-info:

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=5772
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-x11 x11 main
# root-repo (sources.list.d/root.list)
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-root root stable
Updatable packages:
command-not-found/stable 2.4.0-18 aarch64 [upgradable from: 2.4.0-17]
libandroid-utimes/stable 0.4 aarch64 [upgradable from: 0.2]
liblzma/stable 5.6.1+really5.4.5 aarch64 [upgradable from: 5.6.1]
ndk-sysroot/stable 26b-3 aarch64 [upgradable from: 26b-2]
vim-gtk/x11 9.1.0200 aarch64 [upgradable from: 9.1.0100]
xz-utils/stable 5.6.1+really5.4.5 aarch64 [upgradable from: 5.6.1]
termux-tools version:
1.41.2
Android version:
12
Kernel build information:
Linux localhost 5.10.185+ #1 SMP PREEMPT Wed Mar 20 17:33:46 PDT 2024 aarch64 Android
Device manufacturer:
Oculus
Device model:
Quest 3
LD Variables:
LD_LIBRARY_PATH=/data/data/com.termux/files/usr/opt/gurobi1100/armlinux64/lib
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.tasker versionCode:6
Grimler91 commented 6 months ago

This is more or less* expected with a major update like 2023 -> 2024. Re-running termux-install-tl is required to install 2024 files that can be used with texlive-bin-2024.

* Probably texlive-bin 2024 would have worked with texlive 2023 if formats were re-generated, but I also changed installation path, and so the scripts failed to find include paths as in your posted error message.

See also texlive's upgrade page: https://tug.org/texlive/upgrade.html which states that re-installing is the recommended way to upgrade

natebragg commented 6 months ago

While I'll admit that it's sort of reassuring that the issue is that cut and dry (and hopefully this will serve to help anyone else that comes across this issue), it would be nice if it were possible to perform this automatically, or at least somehow make the user aware of its necessity.

Grimler91 commented 6 months ago

Automatic is difficult with an installation script, user might want to customize option (like which scheme to install). I can add some more text to postinst script about how upgrades should be done

Proper solution would be to package all of texlive's files in proper (sub)packages, but that was quite horrible to maintain when we (almost) did it that way.

Anyways, thanks for opening an issue! I am sure more people wondering the same thing will see it as well!