From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7286543990069919744 X-Received: by 2002:aa7:c393:0:b0:533:c55f:582a with SMTP id k19-20020aa7c393000000b00533c55f582amr20010375edq.27.1697087218898; Wed, 11 Oct 2023 22:06:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:12c7:b0:536:17f7:9f24 with SMTP id k7-20020a05640212c700b0053617f79f24ls194624edx.0.-pod-prod-08-eu; Wed, 11 Oct 2023 22:06:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtImi8dLRccD8tT9N+8GWLOrr5FD4SzrfyhrAADkwzDJS0hScYfP2ZzOlIWU4dSQyOjNhQ X-Received: by 2002:a05:6402:1ca5:b0:53b:3225:93b2 with SMTP id cz5-20020a0564021ca500b0053b322593b2mr13831828edb.29.1697087216652; Wed, 11 Oct 2023 22:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697087216; cv=none; d=google.com; s=arc-20160816; b=vUbuSbyXtEjzCX5y/+mX/PPP5rGsq8SQLnRuJ7lUOVKSeHf00+/Zb7YoZ3XuOBvtdM vS+11GZXct0tAJVZCUi03dEduss8mcq/aWzLIKbFmKPVWEyoNM1Br/Tv7M/bDVxDLGXq k2IibNIVNRQ5AcRxs1SuyBnZJoEmY5s3GPwhToPSeQuuJps1j0CIE1DxoHMkVG4XUpmy QVtlQsil0NFDRBKO72kSmwpXgJxWwu8wHYo3Nn+P2VSbPYULAzkzDXSBPGobzjhibkN9 OD/6Z4msqQLLFYY+D2GnJCUTsSMFVLhzC88gVF9gdJlkwC39td1cgH/2vrlWKYLkVSPr s4vg== 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=ona7kmtnQ4XD5IPrcOhns/inkR/C/XLKla9vITz2RfA=; fh=IxbeHM4vWxalf1XNf2rnGcQL+r1v0Lr0C6ICsGNNkYw=; b=xs1934vJ41ConbbgwGfLXO6fbRKfF90+mnNKAQ8QsseE9qFW42rn54GnT2rPtWXOmO r0iyixqmOYDf3ne8J4vdsUzpu0Z4r2eFXqPUIIx7pihG3sWDOaUHMcAL+wbu0ohzYwV/ 1SYJb+BYxzLUCL9xBqktemlOF43/rpAf2IjoXRxs71/2CzwSbVBCzRca9j6PEiCj+5vo nVA9OdOSYK0J0H3SgXp4PZ1DPHlua1TgnwMJr//09HLhWrXGNDaBP6S1PFmqhIC2KwIz 5mNltVvMFTL+Scy3x8orIVdWmIiD8yjZTvOEQZqQgvft4g7TVohkFGnlF3RFdkUAafCO 25cQ== 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 h2-20020a0564020e8200b00530b66cee61si811986eda.0.2023.10.11.22.06.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2023 22:06:56 -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 [127.0.0.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 39C56svp028983 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 07:06:55 +0200 Message-ID: <7187120ec635f1c66e8df583728fdf6d63f61feb.camel@ilbers.de> Subject: Re: [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest From: Uladzimir Bely To: Jan Kiszka , isar-users Date: Thu, 12 Oct 2023 08:06:56 +0300 In-Reply-To: <3c999ceb-14ed-4609-a865-32602b30458a@siemens.com> References: <6dcf04ecd53ffe295930e2ce6320648ab94f109f.camel@ilbers.de> <80577353-4026-482a-bdc0-22f400cac25b@siemens.com> <3c999ceb-14ed-4609-a865-32602b30458a@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (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: 9kXVCHie87Kt On Thu, 2023-10-12 at 06:51 +0200, Jan Kiszka wrote: > On 11.10.23 12:51, 'Jan Kiszka' via isar-users wrote: > > On 11.10.23 12:49, Uladzimir Bely wrote: > > > On Fri, 2023-10-06 at 17:34 +0200, Jan Kiszka wrote: > > > > Changes in v2: > > > > =C2=A0- drop merged revert > > > > =C2=A0- rename BUILD_HOST_ARCH to BUILD_ARCH > > > > =C2=A0- add fix for explicit -native build in non-cross setups > > > > =C2=A0- add missing debian-sid.conf > > > >=20 > > > > This tries to resolve the native build issues of the > > > > visionfive2, > > > > fixing > > > > some remaining corner case of -native usage: > > > >=20 > > > > If package A has B-native as build dependency but is then > > > > compiled > > > > without cross-building, using qemu-user instead, it will > > > > incorrectly > > > > request the build of B:, rather than B:. This > > > > is resolved automatically now, and the solution is used for the > > > > visionfive2. > > > >=20 > > > > For that board to build again, we also need to switch from sid- > > > > ports > > > > to > > > > sid, for riscv64 in general. > > > >=20 > > > > Furthermore, this reworks the crossvars logic to also account > > > > for the > > > > corner case that a package is still requested as native > > > > although > > > > ISAR_CROSS_COMPILE is off. While this is likely irrelvant in > > > > practice, > > > > the result is a more consistent logic of the crossvars class. > > > >=20 > > > > Jan > > > >=20 > > > > Jan Kiszka (9): > > > > =C2=A0 Rename BUILD_HOST_ARCH to BUILD_ARCH > > > > =C2=A0 dpkg: Drop redundant PACKAGE_ARCH initialization > > > > =C2=A0 crossvars: Adjust logic to account for -native package build= s > > > > in > > > > =C2=A0=C2=A0=C2=A0 non-cross setups > > > > =C2=A0 multiarch: Downgrade native dependencies when building in > > > > emulated > > > > =C2=A0=C2=A0=C2=A0 environment > > > > =C2=A0 meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation > > > > =C2=A0 meta-isar: jh7110-u-boot-spl-image: Fix native build > > > > =C2=A0 meta-isar: u-boot-starfive-visionfive2: Simplify build > > > > dependencies > > > > =C2=A0 linux-custom: Drop unused template variable > > > > =C2=A0 Move riscv64 from sid-ports to regular sid > > > >=20 > > > > =C2=A0doc/user_manual.md=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=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 4 ++-- > > > > =C2=A0kas/distro/Kconfig=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=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 6 +++--- > > > > =C2=A0...{debian-sid-ports.yaml =3D> debian-sid.yaml} |=C2=A0 2 +- > > > > =C2=A0kas/machine/Kconfig=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=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 6 +++--- > > > > =C2=A0meta-isar/conf/mc.conf=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=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 6 +++--- > > > > =C2=A0...64-sid-ports.conf =3D> qemuriscv64-sid.conf} |=C2=A0 2 +- > > > > =C2=A0...0-sid-ports.conf =3D> sifive-fu540-sid.conf} |=C2=A0 2 +- > > > > =C2=A0...rts.conf =3D> starfive-visionfive2-sid.conf} |=C2=A0 2 +- > > > > =C2=A0.../jh7110-u-boot-spl-image_0.1.bb=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 6 +++--- > > > > =C2=A0.../jh7110-u-boot-spl-tool_0.1.bb=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 3 --- > > > > =C2=A0...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |=C2=A0 4 +--- > > > > =C2=A0meta/classes/crossvars.bbclass=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 | 19 +++++++++= +- > > > > ------ > > > > =C2=A0meta/classes/dpkg-base.bbclass=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 |=C2=A0 2 +- > > > > =C2=A0meta/classes/dpkg.bbclass=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=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0 4 +--- > > > > =C2=A0meta/classes/multiarch.bbclass=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 | 12 +++++++++= ++ > > > > =C2=A0meta/conf/bitbake.conf=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=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- > > > > =C2=A0meta/conf/distro/debian-sid.conf=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 | 21 > > > > +++++++++++++++++++ > > > > =C2=A0meta/recipes-kernel/linux/linux-custom.inc=C2=A0=C2=A0=C2=A0 = |=C2=A0 1 - > > > > =C2=A0testsuite/citest.py=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=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 6 +++--- > > > > =C2=A019 files changed, 70 insertions(+), 40 deletions(-) > > > > =C2=A0rename kas/distro/{debian-sid-ports.yaml =3D> debian-sid.yaml= } > > > > (78%) > > > > =C2=A0rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf > > > > =3D> > > > > qemuriscv64-sid.conf} (85%) > > > > =C2=A0rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.con= f > > > > =3D> > > > > sifive-fu540-sid.conf} (76%) > > > > =C2=A0rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid- > > > > ports.conf =3D> starfive-visionfive2-sid.conf} (78%) > > > > =C2=A0create mode 100644 meta/conf/distro/debian-sid.conf > > > >=20 > > >=20 > > > While testing the patchset, I noticed that packages with "- > > > compat" > > > suffix now pull and use "sbuild-chroot-target" instead of > > > "sbuild- > > > chroot-host". > > >=20 > > > Conditions: > > > ISAR_CROSS_COMPILE =3D "1" > > > ISAR_ENABLE_COMPAT_ARCH =3D "1" > > >=20 > > > Build command: `bitbake -v mc:qemuarm64-bookworm:hello-compat` > > >=20 > > > On 'next': > > >=20 > > > ``` > > > build$ ls -1 tmp/work/debian-bookworm-arm64/ > > > base-apt > > > hello-compat > > > isar-apt > > > isar-bootstrap-host > > > sbuild-chroot-host > > > ``` > > >=20 > > > With patchset: > > >=20 > > > ``` > > > build$ ls -1 tmp/work/debian-bookworm-arm64/ > > > base-apt > > > hello-compat > > > isar-apt > > > isar-bootstrap-target > > > sbuild-chroot-target > > > ``` > > >=20 > > > If talking about CI, it passes except repro tests. > > >=20 > > > Due to this issue, some 'deb' files from raspios repositories go > > > to > > > "debian" download subdirectory, and during the second (base-apt > > > cached) > > > build they go to Debian's `base-apt` and it leads to the conflict > > > when > > > resolving dependencies. > > >=20 > > > I'm stil debugging this, but this part of information may be > > > useful. > >=20 > > Likely an issue of patch 3. The rest should still work when pulling > > this > > out, though. > >=20 >=20 > Yep, patch 3, and this should fix it: >=20 > diff --git a/meta/classes/crossvars.bbclass > b/meta/classes/crossvars.bbclass > index 87e45417..a7834b99 100644 > --- a/meta/classes/crossvars.bbclass > +++ b/meta/classes/crossvars.bbclass > @@ -16,12 +16,13 @@ python __anonymous() { > =C2=A0=C2=A0=C2=A0=C2=A0 flavor_suffix =3D ('-' + flavor) if flavor else = '' >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 distro_arch =3D d.getVar('DISTRO_ARCH') > +=C2=A0=C2=A0=C2=A0 compat_arch =3D d.getVar('COMPAT_DISTRO_ARCH') > =C2=A0=C2=A0=C2=A0=C2=A0 host_arch =3D d.getVar('HOST_ARCH') > =C2=A0=C2=A0=C2=A0=C2=A0 package_arch =3D d.getVar('PACKAGE_ARCH') >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 if distro_arch !=3D host_arch and \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (package_arch =3D=3D hos= t_arch or \ > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (package_arch =3D=3D di= stro_arch and mode =3D=3D "1")): > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (package_arch in [distr= o_arch, compat_arch] and mode =3D=3D > "1")): > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 d.setVar('BUILD_ARCH', h= ost_arch) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 schroot_dir =3D d.getVar= ('SCHROOT_HOST_DIR', False) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sbuild_dep =3D "sbuild-c= hroot-host" + flavor_suffix + > ":do_build" >=20 > Should I resent the whole series with this update? >=20 Yes, please. In my internal experiments I came up to something similar: diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass index 87e45417..501dfef2 100644 --- a/meta/classes/crossvars.bbclass +++ b/meta/classes/crossvars.bbclass @@ -18,9 +18,11 @@ python __anonymous() { distro_arch =3D d.getVar('DISTRO_ARCH') host_arch =3D d.getVar('HOST_ARCH') package_arch =3D d.getVar('PACKAGE_ARCH') + compat_distro_arch =3D d.getVar('COMPAT_DISTRO_ARCH') =20 if distro_arch !=3D host_arch and \ (package_arch =3D=3D host_arch or \ + (package_arch =3D=3D compat_distro_arch and mode =3D=3D "1") or \ (package_arch =3D=3D distro_arch and mode =3D=3D "1")): d.setVar('BUILD_ARCH', host_arch) schroot_dir =3D d.getVar('SCHROOT_HOST_DIR', False) .. and now testing if it fixes the issue. > Jan >=20