termux / termux-packages

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

[Bug]: LXQT doesn't inherit LD_PRELOAD value for termux-exec #21576

Closed DuilioPerez closed 2 weeks ago

DuilioPerez commented 3 weeks ago

Problem description

I've tried to install some plugins in coc.nvim when I was using lxqt, but it reported an error. I tried to install it manually, and it seems npm can't ve excecuted on GUI. In termux app (terminal emulator, no GUI), it works normally. Screenshot_20240925-190003_TermuxX11 Here is a screenshot in two DE. npm don't work, but nodejs works perfectly

What steps will reproduce the bug?

Excecute npm when you are using a desktop, here is working in Termux: Screenshot_20240925-191353_Termux

What is the expected behavior?

To run npm

System information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=30708
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://termux.danyael.xyz/termux/termux-main stable main
# glibc-repo (sources.list.d/glibc.list)
deb https://packages-cf.termux.dev/apt/termux-glibc/ glibc stable
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://termux.danyael.xyz/termux/termux-x11 x11 main
Updatable packages:
fribidi/stable 1.0.16 aarch64 [upgradable from: 1.0.15]
git/stable 2.46.2 aarch64 [upgradable from: 2.46.1]
gtk4/x11 4.16.2 aarch64 [upgradable from: 4.16.1-1]
harfbuzz-icu/stable 10.0.1 aarch64 [upgradable from: 9.0.0]
harfbuzz-utils/stable 10.0.1 aarch64 [upgradable from: 9.0.0]
harfbuzz/stable 10.0.1 aarch64 [upgradable from: 9.0.0]
libuv/stable 1.49.0 aarch64 [upgradable from: 1.48.0]
mpv/stable 0.39.0 aarch64 [upgradable from: 0.38.0-1]
termux-tools version:
1.43.5
Android version:
11
Kernel build information:
Linux localhost 4.14.186-22735277 #1 SMP PREEMPT Sat Feb 19 02:14:57 KST 2022 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A225M
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.x11 versionCode:15
com.termux.styling versionCode:32
sylirre commented 3 weeks ago

Provide output of echo $LD_PRELOAD executed in LXQT terminal, where npm failed.

DuilioPerez commented 2 weeks ago

In both, lxqt and xfce fails, and in both, echo $LD_PRELOAD don't print nothing, just a newline. In Termux, it prints /data/data/com.termux/files/usr/lib/libtermux-exec.so.

sylirre commented 2 weeks ago

That explains why npm doesn't work. Looks like desktop doesn't inherit environment variables.

DuilioPerez commented 2 weeks ago

Excuse me, I think title isn't correct, because it is the same in xfce. It don't work in both DE

DuilioPerez commented 2 weeks ago

It's on GUI in general. With this:

 $ termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-terminal"                            
(xfce4-terminal:13956): xfce4-terminal-WARNING **: 08:20:42.854: Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined

It doesn't work too:

Screenshot_20240930-082118_TermuxX11

fornwall commented 2 weeks ago

It's on GUI in general.

Indeed, it seems to be a general termux-x11 problem - proposed https://github.com/termux/termux-x11/pull/728 to fix that.

twaik commented 2 weeks ago

Probably it is caused by this line. https://github.com/termux/termux-x11/blob/f20fbbd6996653d2e03dbc7e3932508a88aaa15c/termux-x11#L3 But removing it will make termux-x11 not working on some devices (probably, idk if it is relevant for modern termux).