Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC9B8C6FD18 for ; Wed, 19 Apr 2023 12:26:09 +0000 (UTC) Subject: nativesdk-packagegroup-sdk-host - allarch vs arch-specific To: yocto@lists.yoctoproject.org From: paulo.sogari@vorwerk.de X-Originating-Location: Wuppertal, North Rhine-Westphalia, DE (217.253.132.47) X-Originating-Platform: Mac Safari 16.4 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 19 Apr 2023 05:26:02 -0700 Message-ID: Content-Type: multipart/alternative; boundary="CnX6AhidTNDas4BCKH2D" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Apr 2023 12:26:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/59729 --CnX6AhidTNDas4BCKH2D Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all, I=E2=80=99m currently facing an issue when trying to build an SDK for an aa= rch64 host also with an aarch64 target board on Kirkstone. I=E2=80=99ve app= ended both nativesdk-protobuf and nativesdk-protobuf-compiler to nativesdk-= packagegroup-sdk-host. When building the SDK for an x86 host, everything wo= rks as expected, but for the aarch64 host, the following error occurs: >=20 >=20 >=20 > ERROR: nativesdk-packagegroup-sdk-host-1.0-r12 do_package_write_rpm: An > allarch packagegroup shouldn=E2=80=99t depend on packages which are dynam= ically > renamed (nativesdk-protobuf to nativesdk-libprotobuf30) > ERROR: nativesdk-packagegroup-sdk-host-1.0-r12 do_package_write_rpm: An > allarch packagegroup shouldn=E2=80=99t depend on packages which are dynam= ically > renamed (nativesdk-protobuf-compiler to nativesdk-libprotobuf-compiler) >=20 >=20 When searching for this issue, I found the patch that defines this error: h= ttps://lists.openembedded.org/g/openembedded-core/message/158230 As stated in the error message, it is caused by the dynamic renaming of the= package when it is part of an allarch packagegroup. I=E2=80=99m not famili= ar with the dynamic renaming process itself, but I found it weird that the = packagegroup would be allarch instead of aarch64. The patch description states: >=20 >=20 >=20 > If you run into this issue you either need to remove the dependency from > the > packagegroup or mark the packagegroup as tune specific, i.e. set: >=20 >=20 >=20 > PACKAGE_ARCH =3D =E2=80=9C${TUNE_PKGARCH}=E2=80=9D >=20 >=20 >=20 > before the packagegroup inherit. >=20 >=20 Indeed, packagegroup.bbclass makes a weak assignment of PACKAGE_ARCH? =3D = =E2=80=9Call=E2=80=9D. This value is immediately assigned to PACKAGE_ARCH_E= XPANDED (before any overrides), which in turn causes allarch.bbclass to be = inherited. This is also confirmed when analyzing the build environment: >=20 >=20 >=20 > # $PACKAGE_ARCH [4 operations] > #=C2=A0=C2=A0 set /home/sog/build/sdk/sources/poky/meta/conf/bitbake.conf= :182 > #=C2=A0=C2=A0=C2=A0 [_defaultval] =E2=80=9C${TUNE_PKGARCH}=E2=80=9D > #=C2=A0=C2=A0 set /home/sog/build/sdk/sources/poky/meta/conf/documentatio= n.conf:309 > #=C2=A0=C2=A0=C2=A0 [doc] =E2=80=9CThe architecture of the resulting pack= age or packages.=E2=80=9D > #=C2=A0=C2=A0 set? > /home/sog/build/sdk/sources/poky/meta/classes/packagegroup.bbclass:12 > #=C2=A0=C2=A0=C2=A0 =E2=80=9Call=E2=80=9D > #=C2=A0=C2=A0 set /home/sog/build/sdk/sources/poky/meta/classes/nativesdk= .bbclass:24 >=20 > #=C2=A0=C2=A0=C2=A0 =E2=80=9C${SDK_ARCH}-${SDKPKGSUFFIX}=E2=80=9D > # pre-expansion value: > #=C2=A0=C2=A0 =E2=80=9C${SDK_ARCH}-${SDKPKGSUFFIX}=E2=80=9D > PACKAGE_ARCH=3D=E2=80=9Caarch64-nativesdk=E2=80=9D >=20 >=20 >=20 > # $PACKAGE_ARCH_EXPANDED > #=C2=A0=C2=A0 immediate > /home/sog/build/sdk/sources/poky/meta/classes/packagegroup.bbclass:15 > #=C2=A0=C2=A0=C2=A0 =E2=80=9C${PACKAGE_ARCH}=E2=80=9D > PACKAGE_ARCH_EXPANDED=3D=E2=80=9Call=E2=80=9D >=20 >=20 The problem does not occur at all if I change nativesdk-packagegroup-sdk-ho= st.bb to first inherit =E2=80=9Cnativesdk=E2=80=9D, and lastly =E2=80=9Cpac= kagegroup=E2=80=9D. In this case, PACKAGE_ARCH_EXPANDED is also set to =E2= =80=9Caarch64-nativesdk=E2=80=9D, which prevents allarch.bbclass from being= inherited. Also, I can avoid the issue completely by defining a separate packagegroup = and adding protobuf there, but I wanted to clarify: should nativesdk-packag= egroup-sdk-host really be defined as allarch? Or should it assume the archi= tecture defined in nativesdk.bbclass? Kind regards, Paulo Sogari --CnX6AhidTNDas4BCKH2D Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi all,

