Skip to contentSkip to conversation

allarch: disable allarch when multilib is used

PATCH Superseded [email protected] 2 participants 6 messages Aug 10, 2018 – Aug 14, 2018

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover allarch: disable allarch when multilib is used

From: Kai Kang <[email protected]>

The following changes since commit da24071e92071ecbefe51314d82bf40f85172485:

bitbake: toaster/orm/management/commands/lsupdates.py: Use new layerindexlib module (2018-08-02 10:18:27 +0100)

are available in the Git repository at:

git://git.pokylinux.org/poky-contrib kangkai/disable-allarch
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/disable-allarch

Kai Kang (1):
allarch: disable allarch when multilib is used

 meta/classes/allarch.bbclass         | 4 ++++
 meta/classes/icecc.bbclass           | 2 +-
 meta/classes/multilib.bbclass        | 3 ++-
 meta/classes/multilib_global.bbclass | 4 +---
 meta/classes/package.bbclass         | 9 ++++++---
 meta/classes/staging.bbclass         | 2 +-
 6 files changed, 15 insertions(+), 9 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 allarch: disable allarch when multilib is used

From: Kai Kang <[email protected]>

Some allarch packages rdepends non-allarch packages. When multilib is used, it doesn't expand the dependency chain correctly, e.g.

core-image-sato -> ca-certificates(allarch) -> openssl

we expect dependency chain for lib32-core-image-sato:

lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl

it should install lib32-openssl for ca-certificates but openssl is still wrongly imported.

Disable allarch when multilib is used.

---
 meta/classes/allarch.bbclass         | 4 ++++
 meta/classes/icecc.bbclass           | 2 +-
 meta/classes/multilib.bbclass        | 3 ++-
 meta/classes/multilib_global.bbclass | 4 +---
 meta/classes/package.bbclass         | 9 ++++++---
 meta/classes/staging.bbclass         | 2 +-
 6 files changed, 15 insertions(+), 9 deletions(-)
