zap -a permission denied when removing apk_root in pmb workdir
$ pmbootstrap --details-to-stdout -y zap -a
[18:21:12] $ pmbootstrap /home/clayton/src/pmbootstrap/pmbootstrap.py --details-to-stdout -y zap -a
[18:21:12] Pmbootstrap v3.0.0_alpha (Python 3.12.7 (main, Oct 22 2024, 14:30:53) [GCC 14.2.0])
[18:21:12] Remove binary packages that are newer than the corresponding pmaports (channel 'systemd-edge')? (y/n) [n]: y
[18:21:12] Remove outdated binary packages? (y/n) [n]: y
[18:21:12] ERROR: [Errno 13] Permission denied: '/home/clayton/.local/var/pmbootstrap/tmp/apk_root'
[18:21:12] See also: <https://postmarketos.org/troubleshooting>
[18:21:12] Traceback (most recent call last):
File "/home/clayton/src/pmbootstrap/pmb/__init__.py", line 108, in main
run_command(args)
File "/home/clayton/src/pmbootstrap/pmb/commands/__init__.py", line 60, in run_command
getattr(frontend, args.action)(args)
File "/home/clayton/src/pmbootstrap/pmb/helpers/frontend.py", line 525, in zap
pmb.chroot.zap(
File "/home/clayton/src/pmbootstrap/pmb/chroot/zap.py", line 76, in zap
zap_pkgs_online_mismatch(confirm, dry)
File "/home/clayton/src/pmbootstrap/pmb/chroot/zap.py", line 189, in zap_pkgs_online_mismatch
pmb.helpers.apk.cache_clean(arch)
File "/home/clayton/src/pmbootstrap/pmb/helpers/apk.py", line 243, in cache_clean
tmproot.mkdir(exist_ok=True)
File "/usr/lib/python3.12/pathlib.py", line 1311, in mkdir
os.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/home/clayton/.local/var/pmbootstrap/tmp/apk_root'
Before you report this error, ensure that pmbootstrap is up to date.
Find the latest version here: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/tags
Your version: 3.0.0_alpha
[18:21:12] % cd /home/clayton/.local/var/pmbootstrap/cache_git/pmaports; git rev-parse --abbrev-ref HEAD
[18:21:12] % cd /home/clayton/.local/var/pmbootstrap/cache_git/pmaports; git status --porcelain
Channel: systemd-edge (pmaports: master_staging_systemd, dirty)
Device: oneplus-enchilada (aarch64)
UI: gnome-mobile
systemd: yes ('always' selected in 'pmbootstrap init')
I bisected it to this commit:
commit 42158637a7af57a3505319726876856f7459e748
Author: Caleb Connolly <caleb@postmarketos.org>
Date: Sun Oct 27 20:56:54 2024 +0100
chroot: apk: use apk.static in all cases (MR 2463)
cc @caleb