"man make.conf" states: ❯ man make.conf | sed -n -E '/PORTAGE_(USER|GRP)NAME/,/^$/p' PORTAGE_GRPNAME = [group] Defines the groupname to use when executing in userpriv/etc... modes (i.e. non-root). Defaults to portage. PORTAGE_USERNAME = [user] Defines the username to use when executing in userpriv/etc... modes (i.e. non-root). Defaults to portage. Therefore, these two variables should be set in make.globals and perhaps in make.conf.example.
This is relevant for: https://github.com/gentoo/portage/pull/1390
Being documented as having a default value which *is* set on the python side doesn't necessarily mean it *must* be in make.globals/defaults. We may want to do that but it's important to be precise about the problem (and make an argument for it).
It's been a while since I opened this bugs. IIRC, my reasoning was based upon: https://github.com/gentoo/portage/blob/597229aff02810764223a4cdd1e8056142d70ed0/man/make.conf.5#L21-L31 If it's acceptable for PORTAGE_USERNAME and PORTAGE_GRPNAME to be defined outside of those places, it should be mentioned in that section of the make.conf manpage. In general, I like to keep code and configuration separate.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a652b1289830ccb0eb138ef0844a312d9531e0a commit 5a652b1289830ccb0eb138ef0844a312d9531e0a Author: David Sardari <2036275+duxsco@users.noreply.github.com> AuthorDate: 2025-01-11 13:45:40 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2025-01-11 18:55:30 +0000 make.globals: Set PORTAGE_USERNAME and PORTAGE_GRPNAME variables "man 5 make.conf" states that "PORTAGE_USERNAME" and "PORTAGE_GRPNAME" default to "portage": - https://github.com/gentoo/portage/blob/597229aff02810764223a4cdd1e8056142d70ed0/man/make.conf.5#L1257-L1261 - https://github.com/gentoo/portage/blob/597229aff02810764223a4cdd1e8056142d70ed0/man/make.conf.5#L1109-L1113 But, the two variables are not set in the files pointed out by "man 5 make.conf": https://github.com/gentoo/portage/blob/597229aff02810764223a4cdd1e8056142d70ed0/man/make.conf.5#L21-L31 This commits solves the discrepancy. Bug: https://bugs.gentoo.org/941977 Signed-off-by: David Sardari <d@duxsco.de> Closes: https://github.com/gentoo/portage/pull/1414 Signed-off-by: Zac Medico <zmedico@gentoo.org> cnf/make.globals | 4 ++++ 1 file changed, 4 insertions(+)
I've realized that this default change actually breaks PORTAGE_USERNAME and PORTAGE_GRPNAME setup for "unprivileged" mode. We should really set the defaults inside the config class, conditionally.
Fixed to support unprivileged mode: https://gitweb.gentoo.org/proj/portage.git/commit/?id=327848b1cb9dbcaea5a45f4e6cd83856ac07fb44 Author: Zac Medico <zmedico@gentoo.org> Date: 2025-01-11 14:55:56 -0800 config: Initialize default PORTAGE_USERNAME and PORTAGE_GRPNAME Intialize default PORTAGE_USERNAME and PORTAGE_GRPNAME for privileged mode. Signed-off-by: Zac Medico <zmedico@gentoo.org>