meta/classes/allarch.bbclass +4 -0
index 1eebe0bf2e..0622622d80 100644
@@ -5,6 +5,10 @@
 PACKAGE_ARCH = "all"
 
 python () {
+    # only enable allarch when multilib is not used
+    if not d.getVar("MULTILIB_VARIANTS"):
+        d.setVar("PACKAGE_ARCH", "all")
+
     # Allow this class to be included but overridden - only set
     # the values if we're still "all" package arch.
     if d.getVar("PACKAGE_ARCH") == "all":
meta/classes/icecc.bbclass +1 -1
index 0ca8de86c2..b5a8457747 100644
@@ -171,7 +171,7 @@ def use_icecc(bb,d):
     return "yes"
 
 def icecc_is_allarch(bb, d):
-    return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch', d)
+    return d.getVar("PACKAGE_ARCH") == "all"
 
 def icecc_is_kernel(bb, d):
     return \
meta/classes/multilib.bbclass +2 -1
index f2ac8bdfef..7b4d6472b0 100644
@@ -50,7 +50,8 @@ python multilib_virtclass_handler () {
     if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
         raise bb.parse.SkipRecipe("We can't extend nativesdk recipes")
 
-    if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
+    if bb.data.inherits_class('allarch', e.data) and not d.getVar('MULTILIB_VARIANTS') \
+        and not bb.data.inherits_class('packagegroup', e.data):
         raise bb.parse.SkipRecipe("Don't extend allarch recipes which are not packagegroups")
 
     # Expand this since this won't work correctly once we set a multilib into place
meta/classes/multilib_global.bbclass +1 -3
index d2ec1adfea..1bb62427b0 100644
@@ -165,9 +165,7 @@ python multilib_virtclass_handler_global () {
         return
 
     if bb.data.inherits_class('kernel', e.data) or \
-            bb.data.inherits_class('module-base', e.data) or \
-            (bb.data.inherits_class('allarch', e.data) and\
-             not bb.data.inherits_class('packagegroup', e.data)):
+            bb.data.inherits_class('module-base', e.data):
             variants = (e.data.getVar("MULTILIB_VARIANTS") or "").split()
 
             import oe.classextend
meta/classes/package.bbclass +6 -3
index 8459d39b27..f642a307c3 100644
@@ -499,7 +499,8 @@ def get_package_mapping (pkg, basepkg, d):
 
     if key in data:
         # Have to avoid undoing the write_extra_pkgs(global_variants...)
-        if bb.data.inherits_class('allarch', d) and data[key] == basepkg:
+        if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
+            and data[key] == basepkg:
             return pkg
         return data[key]
 
@@ -1410,7 +1411,8 @@ fi
     if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
         write_extra_pkgs(variants, pn, packages, pkgdatadir)
 
-    if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
+    if bb.data.inherits_class('allarch', d) and not variants \
+        and not bb.data.inherits_class('packagegroup', d):
         write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
 
     workdir = d.getVar('WORKDIR')
@@ -1499,7 +1501,8 @@ fi
     if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
         write_extra_runtime_pkgs(variants, packages, pkgdatadir)
 
-    if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d):
+    if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
+        and not bb.data.inherits_class('packagegroup', d):
         write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
 
 }
meta/classes/staging.bbclass +1 -1
index 27b012ecbd..312cfd8007 100644
@@ -481,7 +481,7 @@ python extend_recipe_sysroot() {
             d2.setVar("WORKDIR", d.getVar("WORKDIR"))
         destsysroot = d2.getVar("RECIPE_SYSROOT")
         # We put allarch recipes into the default sysroot
-        if manifest and "allarch" in manifest:
+        if manifest and "allarch" in manifest and not d.getVar("MULTILIB_VARIANTS"):
             destsysroot = d.getVar("RECIPE_SYSROOT")
 
         native = False
Signature · 1 line
2.18.0
#2 lore raw
Quoted 17 lines · On Fri, 2018-08-10 at 16:14 +0800, [email protected] wrote:

From: Kai Kang <[email protected]>

Some allarch packages rdepends non-allarch packages. When multilib is used, it doesn't expand the dependency chain correctly, e.g.

core-image-sato -> ca-certificates(allarch) -> openssl

we expect dependency chain for lib32-core-image-sato:

lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl

it should install lib32-openssl for ca-certificates but openssl is still wrongly imported.

Disable allarch when multilib is used.

Quoted 8 lines
---
 meta/classes/allarch.bbclass         | 4 ++++
 meta/classes/icecc.bbclass           | 2 +-
 meta/classes/multilib.bbclass        | 3 ++-
 meta/classes/multilib_global.bbclass | 4 +---
 meta/classes/package.bbclass         | 9 ++++++---
 meta/classes/staging.bbclass         | 2 +-
 6 files changed, 15 insertions(+), 9 deletions(-)

Looks good at a quick glance, I'll put it in for testing.

Since I just saw it for other reasons, could you also see if we could remove the ${DEPLOY_DIR_RPM}/noarch/ mentioned as:

# For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical) SSTATE_DUPWHITELIST = "${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"

from sstate.bbclass please?

Cheers,

Richard

author
#3 lore raw
Quoted 28 lines · On 2018年08月10日 17:24, [email protected] wrote:
Quoted 17 lines · On Fri, 2018-08-10 at 16:14 +0800, [email protected] wrote:

From: Kai Kang <[email protected]>

Some allarch packages rdepends non-allarch packages. When multilib is used, it doesn't expand the dependency chain correctly, e.g.

core-image-sato -> ca-certificates(allarch) -> openssl

we expect dependency chain for lib32-core-image-sato:

lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl

it should install lib32-openssl for ca-certificates but openssl is still wrongly imported.

Disable allarch when multilib is used.

Quoted 8 lines
---
  meta/classes/allarch.bbclass         | 4 ++++
  meta/classes/icecc.bbclass           | 2 +-
  meta/classes/multilib.bbclass        | 3 ++-
  meta/classes/multilib_global.bbclass | 4 +---
  meta/classes/package.bbclass         | 9 ++++++---
  meta/classes/staging.bbclass         | 2 +-
  6 files changed, 15 insertions(+), 9 deletions(-)

Looks good at a quick glance, I'll put it in for testing.

Quoted 7 lines

Since I just saw it for other reasons, could you also see if we could remove the ${DEPLOY_DIR_RPM}/noarch/ mentioned as:

# For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical) SSTATE_DUPWHITELIST = "${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"

from sstate.bbclass please?

OK. I'll check it.

Regards,
Kai

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang
#4 lore raw
In reply to [email protected]
Quoted 17 lines · On Fri, 2018-08-10 at 16:14 +0800, [email protected] wrote:

From: Kai Kang <[email protected]>

Some allarch packages rdepends non-allarch packages. When multilib is used, it doesn't expand the dependency chain correctly, e.g.

core-image-sato -> ca-certificates(allarch) -> openssl

we expect dependency chain for lib32-core-image-sato:

lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl

it should install lib32-openssl for ca-certificates but openssl is still wrongly imported.

Disable allarch when multilib is used.

Quoted 8 lines
---
 meta/classes/allarch.bbclass         | 4 ++++
 meta/classes/icecc.bbclass           | 2 +-
 meta/classes/multilib.bbclass        | 3 ++-
 meta/classes/multilib_global.bbclass | 4 +---
 meta/classes/package.bbclass         | 9 ++++++---
 meta/classes/staging.bbclass         | 2 +-
 6 files changed, 15 insertions(+), 9 deletions(-)

With this applied, "bitbake nativesdk-dbus" fails to build since it can't find the extra autoconf macros from an allarch recipe in DEPENDS.

e.g. https://autobuilder.yocto.io/builders/nightly-arm/builds/1262/step
s/Building%20Toolchain%20Images/logs/stdio

Cheers,

Richard

author
#5 lore raw
Quoted 26 lines · On 2018年08月12日 00:10, [email protected] wrote:
Quoted 17 lines · On Fri, 2018-08-10 at 16:14 +0800, [email protected] wrote:

From: Kai Kang <[email protected]>

Some allarch packages rdepends non-allarch packages. When multilib is used, it doesn't expand the dependency chain correctly, e.g.

core-image-sato -> ca-certificates(allarch) -> openssl

we expect dependency chain for lib32-core-image-sato:

lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl

it should install lib32-openssl for ca-certificates but openssl is still wrongly imported.

Disable allarch when multilib is used.

Quoted 8 lines
---
  meta/classes/allarch.bbclass         | 4 ++++
  meta/classes/icecc.bbclass           | 2 +-
  meta/classes/multilib.bbclass        | 3 ++-
  meta/classes/multilib_global.bbclass | 4 +---
  meta/classes/package.bbclass         | 9 ++++++---
  meta/classes/staging.bbclass         | 2 +-
  6 files changed, 15 insertions(+), 9 deletions(-)
Quoted 6 lines

With this applied, "bitbake nativesdk-dbus" fails to build since it can't find the extra autoconf macros from an allarch recipe in DEPENDS.

e.g. https://autobuilder.yocto.io/builders/nightly-arm/builds/1262/step
s/Building%20Toolchain%20Images/logs/stdio

The autoconf-archive-native is not installed to recipe sysroot native. Some debug info shows the task do_populate_sysroot of autoconf-archive-native is not executed. And so do some other packages(tasks).

DEBUG: Stampfile /buildarea/kkang/yocto/noarch-verify-build-Aug13/tmp/stamps/x86_64-linux/autoconf-archive-native/2018.03.13-r0.do_populate_sysroot_setscene.41bdb37fee4fb443715e1c84a5de281f not available
DEBUG: Normal stamp current for task virtual:native:/buildarea/kkang/yocto/poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb:do_populate_sysroot
DEBUG: Found task virtual:native:/buildarea/kkang/yocto/poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb:do_populate_sysroot which could be accelerated

I have been working on it but not get the root cause yet.

Sorry for the inconvenience.

Regards,
Kai

Quoted 6 lines

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang