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 84d7b7693d.
This commit is contained in:
Sören Tempel 2023-06-22 21:53:46 +02:00
parent 7e82b6a34b
commit c9b4146aaa
1 changed files with 8 additions and 1 deletions

9
abuild.in Executable file → Normal file
View File

@ -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" \