abuild: downgrade binfmt-registration error to a warning

strictly speaking, it is possible for an x86_64 cpu to run 32-bit
userspace binaries without qemu emulation. it is also possible for an
aarch64 cpu to run armhf/armv7 binaries (as long as the cpu implements
it, most do). rather than check for every possible combination of when
this is allowed (host cpu + emulated target, does cpu support it, ...),
just downgrade this case to a warning, to permit non-emulated use.

ref https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/117#note_255174
This commit is contained in:
psykose 2023-06-01 07:29:59 +00:00
parent fdf1a3a6fb
commit 0e333003df
1 changed files with 3 additions and 2 deletions

View File

@ -2463,8 +2463,9 @@ rootbld() {
if ! [ $CBUILD_ARCH = "$(apk --print-arch)" ]; then
# cross-building, so check for binfmt registration
if ! [ -f "/proc/sys/fs/binfmt_misc/qemu-$(rootbld_qemu_arch)" ]; then
die "rootbld: binfmt registration missing for $(rootbld_qemu_arch) binaries"
local qarch="$(rootbld_qemu_arch)"
if ! [ -f "/proc/sys/fs/binfmt_misc/$qarch" ]; then
warning "rootbld: binfmt registration missing for $qarch binaries"
fi
# TODO: it's not safe to mix a cache dir between architectures,
# so we have to use something other than /etc/apk/cache