[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg test suite fails on Alpine Linux starting with 1.21.10



Hi!

On Mon, 2022-12-05 at 21:16:19 +0100, Guillem Jover wrote:
> On Mon, 2022-12-05 at 20:43:45 +0100, Sören Tempel wrote:
> > alpine:latest is the latest stable release. I encountered this on
> > alpine:edge, which is our rolling release development version (basically
> > Debian Sid). It is interesting that it doesn't seem to fail in
> > alpine:latest though. However, I can reproduce it in a fresh alpine:edge
> > Docker image using the following commands:
> > 
> > 	$ docker run -it alpine:edge
> > 	/ # cat /etc/alpine-release
> > 	3.17_alpha20221110
> > 	/ # apk add build-base ncurses-dev xz coreutils gzip bzip2-dev linux-headers perl zlib-dev po4a tar libmd-dev
> > 	/ # wget https://deb.debian.org/debian/pool/main/d/dpkg/dpkg_1.21.11.tar.xz
> > 	/ # tar -xvf dpkg_1.21.11.tar.xz
> > 	/ # cd dpkg-1.21.11
> > 	/ # ./configure --disable-nls
> > 	/ # make -j$(nproc)
> > 	/ # make -C scripts/ check
> > 
> > I haven't tried reproducing the failure on alpine:latest yet so please
> > let me know if you are also not able to reproduce the hang on alpine:edge.

> Ah, sorry, can certainly reproduce now. This smells like a problem with
> GNU make 4.4, AFAIR that release contains several behavior breaking
> changes. Will see what's going on and prep a fix for 1.21.12.

Ok, looks like this might be due to the new GNU make behavior change
where $(shell) now properly gets all exported variables, which is causing
recursion. Passing -f to dpkg-arechitecture in the .mk fragment makes the
test pass, but I've to make sure this is the right fix, as that will mean
externally set variables are not honored, but then that would be the case
anyway with the old $(shell) behavior, so I guess not a regression.

Attached a tentative patch.

Thanks,
Guillem
From 891fff7ec1e0db5fa4a951ba22ec7a13fba80767 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Mon, 5 Dec 2022 21:47:28 +0100
Subject: [PATCH] scripts/mk: Pass -f to dpkg-architecture in architecture.mk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

With new GNU make 4.4, the $(shell) function now properly inherits
exporter variables, which is making these lead to recursion during
expansion. Given that we were not respecting any externally set
environment variables by the user, forcing to ignore them is not a
regression (FIXME, although perhaps that behavior should actually
be fixed!).

Reported-by: Sören Tempel <soeren@soeren-tempel.net>
---
 scripts/mk/architecture.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk
index c11cada16..8480411f6 100644
--- a/scripts/mk/architecture.mk
+++ b/scripts/mk/architecture.mk
@@ -4,7 +4,7 @@
 
 dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1)))
 
-dpkg_architecture_setvar = export $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1))
+dpkg_architecture_setvar = export $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -f -q$(1))
 
 $(foreach machine,BUILD HOST TARGET,\
   $(foreach var,ARCH ARCH_ABI ARCH_LIBC ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\
-- 
2.38.1


Reply to: