apk with usr-merge doesn't support --root (/usr/sbin/abuild: line 529: tar: Symbolic link loop)
Analysis
- alpine's tar package has a symlink
/usr/bin/tar
->/bin/tar
(APKBUILD) - Caleb's apk patches already have detection for this and don't replace tar in this case (here)
- But it does not work when apk.static gets called outside of the pmbootstrap chroot, with the
--root
parameter - pmbootstrap v3 installs packages like that when running
pmbootstrap build
Workaround
$ pmbootstrap -y zap
$ pmbootstrap chroot -- apk add tar
$ pmbootstrap build upower --force
Reproducer
Enable building for systemd, then:
$ pmbootstrap -y zap
$ pmbootstrap build upower --force
upower-v1.90.2.tar.bz2: OK
>>> upower: Unpacking /var/cache/distfiles/upower-v1.90.2.tar.bz2...
/usr/sbin/abuild: line 529: tar: Symbolic link loop
>>> ERROR: upower: unpack failed
Reproducer with building apk-tools from source:
#!/bin/sh -ex
BUILD_APK=0
if [ "$BUILD_APK" = 1 ]; then
pmbootstrap -y zap -p
pmbootstrap chroot -- apk add tar
pmbootstrap build --src=~/code/apk-tools apk-tools
fi
pmbootstrap -y zap
# upgrade to apk built from source
pmbootstrap chroot -- sh -c 'apk add /mnt/pmbootstrap/packages/systemd-edge/x86_64/apk-tools-*.apk'
pmbootstrap build upower --force
Edited by Administrator