@@ -8,6 +8,9 @@ python() {
pn = d.getVar('PN')
archDiffers = d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH')
archIsAll = d.getVar('DPKG_ARCH') == 'all'
+ archIsAny = d.getVar('DPKG_ARCH') == 'any'
+ archIsNative = d.getVar('DPKG_ARCH') == d.getVar('HOST_ARCH')
+ archIsKnown = d.getVar("DPKG_ARCH", True)
def pn_multiarch_target(pn):
return pn.endswith('-native') or pn.endswith('-compat')
@@ -32,9 +35,15 @@ python() {
# We must not short-circuit for DPKG_ARCH=all packages, as they might
# have transitive dependencies which need to be built for -native.
if archDiffers:
- d.appendVar('BBCLASSEXTEND', ' native')
+ if archIsNative or archIsAll or archIsAny:
+ d.appendVar('BBCLASSEXTEND', ' native')
+ elif archIsKnown:
+ bb.debug(2, "Package %s is not compatible with the host architecture. Skipped extending as -native" % pn)
else:
- extend_provides(pn, 'native', d)
+ if archIsAll or archIsAny or archIsNative:
+ extend_provides(pn, 'native', d)
+ elif archIsKnown:
+ raise bb.parse.SkipRecipe("Incompatible with the target architecture %s" % d.getVar('DISTRO_ARCH'))
# drop own -native build dependencies at recipe level if building natively
# and not for the builder architecture
When extending/providing native packages, we must not do so with packages that are incompatible with the HOST_ARCH because otherwise, depending on the PV, they may override a sibling package which does support the HOST_ARCH but with a lower PV. To do this introduce a check for the packages DPKG_ARCH compatibility. - For cross-target configurations, just prevent providing the extended package. - For native-target configurations, skip the recipe altogether as the base variant will not be compatible as well. - Excempt the recipe skipping in case DPKG_ARCH is not set which may be the case for - a recipe that produces multiple debian packages with varying Architecture settings - a recipe is not suited to native/compat handling but inherits multiarch indirectly anyway. Signed-off-by: Andreas Naumann <anaumann@emlix.com> --- meta/classes/multiarch.bbclass | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)