mate-desktop / mate-panel

MATE panel
https://mate-desktop.org
GNU General Public License v2.0
185 stars 118 forks source link

Python MatePanelApplet's do not receive custom $PATH #1316

Closed tycho-kirchner closed 1 year ago

tycho-kirchner commented 2 years ago

Hi, when launching mate-panel with a custom $PATH set, python panel applets like mate-menu or brisk-menu do not pick it up, but instead receive the "system-default", e.g. /usr/local/bin:/usr/bin:/bin. Note that for other, (probably) non-python-based menu-applets like the "Classic Menu", $PATH is correct.

Expected behaviour

$PATH should be inherited as usual.

Actual behaviour

$PATH is reset to some system default. With high certainty, this is not the fault of the mentioned plugins themselves. See next.

Steps to reproduce the behaviour

Install mate-menu (e.g. apt install mate-menu). Add the following lines below the imports in the file mate-menu.py, e.g. /usr/lib/mate-menu/mate-menu.py:

# ...
import traceback
import signal
import setproctitle
print("debugnow", os.environ["PATH"], file=sys.stderr)

Quit existing mate-panel, open a terminal and add a custom, non default path to $PATH, e.g. export PATH="$HOME/.bin:$PATH". Launch mate-panel from that same terminal mate-panel --sm-client-disable. On debian, the debug line can be read from /var/log/messages, $PATH does not include $HOME/.bin.

MATE general version

1.24.1

Package version

1.24.1

Linux Distribution

Debian 11 (bullseye)

Thanks.

Tycho

raveit65 commented 1 year ago

mate-menu or brisk-menu are third-party application. You should file out a report there.

tycho-kirchner commented 1 year ago

Hi @raveit65 and thanks for your response. However, as I tried to describe, before these plugins actually do something, $PATH is already incorrect. I think, something is broken in mate-panel's python plugin-infrastructure, so reporting a bug at mate- or brisk-menu would be pointless. Did you attempt to reproduce the wrong PATH according to above description? Thanks Tycho

raveit65 commented 1 year ago

No, i don't use third-party applets and without any stronger hints i don`t think something is broken in mate-panel. A report by the applets would inform their developers and they could confirm that the problem is here in panel.

Btw. those devs are inactive former mate developers and they can commit here.

JSBern commented 1 year ago

brisk is written in c not python, and the mate-menu(advanced menu) is unmaintained and hacky

tycho-kirchner commented 1 year ago

@JSBern Whoops, dunno why last year I wrote that it's python 😅 ... Just took another quick look - both, mate- and brisk menu contain some dbus service in /usr/share/dbus-1/services

org.mate.panel.applet.MateMenuAppletFactory.service
org.mate.panel.applet.BriskMenuFactory.service

After modifying PATH and calling dbus-update-activation-environment PATH and re-launching mate-panel, indeed, the new PATH is used. So, I guess that's the root cause of my problem. I guess I'll indeed open an issue there, if it's not a technical requirement from the side of mate-panel to implement plugins as dbus-services ... Thanks Tycho

raveit65 commented 1 year ago

Those dbus service indicates that the applet is build out-of-process (from mate-panel) and those files are really needed. All our applet use them when build out-of-process and they are working fine. For future wayland session (where we actual work on) all applet needs to build in-process.