From 855992822dba01360cd5c6406cd90ac690303d4c Mon Sep 17 00:00:00 2001 From: Sertonix Date: Wed, 10 Apr 2024 12:12:20 +0200 Subject: [PATCH] abuild: update cachedir logic for rootbld Closes [#10111] [#10111]: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10111 --- abuild.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/abuild.in b/abuild.in index e194c69..9951dba 100644 --- a/abuild.in +++ b/abuild.in @@ -2511,19 +2511,15 @@ rootbld() { [ $CBUILD = $CHOST ] || die "rootbld: set CBUILD=$CHOST to build for $CHOST" + local cachedir=/etc/apk/cache if ! [ $CBUILD_ARCH = "$($APK --print-arch)" ]; then # cross-building, so check for binfmt registration local qarch="$(rootbld_qemu_arch)" if ! [ -f "/proc/sys/fs/binfmt_misc/qemu-$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 - # to get a cache when cross-qemu-building. - #local cachedir="" - else - # not cross-building in qemu, so use host cache - local cachedir="/etc/apk/cache" + # Old versions of apk have cache conflicts + $APK info -eq 'cmd:apk>=2.14.1' || cachedir="" fi logcmd "chroot building building $repo/$pkgname-$pkgver-r$pkgrel"