Hi I'm doing archive-wide package rebuilds in GitLab CI/CD and my toolchain uses 'setpriv --reset-env' to drop privileges and reset the environment variables, which results in:
PATH=/usr/local/bin:/bin:/usr/bin This unusual ordering appears to be intentional for setpriv: https://manpages.debian.org/bookworm/util-linux/setpriv.1.en.html However this ordering is different than the PATH used on buildd's: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games Having /bin before /usr/bin cause FTBFS of some packages. The most simple example is packages that invoke gradle. It appears to happen both on bookworm and trixie, and is easy to reproduce: 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/. Is this a problem in 'gradle' (and other packages) that should be reported and fixed? What severity? What can packages assume about PATH? What can packages not assume? In particular wrt ordering. Are there written down rules for this? Here is one example build log, if you want to see the error in action during a package build: https://gitlab.com/debdistutils/build/debian-bookworm-arm64-20250407-stage0/-/jobs/9927466433 /Simon
signature.asc
Description: PGP signature