I’m currently facing an issue when trying to build an SDK for an a= arch64 host also with an aarch64 target board on Kirkstone. I’ve appe= nded both nativesdk-protobuf and nativesdk-protobuf-compiler to nativesdk-p= ackagegroup-sdk-host. When building the SDK for an x86 host, everything wor= ks as expected, but for the aarch64 host, the following error occurs:

ERROR: nativesdk-packagegroup-sdk-host-1.0-r12 do_package_write_rpm: An = allarch packagegroup shouldn’t depend on packages which are dynamical= ly renamed (nativesdk-protobuf to nativesdk-libprotobuf30)
ERROR: nati= vesdk-packagegroup-sdk-host-1.0-r12 do_package_write_rpm: An allarch packag= egroup shouldn’t depend on packages which are dynamically renamed (na= tivesdk-protobuf-compiler to nativesdk-libprotobuf-compiler)

When searching for this issue, I found the patch that defines this error= : https://lists.openembedded.org/g/openembedded-core/message/158230=
As stated in the error message, it is caused by the dynamic renam= ing of the package when it is part of an allarch packagegroup. I’m no= t familiar with the dynamic renaming process itself, but I found it weird t= hat the packagegroup would be allarch instead of aarch64.
The patch de= scription states:

If you run into this issue you either need to remove the dependency from= the
packagegroup or mark the packagegroup as tune specific, i.e. set:=

PACKAGE_ARCH =3D “${TUNE_PKGARCH}”

before the packagegroup inherit.

Indeed, packagegroup.bbclass makes a weak assignment of PACKAGE_ARCH? = =3D “all”. This value is immediately assigned to PACKAGE_ARCH_E= XPANDED (before any overrides), which in turn causes allarch.bbclass to be = inherited. This is also confirmed when analyzing the build environment:

# $PACKAGE_ARCH [4 operations]
#   set /home/sog/build/sd= k/sources/poky/meta/conf/bitbake.conf:182
#    [_defaul= tval] “${TUNE_PKGARCH}”
#   set /home/sog/build/= sdk/sources/poky/meta/conf/documentation.conf:309
#    = [doc] “The architecture of the resulting package or packages.”<= br />#   set? /home/sog/build/sdk/sources/poky/meta/classes/packa= gegroup.bbclass:12
#    “all”
# &= nbsp; set /home/sog/build/sdk/sources/poky/meta/classes/nativesdk.bbclass:2= 4
#    “${SDK_ARCH}-${SDKPKGSUFFIX}”
#= pre-expansion value:
#   “${SDK_ARCH}-${SDKPKGSUFFIX}= ”
PACKAGE_ARCH=3D“aarch64-nativesdk”

# $PACKAGE_ARCH_EXPANDED
#   immediate /home/sog/build/sd= k/sources/poky/meta/classes/packagegroup.bbclass:15
#   = ; “${PACKAGE_ARCH}”
PACKAGE_ARCH_EXPANDED=3D“all&rdq= uo;

The problem does not occur at all if I change nativesdk-packagegroup-sdk= -host.bb to first inherit “nativesdk”, and lastly “packag= egroup”. In this case, PACKAGE_ARCH_EXPANDED is also set to “aa= rch64-nativesdk”, which prevents allarch.bbclass from being inherited= .
Also, I can avoid the issue completely by defining a separate packag= egroup and adding protobuf there, but I wanted to clarify: should nativesdk= -packagegroup-sdk-host really be defined as allarch? Or should it assume th= e architecture defined in nativesdk.bbclass?

 

Kind regards,

Paulo Sogari

--CnX6AhidTNDas4BCKH2D--