Skip to content

arch-nspawn calls systemd-nspawn with invalid --bind-ro arguments

Created by: nastasie-octavian

I'm using aurutils to build and manage AUR packages and I haven't been able to build packages in a chroot since devtools updated a while back. I think the problem is with devtools so I'm opening the issue here.

I have this local repo in pacman.conf

[aur_repo] SigLevel = Required TrustedOnly Server = file:///srv/http/pacman-cache/aur_repo/os/x86_64

When I try to build packages using aurutils with a chroot it fails with

Failed to stat /srv/http/pacman-cache/repo/os/arch: No such file or directory

I digged around and fund that arch-nspawn calls systemd-nspawn with

--bind=/var/cache/pacman/pkg --bind-ro=/srv/http/pacman-cache/aur_repo/os/x86_64 --bind-ro=/srv/http/pacman-cache/repo/os/arch

I digged some more and I think that the problem was introduced in https://github.com/archlinux/devtools/commit/69112171e5de910331e46cf3f848866550125024 , specifically cache_dirs+=("$line"), the value stored in $line was obtained by replacing the actual repo name and arch from the Server line in pacman.conf with the $repo and $arch placeholder strings. $line doesn't indicate an actual folder on the filesystem so it isn't a valid argument to --bind.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information