From c9b4146aaa32e87aee87f5fdc55f0e313b0f8e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Thu, 22 Jun 2023 21:53:46 +0200 Subject: [PATCH] Revert "rootbld: run mkusers inside the chroot and don't affect host users" We can't run mkusers inside the chroot because of bwrap peculiarities. Presently, rootbld does therefore not work at all for APKBUILDs which use $pkggroups/$pkguser. While not polluting the host is a noble goal it isn't really useful if it causes rootbld to be incapable of building certain packages (i.e. those using $pkggroups/$pkguser with groups not existent on the host). This commit therefore restores the original behavior for now. While at it, I also added a comment to the mkusers invocation. See: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10094 This reverts commit 84d7b7693d44a95d4aba4ea44bd768e2512d92cb. --- abuild.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) mode change 100755 => 100644 abuild.in diff --git a/abuild.in b/abuild.in old mode 100755 new mode 100644 index e9ccc42..ab6d313 --- a/abuild.in +++ b/abuild.in @@ -2483,7 +2483,7 @@ rootbld_actions() { if ! want_check; then _check=true fi - for part in symlinksrc unpack prepare mkusers build $_check rootpkg; do + for part in symlinksrc unpack prepare build $_check rootpkg; do runpart $part done } @@ -2541,6 +2541,13 @@ rootbld() { msg "Preparing build chroot..." + # Unfortunately, we can't create the users inside the chroot. + # Hence, we need to do it on the host which is not optimal as it + # pollutes the host's /etc/group and /etc/passwd file. + # + # See https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10094 + mkusers + BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX) mkdir -p "$BUILD_ROOT/proc" "$BUILD_ROOT/etc/apk/keys" \