From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7352162563113615360 X-Forwarded-Encrypted: i=2; AJvYcCVjSvSUZktztjncX7iyXGPD0xJ+Vn2YaaUe/iUPr7adkvA+Zrl2bg+hkARnzLrGsUuV2Hu3k4KKlD3eg4pGhfC4GjrQsei8sdXwIP4= X-Received: by 2002:a2e:6a14:0:b0:2d6:8e88:5a6c with SMTP id f20-20020a2e6a14000000b002d68e885a6cmr6073681ljc.49.1711975383151; Mon, 01 Apr 2024 05:43:03 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9bcc:0:b0:2d7:5422:4268 with SMTP id w12-20020a2e9bcc000000b002d754224268ls832206ljj.1.-pod-prod-01-eu; Mon, 01 Apr 2024 05:43:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+oDdUVoLXox/YLDc/PfxdPYbnJ7HOR4GlRplfNfX0IfqNlx41Xts9JW6L1wkk58o0tGFyCLKX61NLQvWXE/j3gzuAH2MISilk8bA= X-Google-Smtp-Source: AGHT+IFpzUWnM0pIKkEz6p9nf/b24I1qsRLn170Oo1dtVrswYmEfhga54o0MyHrg2K4zjh/3w2e+ X-Received: by 2002:a2e:954e:0:b0:2d7:1ce5:3e24 with SMTP id t14-20020a2e954e000000b002d71ce53e24mr4255025ljh.34.1711975380487; Mon, 01 Apr 2024 05:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711975380; cv=none; d=google.com; s=arc-20160816; b=cec+FH3ua74TBM7ZGmKbDXhQB1G3pGm2b9j3B5NTrZclkTLBNs85j1M+8XKMJeg4PG 2Qpmt6kMnqIr5yOcI5IuBMZ5e3pyiOPTKcds3IVKgxm0BSXBRW+UbZPSxVy5GOjqxyzO Acw5+F4lLJclnJ7czOt1nYdAmon8NiHffgM+EBVlv9bVYUCr7OscKxqYgJ7Q7NgSljj/ pZurr6NvmEWwqCSvV+n/R0absZC2QesSU42DHKUk+bYlqnjrpUP4oJNuszmhGjRK+2nK m6HjdZPVJuoAxA7Fvz6FzhxBcoJSrdkew5hTB1svvCN2Fb+xDDSJjmvk8s8y4bRaUPQl ZzHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=5C66za2A0r7xgA+NSScMeTNzGUmRmOTs5D0/DRSExcE=; fh=toe3JxaqWj6CNLBodTC4VvYBkL4Sv5iCa6MroCGpkRg=; b=0uRELtG2zzIiwMuOFA6jJdfDzzst5oN6356DrSwk1fDeiEELRCDVzHnoCk92AYQVH3 cirdK27us10Ikd92GzYfWPAPfqEuLAH9s8fluG4ieiZeQhx2trHqRiti2j22bPWGnABG PM8wBqPMWE7n+Pdmndn+uaY3Iu+KwA2s1dohox6vG0JDLln/nnfecWH/NswQbSVc/7/t wDKGwIijZCyFCBXeReMUZPnKs0YqoWmmS+ex3VFKtbHnoZDSz1ytWuK9D/Sim67fqs73 L4O/KCkjhLnXv7SFkabpmMuka8eOnvo4M9qcmHTqeY46HOPC2394NySfbdkrmCtrXnY2 pSyQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id z18-20020a2e8852000000b002d4721d2d8esi334734ljj.2.2024.04.01.05.43.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2024 05:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from [IPv6:::1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 431CgvDn013121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Apr 2024 14:42:58 +0200 Message-ID: <5c7e3a6ac830450cea9b8380ce7fbe5853b3cc9f.camel@ilbers.de> Subject: Re: [PATCH] multiarch: Fix PN-to-BPN massaging From: Uladzimir Bely To: Jan Kiszka , isar-users Date: Mon, 01 Apr 2024 15:42:56 +0300 In-Reply-To: <426c29dc-ab8d-45e8-83e8-70ddcb91efce@web.de> References: <426c29dc-ab8d-45e8-83e8-70ddcb91efce@web.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: alSD5GQ4KHI3 On Sat, 2024-03-30 at 15:25 +0100, 'Jan Kiszka' via isar-users wrote: > From: Jan Kiszka >=20 > SRC_URI and FILESPATH are differently built, thus can't be handled > the > same way when trying to translate PN to BPN. While entries in the > former > are space-separated, they are colon-separated in the latter. >=20 > Furthermore, the existing logic didn't properly split the entries, > rather > processed the complete string. That was surely not desired as well. >=20 > Account for all by handling the variables separately and by splitting > them first. This fixes warnings like >=20 > WARNING: /build/../repo/meta-isar/recipes-core/images/isar-image- > installer.bb: Unable to get checksum for isar-image-installer-native > SRC_URI entry debian-configscript.sh: file could not be found >=20 > Signed-off-by: Jan Kiszka > --- > =C2=A0meta/classes/multiarch.bbclass | 16 ++++++++++------ > =C2=A01 file changed, 10 insertions(+), 6 deletions(-) >=20 > diff --git a/meta/classes/multiarch.bbclass > b/meta/classes/multiarch.bbclass > index 5783b0bf..3123045e 100644 > --- a/meta/classes/multiarch.bbclass > +++ b/meta/classes/multiarch.bbclass > @@ -46,12 +46,16 @@ python multiarch_virtclass_handler() { > =C2=A0=C2=A0=C2=A0=C2=A0 # parse time, and parsing always happens for all= build variants. > So in those > =C2=A0=C2=A0=C2=A0=C2=A0 # few variables, we automatically replace ${PN} = with ${BPN}. > =C2=A0=C2=A0=C2=A0=C2=A0 def fixup_pn_in_vars(d): > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vars =3D 'SRC_URI FILESPATH'.= split() > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for var in vars: > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 v =3D= d.getVar(var, expand=3DFalse) > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if v = is not None and '${PN}' in v: > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 d.setVar(var + ':remove', v) > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 d.appendVar(var, ' ' + v.replace('${PN}', '${BPN}')) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 v =3D d.getVar('SRC_URI', exp= and=3DFalse) or '' > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for uri in v.split(':'): > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if '$= {PN}' in uri: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 d.setVar('SRC_URI' + ':remove', uri) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 d.appendVar('SRC_URI', ' ' + uri.replace('${PN}', > '${BPN}')) > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 v =3D d.getVar('FILESPATH', e= xpand=3DFalse) or '' > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for path in v.split(':'): > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if '$= {PN}' in path: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 d.appendVar('FILESPATH', ':' + path.replace('${PN}', > '${BPN}')) >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 # When building compat/native, the corresponding= suffix needs to > be > =C2=A0=C2=A0=C2=A0=C2=A0 # propagated to all bitbake dependency definitio= ns. > -- > 2.35.3 >=20 Hello Jan. This patch seems to make all machines except qemuamd64 unbuildable. Error happens on parsing recipe stage. Example of output when "qemuarm" is selected in kas menu: ``` ERROR: ExpansionError during parsing /build/../repo/meta-isar/recipes- app/hello/hello.bb############################ | ETA: 0:00:00 Traceback (most recent call last): File "Var ", line 1, in File "/repo/bitbake/lib/bb/fetch2/__init__.py", line 1226, in get_checksum_file_list(d=3D): """ > fetch =3D Fetch([], d, cache =3D False, localonly =3D True) =20 File "/repo/bitbake/lib/bb/fetch2/__init__.py", line 1684, in Fetch.__init__(urls=3D['//hello'], d=3D, cache=3DFalse, localonly=3DTrue, connection_cache=3DNone): try: > self.ud[url] =3D FetchData(url, d, localonly) except NonLocalMethod: File "/repo/bitbake/lib/bb/fetch2/__init__.py", line 1271, in FetchData.__init__(url=3D'//hello', d=3D, localonly=3DTrue): self.basepath =3D None > (self.type, self.host, self.path, self.user, self.pswd, self.parm) =3D decodeurl(d.expand(url)) self.date =3D self.getSRCDate(d) File "/repo/bitbake/lib/bb/fetch2/__init__.py", line 357, in decodeurl(url=3D'//hello'): if not m: > raise MalformedUrl(url) =20 bb.data_smart.ExpansionError: Failure expanding variable do_fetch[file- checksums], expression was ${@bb.fetch.get_checksum_file_list(d)} which triggered exception MalformedUrl: The URL: '//hello' is invalid and cannot be interpreted The variable dependency chain for the failure is: do_fetch[file- checksums] ``` Best regards, Uladzimir.