On 06/05/2025 10:34, Simon Josefsson wrote:
podman run -it --rm debian:trixie
apt-get update
apt-get install -y --no-install-recommends gradle
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
gradle
/bin/gradle: 23: cd: can't cd to /bin/../share/gradle/bin/..

The problem seems that it is generating a relative path to its own
command expanded via PATH, which doesn't work because there is no /share
symlink but there is /usr/share/.

Perfectly reasonable method to support installing to /usr, /usr/local, $HOME/.local, ...

Is this a problem in 'gradle' (and other packages) that should be
reported and fixed?  What severity?

I would view it as a missing feature in setpriv to set an env var.
Fedora doesn't set /bin anymore in the $PATH and trying to unify /usr/bin and /usr/sbin. setpriv should probably accommodate that since debian and Fedora behave differently. Even openwrt routers prefer /usr/bin.

What can packages assume about PATH?  What can packages not assume?  In
particular wrt ordering.  Are there written down rules for this?

Assume more local entries first ($HOME/.local/X, then /usr/local/X), then /usr/X preferred. /X is fallback only.
Cannot assume "argv[0] == /usr/bin/X" or base is /usr in general.
Not sure if that helped.


--
Regards,
Ahmad

Reply via email to