The PATH variable in _doebuild_path ( pym/portage/package/ebuild/doebuild.py ) is hardcoded to: ("usr/local/sbin", "usr/local/bin", "usr/sbin", "usr/bin", "sbin", "bin"): this can cause issues like https://bugs.gentoo.org/show_bug.cgi?id=475472 Please add an option to specify the PATH or place ""usr/sbin", "usr/bin"" before ""usr/local/sbin", "usr/local/bin"". Reproducible: Always
We already have the PREROOTPATH and ROOTPATH variables that you can use to insert paths before and after the defaults, respectively. The variables should contain colon-separate lists of paths, just like PATH does. You can set them using files in $EPREFIX/etc/env.d if you like.
(In reply to Zac Medico from comment #1) > We already have the PREROOTPATH and ROOTPATH variables that you can use to > insert paths before and after the defaults, respectively. The variables > should contain colon-separate lists of paths, just like PATH does. You can > set them using files in $EPREFIX/etc/env.d if you like. Thanks. Setting: PREROOTPATH="/usr/sbin:/usr/bin" in /etc/make.conf works for me. But wouldn't it make sense to simply move "usr/sbin", "usr/bin" before "usr/local/sbin", "usr/local/bin" in /pym/portage/package/ebuild/doebuild.py ?
From my experience, /usr/local paths are typically given priority, apparently as a means for the user to substitute local versions of programs in place of those provided by the distro. So, what's the point of having programs in /usr/local/*bin dirs if you don't actually want to use them?
(In reply to Zac Medico from comment #3) > From my experience, /usr/local paths are typically given priority, > apparently as a means for the user to substitute local versions of programs > in place of those provided by the distro. So, what's the point of having > programs in /usr/local/*bin dirs if you don't actually want to use them? *I* of course want to use them (by overriding /usr/bin programs), but portage shouldn't by default IMHO. But it's a question of personal preferences I guess, so lets close this bug. Thanks.