| Message ID | 20251104154448.2737940-2-felix.moessbauer@siemens.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series | [v2,1/2] do not add cross profile when building native package | expand |
Hi Felix, Am 04.11.25 um 16:44 schrieb 'Felix Moessbauer' via isar-users: > DPKG_ARCH=all packages are always build in their -native variant. > However, these packages still can have non-native dependencies which > must be built for the distro arch. For me, this doesnt fix the testcase which I posted in my set on monday. So I'm surprised that it does for you, at least that's what i understood from your reply there. I was afraid gss wouldn't fail crosscompiling in trixie, but it does, at least for arm64. Now I reread your description carefully and assume it fixes something else than I had in mind. So short of info what the actual problem with 23a73895 ("multiarch: inject native variants of preferred providers") was, could you state it again? Do you have a specific testcase for it? regards, Andreas > Fixes: 23a73895 ("multiarch: inject native variants of preferred providers") > Tested-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> > --- > meta/classes/multiarch.bbclass | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass > index c2bba21f..74b8f5b8 100644 > --- a/meta/classes/multiarch.bbclass > +++ b/meta/classes/multiarch.bbclass > @@ -106,11 +106,13 @@ python multiarch_virtclass_handler() { > # Arch=all packages might build depend on other arch=all packages, > # hence we need to correctly model the dependency chain. > # We implement this by dispatching the non-native variant to the -native > - # variant by adding a dependency. We further replace the non-native > - # do_deploy_dep task with a noop to preserve the dependency chain. > + # variant by adding a dependency. We further empty the non-native > + # do_deploy_dep task and clear the internal dependency chain, but keep > + # other attached variables like RDEPENDS to preserve the dependency chain. > e.data.setVar('do_deploy_deb', '') > - bb.build.deltask('deploy_deb', e.data) > - bb.build.addtask('deploy_deb', 'do_build', '', e.data) > + # clear internal dependencies (e.g. to do_dpkg_build) > + e.data.setVarFlag('do_deploy_deb', 'deps', []) > + # dispatch to native variant > e.data.setVarFlag('do_deploy_deb', 'depends', f'{pn}-native:do_deploy_deb') > } > addhandler multiarch_virtclass_handler
On Thu, 2025-11-06 at 12:07 +0100, Andreas Naumann wrote: > Hi Felix, > > Am 04.11.25 um 16:44 schrieb 'Felix Moessbauer' via isar-users: > > DPKG_ARCH=all packages are always build in their -native variant. > > However, these packages still can have non-native dependencies which > > must be built for the distro arch. > For me, this doesnt fix the testcase which I posted in my set on monday. > So I'm surprised that it does for you, at least that's what i understood > from your reply there. I was afraid gss wouldn't fail crosscompiling > in trixie, but it does, at least for arm64. There are currently so many moving bits (patches, kas bookworm vs kas trixie environments, ...) it is hard to say what exactly worked and what didn't. > Now I reread your description carefully and assume it fixes something else > than I had in mind. So short of info what the actual problem with > > 23a73895 ("multiarch: inject native variants of preferred providers") > > was, could you state it again? Do you have a specific testcase for it? This problem was spotted in isar-cip-core when applying the DPKG_ARCH=all transitive deps patch [1]. The problem hereby is that we can no longer prefer-provide on the non native variant of a DPKG_ARCH=all package. An example error message looks like the following: ERROR: Multiple .bb files are due to be built which each provide secure-boot-secrets: /work/build/../../repo/recipes-devtools/secure-boot-secrets/secure- boot-snakeoil_0.3.bb /work/build/../../repo/recipes-devtools/secure-boot-secrets/secure- boot-key_0.2.bb A list of tasks depending on these providers is shown and may help explain where the dependency comes from. Example kas file: diff --git a/kas-cip.yml b/kas-cip.yml index d76d6d94..4b18856d 100644 --- a/kas-cip.yml +++ b/kas-cip.yml @@ -22,7 +22,7 @@ repos: isar: url: https://github.com/ilbers/isar.git - commit: d63a1cbae6f737aa843d00d8812547fe7b87104a + commit: 5a7c2f70045a27fe4073fa987ef07fe628062708 layers: meta: [1] https://github.com/ilbers/isar/commit/5a7c2f70045a27fe4073fa987ef07fe628062708 Best regards, Felix > regards, > Andreas > > > > Fixes: 23a73895 ("multiarch: inject native variants of preferred providers") > > Tested-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com> > > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> > > --- > > meta/classes/multiarch.bbclass | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass > > index c2bba21f..74b8f5b8 100644 > > --- a/meta/classes/multiarch.bbclass > > +++ b/meta/classes/multiarch.bbclass > > @@ -106,11 +106,13 @@ python multiarch_virtclass_handler() { > > # Arch=all packages might build depend on other arch=all packages, > > # hence we need to correctly model the dependency chain. > > # We implement this by dispatching the non-native variant to the -native > > - # variant by adding a dependency. We further replace the non-native > > - # do_deploy_dep task with a noop to preserve the dependency chain. > > + # variant by adding a dependency. We further empty the non-native > > + # do_deploy_dep task and clear the internal dependency chain, but keep > > + # other attached variables like RDEPENDS to preserve the dependency chain. > > e.data.setVar('do_deploy_deb', '') > > - bb.build.deltask('deploy_deb', e.data) > > - bb.build.addtask('deploy_deb', 'do_build', '', e.data) > > + # clear internal dependencies (e.g. to do_dpkg_build) > > + e.data.setVarFlag('do_deploy_deb', 'deps', []) > > + # dispatch to native variant > > e.data.setVarFlag('do_deploy_deb', 'depends', f'{pn}-native:do_deploy_deb') > > } > > addhandler multiarch_virtclass_handler > > -- > Andreas Naumann > > emlix GmbH > Headquarters: Berliner Str. 12, 37073 Goettingen, Germany > Phone +49 (0)551 30664-0, e-mail info@emlix.com > District Court of Goettingen, Registry Number HR B 3160 > Managing Directors: Heike Jordan, Dr. Uwe Kracke > VAT ID No. DE 205 198 055 > Office Berlin: Panoramastr. 1, 10178 Berlin, Germany > Office Bonn: Bachstr. 6, 53115 Bonn, Germany > http://www.emlix.com
diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass index c2bba21f..74b8f5b8 100644 --- a/meta/classes/multiarch.bbclass +++ b/meta/classes/multiarch.bbclass @@ -106,11 +106,13 @@ python multiarch_virtclass_handler() { # Arch=all packages might build depend on other arch=all packages, # hence we need to correctly model the dependency chain. # We implement this by dispatching the non-native variant to the -native - # variant by adding a dependency. We further replace the non-native - # do_deploy_dep task with a noop to preserve the dependency chain. + # variant by adding a dependency. We further empty the non-native + # do_deploy_dep task and clear the internal dependency chain, but keep + # other attached variables like RDEPENDS to preserve the dependency chain. e.data.setVar('do_deploy_deb', '') - bb.build.deltask('deploy_deb', e.data) - bb.build.addtask('deploy_deb', 'do_build', '', e.data) + # clear internal dependencies (e.g. to do_dpkg_build) + e.data.setVarFlag('do_deploy_deb', 'deps', []) + # dispatch to native variant e.data.setVarFlag('do_deploy_deb', 'depends', f'{pn}-native:do_deploy_deb') } addhandler multiarch_virtclass_handler
DPKG_ARCH=all packages are always build in their -native variant. However, these packages still can have non-native dependencies which must be built for the distro arch. Fixes: 23a73895 ("multiarch: inject native variants of preferred providers") Tested-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- meta/classes/multiarch.bbclass | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)