Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 956026 - acct-user/mail and acct-user/postmaster fails merging in alternate ROOT
Summary: acct-user/mail and acct-user/postmaster fails merging in alternate ROOT
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-05-16 13:02 UTC by Mark Liman
Modified: 2025-05-24 17:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Liman 2025-05-16 13:02:55 UTC
Sorry I am making a bug for two packages in one report, however, it's the same bug so it makes sense, when trying to emerge acct-user/mail or acct-user/postmaster in a crossdev environment they will both fail for the same reason.

acct-user/mail:
chown: invalid group: ‘root:mail’
 * ERROR: acct-user/mail-0-r3::gentoo failed (preinst phase):
 *   fowners failed

acct-user/postmaster:
chown: invalid group: ‘root:mail’                                                                                                                        
 * ERROR: acct-user/postmaster-0-r3::gentoo failed (preinst phase):                                                                                      
 *   fowners failed    

Both packages try to chown /var/spool/mail with root:mail, however, even though they have acct-group/mail in their RDEPEND, it isn't replicated in their BDEPEND meaning it never gets merged on the cross host therefore from it's perspective the group doesn't exist causing chown to fail.
Comment 1 Mike Gilbert gentoo-dev 2025-05-19 16:21:22 UTC
It should probably be in IDEPEND, not BDEPEND.

I also wonder if we should handle this in the eclass instead of individual ebuilds.
Comment 2 Mike Gilbert gentoo-dev 2025-05-19 18:10:30 UTC
Ah, this is an eclass bug that triggered only when ACCT_USER_HOME_OWNER is set in the ebuild.
Comment 3 Larry the Git Cow gentoo-dev 2025-05-22 19:39:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f5b1abe6af8e4158491d11370748edc9a004223

commit 0f5b1abe6af8e4158491d11370748edc9a004223
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2025-05-19 19:00:34 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2025-05-22 19:38:32 +0000

    acct-user.eclass: handle ACCT_USER_HOME_OWNER when ROOT is not empty
    
    We need to resolve the user and group names to numeric ids before
    calling fowners.
    
    Closes: https://bugs.gentoo.org/956026
    Closes: https://github.com/gentoo/gentoo/pull/42158
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/acct-user.eclass | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
Comment 4 Sungjoon Moon 2025-05-24 15:38:19 UTC
This patch breaks acct-user/portage installation when I cross compile.

```
* Messages for package acct-group/portage-0-r2 merged to /root/crossdev-stages/stage3-20250523/:

 * Group portage already exists

 * Messages for package acct-user/portage-0-r3 merged to /root/crossdev-stages/stage3-20250523/:

 * User portage already exists
 * ERROR: acct-user/portage-0-r3::gentoo failed (preinst phase):
 *   fowners failed
 * 
 * If you need support, post the output of `emerge --info '=acct-user/portage-0-r3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=acct-user/portage-0-r3::gentoo'`.
 * The complete build log is located at '/usr/riscv64-unknown-linux-gnu/tmp/portage/acct-user/portage-0-r3/temp/build.log'.
 * The ebuild environment file is located at '/usr/riscv64-unknown-linux-gnu/tmp/portage/acct-user/portage-0-r3/temp/environment'.
 * Working directory: '/usr/riscv64-unknown-linux-gnu/tmp/portage/acct-user/portage-0-r3/empty'
 * S: '/usr/riscv64-unknown-linux-gnu/tmp/portage/acct-user/portage-0-r3/work/portage-0'
```