From: "'cedric.hombourger@siemens.com' via isar-users" <isar-users@googlegroups.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
"wzh@ilbers.de" <wzh@ilbers.de>,
"MOESSBAUER, Felix" <felix.moessbauer@siemens.com>
Cc: "Steiger, Christoph" <christoph.steiger@siemens.com>,
"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
"Kiszka, Jan" <jan.kiszka@siemens.com>
Subject: Re: [PATCH 2/2] handle DPKG_ARCH=all case for transitive deps
Date: Mon, 20 Oct 2025 12:07:02 +0000 [thread overview]
Message-ID: <5fb19237cc4f329c157a9ac8a1b07d3bd3813734.camel@siemens.com> (raw)
In-Reply-To: <9edc443a-88d8-4cae-88b3-d2963b40c1f6@ilbers.de>
On Tue, 2025-10-07 at 14:31 +0200, Zhihang Wei wrote:
> p2 was applied to next, thanks.
this appears to cause a regression with dpkg-customization packages.
Not yet sure why this wasn't caught by dpkg-customization test cases
that Chris had added when dpkg-customization was introduced.
ERROR: Multiple .bb files are due to be built which each provide
hostname-customization:
mc:iot2050-bookworm:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb
A list of tasks depending on these providers is shown and may help
explain where the dependency comes from.
mc:iot2050-bookworm:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique dependees:
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb:do_dpkg_build
mc:iot2050-bookworm:/work/build/../../repo/meta/recipes-
core/images/development-image.bb:do_image_tools
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb:do_fetch_common_source
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique dependees:
mc:iot2050-bookworm:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb:do_deploy_deb
It could be that one recipe provides something the other doesn't and
should. The following provider and runtime provider differences may be
helpful.
mc:iot2050-bookworm:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique provides:
bookworm-hostname-customization-iot2050
mc:iot2050-bookworm:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique rprovides:
hostname-customization
bookworm-hostname-customization-iot2050
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique provides:
bookworm-hostname-customization-iot2050-native
mc:iot2050-bookworm:virtual:native:/work/build/../isar/meta/recipes-
support/customizations/hostname-customization.bb has unique rprovides:
bookworm-hostname-customization-iot2050-native
>
> On 8/20/25 14:41, 'Felix Moessbauer' via isar-users wrote:
> > Arch=all packages might build depend on other arch=all packages,
> > hence we
> > need to correctly model the dependency chain. Otherwise the
> > transitive
> > dependencies are built for the distro arch instead of the native
> > arch.
> >
> > We implement this by dispatching the non-native variant of
> > DPKG_ARCH=all
> > packages 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.
> >
> > Co-developed-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> > meta/classes/multiarch.bbclass | 18 +++++++++++++++++-
> > 1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/multiarch.bbclass
> > b/meta/classes/multiarch.bbclass
> > index babdfbd4..c2bba21f 100644
> > --- a/meta/classes/multiarch.bbclass
> > +++ b/meta/classes/multiarch.bbclass
> > @@ -29,7 +29,11 @@ python() {
> > d.appendVar('BBCLASSEXTEND', ' compat')
> >
> > # build native separately only when it differs from the
> > target variant
> > - if not archIsAll and archDiffers:
> > + # We must not short-circuit for DPKG_ARCH=all packages, as
> > they might
> > + # have transitive dependencies which need to be built for -
> > native.
> > + # This special handling for DPKG_ARCH=all packages is left to
> > the
> > + # multiarch_virtclass_handler
> > + if archDiffers:
> > d.appendVar('BBCLASSEXTEND', ' native')
> > else:
> > extend_provides(pn, 'native', d)
> > @@ -86,6 +90,8 @@ python multiarch_virtclass_handler() {
> > d.setVar(var, ' '.join(multiarch_var))
> >
> > pn = e.data.getVar('PN')
> > + archDiffers = d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH')
> > + archIsAll = d.getVar('DPKG_ARCH') == 'all'
> > if pn.endswith('-compat'):
> > e.data.setVar('BPN', pn[:-len('-compat')])
> > e.data.appendVar('OVERRIDES', ':class-compat')
> > @@ -96,6 +102,16 @@ python multiarch_virtclass_handler() {
> > e.data.appendVar('OVERRIDES', ':class-native')
> > fixup_pn_in_vars(e.data)
> > fixup_depends('-native', e.data)
> > + elif archIsAll and archDiffers:
> > + # 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.
> > + e.data.setVar('do_deploy_deb', '')
> > + bb.build.deltask('deploy_deb', e.data)
> > + bb.build.addtask('deploy_deb', 'do_build', '', e.data)
> > + e.data.setVarFlag('do_deploy_deb', 'depends', f'{pn}-
> > native:do_deploy_deb')
> > }
> > addhandler multiarch_virtclass_handler
> > multiarch_virtclass_handler[eventmask] =
> > "bb.event.RecipePreFinalise"
>
--
Cedric Hombourger
Siemens AG
www.siemens.com
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/5fb19237cc4f329c157a9ac8a1b07d3bd3813734.camel%40siemens.com.
next prev parent reply other threads:[~2025-10-20 12:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 12:41 [PATCH 0/2] " 'Felix Moessbauer' via isar-users
2025-08-20 12:41 ` [PATCH 1/2] dpkg-raw: add files to source package 'Felix Moessbauer' via isar-users
2025-10-03 11:09 ` Anton Mikanovich
2025-08-20 12:41 ` [PATCH 2/2] handle DPKG_ARCH=all case for transitive deps 'Felix Moessbauer' via isar-users
2025-09-10 11:00 ` Andreas Naumann
2025-09-11 10:20 ` 'MOESSBAUER, Felix' via isar-users
2025-09-12 15:50 ` Andreas Naumann
2025-09-15 7:55 ` 'MOESSBAUER, Felix' via isar-users
2025-09-15 17:49 ` Andreas Naumann
2025-09-16 7:16 ` 'MOESSBAUER, Felix' via isar-users
2025-09-19 7:15 ` Andreas Naumann
2025-10-06 14:05 ` 'MOESSBAUER, Felix' via isar-users
2025-10-07 10:57 ` 'Andreas Naumann' via isar-users
2025-10-07 12:31 ` Zhihang Wei
2025-10-20 12:07 ` 'cedric.hombourger@siemens.com' via isar-users [this message]
2025-10-20 12:23 ` 'Jan Kiszka' via isar-users
2025-10-20 12:25 ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-24 13:03 ` 'MOESSBAUER, Felix' via isar-users
2025-10-24 5:34 ` [PATCH 0/2] " 'cedric.hombourger@siemens.com' via isar-users
2025-10-24 7:36 ` 'MOESSBAUER, Felix' via isar-users
2025-10-27 13:35 ` 'Andreas Naumann' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5fb19237cc4f329c157a9ac8a1b07d3bd3813734.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=adriaan.schmidt@siemens.com \
--cc=cedric.hombourger@siemens.com \
--cc=christoph.steiger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=wzh@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox