All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/7] disable allarch when multilib is used
@ 2018-09-06 15:52 kai.kang
  2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

V5:
* set PACKAGE_ARCH in event handler bb.event.RecipePreFinalise
* add execption of target-sdk-provides-dummy for package_qa_multilib check



The following changes since commit c710430aa1a5a30d3087c3102485d4621e8d179e:

  Revert "prelink: Fix SRC_URI and branch" (2018-09-06 14:49:28 +0100)

are available in the Git repository at:

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

Kai Kang (7):
  allarch: only enable allarch when multilib is not used
  sstate.bbclass: update SSTATE_DUPWHITELIST
  update_font_cache: update script for multilib
  update_gtk_immodules_cache: update for multilib
  statetests.py: drop test_sstate_allarch_samesigs_multilib
  multilib: fix install file conflicts
  target-sdk-provides-dummy: skip package_qa_multilib check

 meta/classes/allarch.bbclass                         | 12 +++++++++++-
 meta/classes/icecc.bbclass                           |  2 +-
 meta/classes/multilib.bbclass                        |  7 ++++++-
 meta/classes/multilib_global.bbclass                 |  4 +---
 meta/classes/package.bbclass                         |  9 ++++++---
 meta/classes/populate_sdk_base.bbclass               |  3 +--
 meta/classes/sstate.bbclass                          |  4 +++-
 meta/lib/oeqa/selftest/cases/sstatetests.py          | 11 ++---------
 meta/recipes-core/udev/eudev_3.2.5.bb                |  6 ++++--
 .../gobject-introspection_1.56.1.bb                  |  6 ++++--
 meta/recipes-gnome/gtk+/gtk+.inc                     |  4 ++++
 meta/recipes-gnome/gtk+/gtk+3.inc                    |  4 ++++
 meta/recipes-graphics/cairo/cairo_1.14.12.bb         |  6 ++++--
 .../recipes-graphics/fontconfig/fontconfig_2.12.6.bb |  8 +++++++-
 meta/recipes-support/icu/icu.inc                     |  4 +++-
 .../libgpg-error/libgpg-error_1.32.bb                |  5 ++++-
 scripts/postinst-intercepts/update_font_cache        |  2 +-
 .../postinst-intercepts/update_gtk_immodules_cache   |  8 ++++----
 18 files changed, 70 insertions(+), 35 deletions(-)

-- 
2.18.0



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-13 18:20   ` Martin Jansa
  2018-09-06 15:52 ` [PATCH 2/7] sstate.bbclass: update SSTATE_DUPWHITELIST kai.kang
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

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 required.

Only enable allarch when multilib is not used to fix the issue.

signed-off-by: kai kang <kai.kang@windriver.com>
---
 meta/classes/allarch.bbclass         | 12 +++++++++++-
 meta/classes/icecc.bbclass           |  2 +-
 meta/classes/multilib.bbclass        |  3 ++-
 meta/classes/multilib_global.bbclass |  4 +---
 meta/classes/package.bbclass         |  9 ++++++---
 5 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
index 1eebe0bf2e..45f62a5939 100644
--- a/meta/classes/allarch.bbclass
+++ b/meta/classes/allarch.bbclass
@@ -2,7 +2,17 @@
 # This class is used for architecture independent recipes/data files (usually scripts)
 #
 
-PACKAGE_ARCH = "all"
+python allarch_package_arch_handler () {
+    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
+        return
+
+    variants = d.getVar("MULTILIB_VARIANTS")
+    if not variants:
+        d.setVar("PACKAGE_ARCH", "all" )
+}
+
+addhandler allarch_package_arch_handler
+allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
 
 python () {
     # Allow this class to be included but overridden - only set
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 0ca8de86c2..b5a8457747 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -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 \
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index f2ac8bdfef..7b4d6472b0 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -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
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index d2ec1adfea..1bb62427b0 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -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
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0b6f65a855..d1e9138c66 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -494,7 +494,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]
 
@@ -1413,7 +1414,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')
@@ -1502,7 +1504,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 variants \
+        and not bb.data.inherits_class('packagegroup', d):
         write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
 
 }
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/7] sstate.bbclass: update SSTATE_DUPWHITELIST
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
  2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 15:52 ` [PATCH 3/7] update_font_cache: update script for multilib kai.kang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Update SSTATE_DUPWHITELIST in sstate.bbclass.

* remove ${DEPLOY_DIR_RPM}/noarch/ which is not overwritten any more
* add directories for package target-sdk-provides-dummy

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/sstate.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ecf08fb2d0..efb0096c70 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -25,12 +25,14 @@ PV[vardepvalue] = "${PV}"
 SSTATE_EXTRAPATH[vardepvalue] = ""
 
 # For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical)
-SSTATE_DUPWHITELIST = "${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"
+SSTATE_DUPWHITELIST = "${DEPLOY_DIR}/licenses/"
 # Avoid docbook/sgml catalog warnings for now
 SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
 # sdk-provides-dummy-nativesdk and nativesdk-buildtools-perl-dummy overlap for different SDKMACHINE
 SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/sdk_provides_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-nativesdk/"
 SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/buildtools_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/buildtools-dummy-nativesdk/"
+# target-sdk-provides-dummy overlaps that allarch is disabled when multilib is used
+SSTATE_DUPWHITELIST += "${COMPONENTS_DIR}/sdk-provides-dummy-target/ ${DEPLOY_DIR_RPM}/sdk_provides_dummy_target/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-target/"
 # Archive the sources for many architectures in one deploy folder
 SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
 # ovmf/grub-efi/systemd-boot/intel-microcode multilib recipes can generate identical overlapping files
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/7] update_font_cache: update script for multilib
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
  2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
  2018-09-06 15:52 ` [PATCH 2/7] sstate.bbclass: update SSTATE_DUPWHITELIST kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 15:52 ` [PATCH 4/7] update_gtk_immodules_cache: update " kai.kang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Packages which inherit fontcache.bbclass call postinstall script
update_font_cache. And in update_font_cache, it calls ${bindir}/fc-cache
by qemuwrapper. When multilib is enabled, both packages foo and lib32-foo
will call ${bindir}/fc-cache and one of them will fail to run obviously.

Duplicate install file fc-cache to ${libexecdir} with ${MLPREFIX} and
call proper fc-cache in update_font_cache.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb | 8 +++++++-
 scripts/postinst-intercepts/update_font_cache         | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb b/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb
index d4cbce80b4..cec524755d 100644
--- a/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb
+++ b/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb
@@ -35,9 +35,15 @@ do_configure_prepend() {
     rm -f ${S}/src/fcobjshash.h ${S}/src/fcobjshash.gperf
 }
 
+do_install_append_class-target() {
+    # duplicate fc-cache for postinstall script
+    mkdir -p ${D}${libexecdir}
+    ln ${D}${bindir}/fc-cache ${D}${libexecdir}/${MLPREFIX}fc-cache
+}
+
 PACKAGES =+ "fontconfig-utils"
 FILES_${PN} =+ "${datadir}/xml/*"
-FILES_fontconfig-utils = "${bindir}/*"
+FILES_fontconfig-utils = "${bindir}/* ${libexecdir}/*"
 
 # Work around past breakage in debian.bbclass
 RPROVIDES_fontconfig-utils = "libfontconfig-utils"
diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
index 20e9048adf..e0ec471964 100644
--- a/scripts/postinst-intercepts/update_font_cache
+++ b/scripts/postinst-intercepts/update_font_cache
@@ -2,5 +2,5 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
+PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${libexecdir}/${binprefix}fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
 chown -R root:root $D${fontconfigcachedir}
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/7] update_gtk_immodules_cache: update for multilib
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (2 preceding siblings ...)
  2018-09-06 15:52 ` [PATCH 3/7] update_font_cache: update script for multilib kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 15:52 ` [PATCH 5/7] statetests.py: drop test_sstate_allarch_samesigs_multilib kai.kang
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Postinstall script update_gtk_immodules_cache calls
${bindir}/gtk-query-immodules-${version}. When multilib is enabled, both
packages foo and lib32-foo call ${bindir}/gtk-query-immodules-${version}
and one of them will fail to run obviously.

Duplicate install files gtk-query-immodules-${version} to ${libexecdir}
with ${MLPREFIX}. And update update_gtk_immodules_cache calls proper
binary.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-gnome/gtk+/gtk+.inc                       | 4 ++++
 meta/recipes-gnome/gtk+/gtk+3.inc                      | 4 ++++
 scripts/postinst-intercepts/update_gtk_immodules_cache | 8 ++++----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-gnome/gtk+/gtk+.inc b/meta/recipes-gnome/gtk+/gtk+.inc
index 558bc485ad..14ed8d812c 100644
--- a/meta/recipes-gnome/gtk+/gtk+.inc
+++ b/meta/recipes-gnome/gtk+/gtk+.inc
@@ -90,6 +90,10 @@ do_install () {
 	install -m 0644 ${S}/gtk/gtkfilesystemmodel.h    ${D}${includedir}/gtk-2.0/gtk/
 
 	mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-2.0
+
+    # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache
+    mkdir -p ${D}${libexecdir}
+    ln ${D}${bindir}/gtk-query-immodules-2.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-2.0
 }
 
 SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess"
diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc
index 420ead2ca2..6331a4323c 100644
--- a/meta/recipes-gnome/gtk+/gtk+3.inc
+++ b/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -53,6 +53,10 @@ PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,way
 
 do_install_append() {
 	mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
+
+    # duplicate gtk-query-immodules for post install script update_gtk_immodules_cache
+    mkdir -p ${D}${libexecdir}
+    ln ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0
 }
 
 PACKAGES =+ "${PN}-demo"
diff --git a/scripts/postinst-intercepts/update_gtk_immodules_cache b/scripts/postinst-intercepts/update_gtk_immodules_cache
index d85d3622c2..395516971e 100644
--- a/scripts/postinst-intercepts/update_gtk_immodules_cache
+++ b/scripts/postinst-intercepts/update_gtk_immodules_cache
@@ -2,14 +2,14 @@
 
 set -e
 
-if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
-    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D/${bindir}/gtk-query-immodules-2.0 \
+if [ -x $D${libexecdir}/${binprefix}gtk-query-immodules-2.0 ]; then
+    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}gtk-query-immodules-2.0 \
         > $D${libdir}/gtk-2.0/2.10.0/immodules.cache &&
         sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
         chown root:root $D${libdir}/gtk-2.0/2.10.0/immodules.cache
 fi
-if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
-    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D/${bindir}/gtk-query-immodules-3.0 \
+if [ -x $D${libexecdir}/${binprefix}gtk-query-immodules-3.0 ]; then
+    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}gtk-query-immodules-3.0 \
         > $D${libdir}/gtk-3.0/3.0.0/immodules.cache &&
         sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
         chown root:root $D${libdir}/gtk-3.0/3.0.0/immodules.cache
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/7] statetests.py: drop test_sstate_allarch_samesigs_multilib
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (3 preceding siblings ...)
  2018-09-06 15:52 ` [PATCH 4/7] update_gtk_immodules_cache: update " kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 15:52 ` [PATCH 6/7] multilib: fix install file conflicts kai.kang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

allarch is disabled when multilib is used, so sstate oeqa case
test_sstate_allarch_samesigs_multilib is useless. Remove check for
allarch part and rename to test_sstate_nativesdk_samesigs_multilib.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/lib/oeqa/selftest/cases/sstatetests.py | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 7b008e409f..7194225c0a 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -349,12 +349,9 @@ MACHINE = \"qemuarm\"
         self.sstate_allarch_samesigs(configA, configB)
 
     @OETestID(1645)
-    def test_sstate_allarch_samesigs_multilib(self):
+    def test_sstate_nativesdk_samesigs_multilib(self):
         """
-        The sstate checksums of allarch multilib packages should be independent of whichever
-        MACHINE is set. Check this using bitbake -S.
-        Also, rather than duplicate the test, check nativesdk stamps are the same between
-        the two MACHINE values.
+        check nativesdk stamps are the same between the two MACHINE values.
         """
 
         configA = """
@@ -392,10 +389,6 @@ MULTILIBS = \"\"
                         (_, task, _, shash) = name.rsplit(".", 3)
                         f[os.path.join(os.path.basename(root), task)] = shash
             return f
-        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/all" + self.target_vendor + "-" + self.target_os)
-        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/all" + self.target_vendor + "-" + self.target_os)
-        self.maxDiff = None
-        self.assertEqual(files1, files2)
 
         nativesdkdir = os.path.basename(glob.glob(self.topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
 
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/7] multilib: fix install file conflicts
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (4 preceding siblings ...)
  2018-09-06 15:52 ` [PATCH 5/7] statetests.py: drop test_sstate_allarch_samesigs_multilib kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 22:31   ` richard.purdie
  2018-09-06 15:52 ` [PATCH 7/7] target-sdk-provides-dummy: skip package_qa_multilib check kai.kang
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Fix install files conflicts between multlib packages:

| Error: Transaction check error:
|   file /usr/bin/g-ir-annotation-tool conflicts between attempted installs of lib32-gobject-introspection-1.56.1-r0.x86 and gobject-introspection-1.56.1-r0.core2_64
|   file /usr/bin/g-ir-scanner conflicts between attempted installs of lib32-gobject-introspection-1.56.1-r0.x86 and gobject-introspection-1.56.1-r0.core2_64
|   file /usr/bin/cairo-trace conflicts between attempted installs of lib32-libcairo-perf-utils-1.14.12-r0.x86 and libcairo-perf-utils-1.14.12-r0.core2_64
|   file /usr/bin/icu-config conflicts between attempted installs of lib32-icu-dev-62.1-r0.x86 and icu-dev-62.1-r0.core2_64
|   file /usr/share/gir-1.0/GLib-2.0.gir conflicts between attempted installs of gobject-introspection-dev-1.56.1-r0.core2_64 and lib32-gobject-introspection-dev-1.56.1-r0.x86
|   file /usr/bin/gpgrt-config conflicts between attempted installs of lib32-libgpg-error-dev-1.32-r0.x86 and libgpg-error-dev-1.32-r0.core2_64
|   file /usr/share/pkgconfig/udev.pc conflicts between attempted installs of eudev-dev-3.2.5-r0.core2_64 and lib32-eudev-dev-3.2.5-r0.x86

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-core/udev/eudev_3.2.5.bb                       | 6 ++++--
 .../gobject-introspection/gobject-introspection_1.56.1.bb   | 6 ++++--
 meta/recipes-graphics/cairo/cairo_1.14.12.bb                | 6 ++++--
 meta/recipes-support/icu/icu.inc                            | 4 +++-
 meta/recipes-support/libgpg-error/libgpg-error_1.32.bb      | 5 ++++-
 5 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-core/udev/eudev_3.2.5.bb b/meta/recipes-core/udev/eudev_3.2.5.bb
index 75617c8d4e..75130f03ef 100644
--- a/meta/recipes-core/udev/eudev_3.2.5.bb
+++ b/meta/recipes-core/udev/eudev_3.2.5.bb
@@ -23,7 +23,9 @@ SRC_URI = "http://dev.gentoo.org/~blueness/${BPN}/${BP}.tar.gz \
 SRC_URI[md5sum] = "6ca08c0e14380f87df8e8aceac123671"
 SRC_URI[sha256sum] = "49c2d04105cad2526302627e040fa24b1916a9a3e059539bc8bb919b973890af"
 
-inherit autotools update-rc.d qemu pkgconfig distro_features_check
+inherit autotools update-rc.d qemu pkgconfig distro_features_check multilib_script
+
+MULTILIB_SCRIPTS = "${PN}-dev:${datadir}/pkgconfig/udev.pc"
 
 CONFLICT_DISTRO_FEATURES = "systemd"
 
@@ -65,7 +67,7 @@ PACKAGES =+ "eudev-hwdb"
 
 
 FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
-FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
+FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc* \
                    ${includedir}/libudev.h ${libdir}/libudev.so \
                    ${includedir}/udev.h ${libdir}/libudev.la \
                    ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb
index f3479565ea..887ff58049 100644
--- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb
@@ -23,7 +23,9 @@ SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d
 
 SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch"
 
-inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
+inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even multilib_script
+
+MULTILIB_SCRIPTS = "${PN}:${bindir}/g-ir-annotation-tool ${PN}:${bindir}/g-ir-scanner ${PN}-dev:${datadir}/gir-1.0/GLib-2.0.gir"
 
 DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native"
 
@@ -177,7 +179,7 @@ FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
 
 # .gir files go to dev package, as they're needed for developing (but not for running)
 # things that depends on introspection.
-FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"
+FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir*"
 FILES_${PN}-dev_append = " ${datadir}/gir-*/*.rnc"
 
 # These are used by gobject-based packages
diff --git a/meta/recipes-graphics/cairo/cairo_1.14.12.bb b/meta/recipes-graphics/cairo/cairo_1.14.12.bb
index a902c26879..18b947948a 100644
--- a/meta/recipes-graphics/cairo/cairo_1.14.12.bb
+++ b/meta/recipes-graphics/cairo/cairo_1.14.12.bb
@@ -30,7 +30,9 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \
 SRC_URI[md5sum] = "9f0db9dbfca0966be8acd682e636d165"
 SRC_URI[sha256sum] = "8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16"
 
-inherit autotools pkgconfig upstream-version-is-even gtk-doc
+inherit autotools pkgconfig upstream-version-is-even gtk-doc multilib_script
+
+MULTILIB_SCRIPTS = "${PN}-perf-utils:${bindir}/cairo-trace"
 
 X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
 
@@ -79,7 +81,7 @@ DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities"
 FILES_${PN} = "${libdir}/libcairo.so.*"
 FILES_${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
 FILES_${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
-FILES_${PN}-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
+FILES_${PN}-perf-utils = "${bindir}/cairo-trace* ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
 FILES_${PN}-dev += "${libdir}/cairo/*.so"
 
 BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/icu/icu.inc b/meta/recipes-support/icu/icu.inc
index f0786baa03..e20085fbf5 100644
--- a/meta/recipes-support/icu/icu.inc
+++ b/meta/recipes-support/icu/icu.inc
@@ -19,7 +19,9 @@ BINCONFIG = "${bindir}/icu-config"
 
 ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
 
-inherit autotools pkgconfig binconfig
+inherit autotools pkgconfig binconfig multilib_script
+
+MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/icu-config"
 
 # ICU needs the native build directory as an argument to its --with-cross-build option when
 # cross-compiling. Taken the situation that different builds may share a common sstate-cache
diff --git a/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb b/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
index 098242ea10..a4c720be9d 100644
--- a/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
+++ b/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
@@ -20,7 +20,10 @@ SRC_URI[sha256sum] = "c345c5e73cc2332f8d50db84a2280abfb1d8f6d4f1858b9daa30404db4
 
 BINCONFIG = "${bindir}/gpg-error-config"
 
-inherit autotools binconfig-disabled pkgconfig gettext multilib_header
+inherit autotools binconfig-disabled pkgconfig gettext multilib_header multilib_script
+
+MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/gpgrt-config"
+
 CPPFLAGS += "-P"
 do_compile_prepend() {
 	TARGET_FILE=linux-gnu
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/7] target-sdk-provides-dummy: skip package_qa_multilib check
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (5 preceding siblings ...)
  2018-09-06 15:52 ` [PATCH 6/7] multilib: fix install file conflicts kai.kang
@ 2018-09-06 15:52 ` kai.kang
  2018-09-06 17:04 ` ✗ patchtest: failure for disable allarch when multilib is used Patchwork
  2018-09-07  8:32 ` [PATCH v5 0/7] " richard.purdie
  8 siblings, 0 replies; 20+ messages in thread
From: kai.kang @ 2018-09-06 15:52 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

The rprovides of target-sdk-provides-dummy don't be updated with
multilib, so it fails package_qa_multilib check. Because
target-sdk-provides-dummy doesn't install any file to sysroot, it is
safe to skip package_qa_multilib check for target-sdk-provides-dummy.

Remove ${MLPREFIX}target-sdk-provides-dummy from TOOLCHAIN_TARGET_TASK
at same time in populate_sdk_base.bbclass.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/multilib.bbclass          | 4 ++++
 meta/classes/populate_sdk_base.bbclass | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 7b4d6472b0..e7b717eee1 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -146,6 +146,10 @@ python do_package_qa_multilib() {
     if not ml:
         return
 
+    # exception for ${MLPREFIX}target-sdk-provides-dummy
+    if 'target-sdk-provides-dummy' in d.getVar('PN'):
+        return
+
     packages = d.getVar('PACKAGES')
     for pkg in packages.split():
         check_mlprefix(pkg, 'RDEPENDS', ml)
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index bbf1ff1cd2..e07ad0cc6b 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -40,8 +40,7 @@ SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
 
 TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"
 TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
-TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
-                          ${@multilib_pkg_extend(d, 'target-sdk-provides-dummy')}"
+TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} target-sdk-provides-dummy"
 TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
 
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* ✗ patchtest: failure for disable allarch when multilib is used
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (6 preceding siblings ...)
  2018-09-06 15:52 ` [PATCH 7/7] target-sdk-provides-dummy: skip package_qa_multilib check kai.kang
@ 2018-09-06 17:04 ` Patchwork
  2018-09-07  8:32 ` [PATCH v5 0/7] " richard.purdie
  8 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2018-09-06 17:04 UTC (permalink / raw)
  To: Kang Kai; +Cc: openembedded-core

== Series Details ==

Series: disable allarch when multilib is used
Revision: 1
URL   : https://patchwork.openembedded.org/series/13937/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Patch            [1/7] allarch: only enable allarch when multilib is not used
 Issue             Patch is missing Signed-off-by [test_signed_off_by_presence] 
  Suggested fix    Sign off the patch (either manually or with "git commit --amend -s")



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 6/7] multilib: fix install file conflicts
  2018-09-06 15:52 ` [PATCH 6/7] multilib: fix install file conflicts kai.kang
@ 2018-09-06 22:31   ` richard.purdie
  2018-09-07  1:22     ` Kang Kai
  0 siblings, 1 reply; 20+ messages in thread
From: richard.purdie @ 2018-09-06 22:31 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

On Thu, 2018-09-06 at 23:52 +0800, kai.kang@windriver.com wrote:
> diff --git a/meta/recipes-core/udev/eudev_3.2.5.bb b/meta/recipes-
> core/udev/eudev_3.2.5.bb
> index 75617c8d4e..75130f03ef 100644
> --- a/meta/recipes-core/udev/eudev_3.2.5.bb
> +++ b/meta/recipes-core/udev/eudev_3.2.5.bb
> @@ -23,7 +23,9 @@ SRC_URI = "http://dev.gentoo.org/~blueness/${BPN}/$
> {BP}.tar.gz \
>  SRC_URI[md5sum] = "6ca08c0e14380f87df8e8aceac123671"
>  SRC_URI[sha256sum] =
> "49c2d04105cad2526302627e040fa24b1916a9a3e059539bc8bb919b973890af"
>  
> -inherit autotools update-rc.d qemu pkgconfig distro_features_check
> +inherit autotools update-rc.d qemu pkgconfig distro_features_check
> multilib_script
> +
> +MULTILIB_SCRIPTS = "${PN}-dev:${datadir}/pkgconfig/udev.pc"
>  
>  CONFLICT_DISTRO_FEATURES = "systemd"
>  
> @@ -65,7 +67,7 @@ PACKAGES =+ "eudev-hwdb"
>  
>  
>  FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
> -FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
> +FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc* \
>                     ${includedir}/libudev.h ${libdir}/libudev.so \
>                     ${includedir}/udev.h ${libdir}/libudev.la \
>                     ${libdir}/libudev.a
> ${libdir}/pkgconfig/libudev.pc"

I already commented on this, the file should be installed into libdir
if its arch specific. I suspect libudev.pc is, udev.pc is not and
udev.pc needs to stop referencing libdir. 

Regardless, we're not using MULTILIB_SCRIPTS for .pc files.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 6/7] multilib: fix install file conflicts
  2018-09-06 22:31   ` richard.purdie
@ 2018-09-07  1:22     ` Kang Kai
  0 siblings, 0 replies; 20+ messages in thread
From: Kang Kai @ 2018-09-07  1:22 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

On 2018年09月07日 06:31, richard.purdie@linuxfoundation.org wrote:
> On Thu, 2018-09-06 at 23:52 +0800, kai.kang@windriver.com wrote:
>> diff --git a/meta/recipes-core/udev/eudev_3.2.5.bb b/meta/recipes-
>> core/udev/eudev_3.2.5.bb
>> index 75617c8d4e..75130f03ef 100644
>> --- a/meta/recipes-core/udev/eudev_3.2.5.bb
>> +++ b/meta/recipes-core/udev/eudev_3.2.5.bb
>> @@ -23,7 +23,9 @@ SRC_URI = "http://dev.gentoo.org/~blueness/${BPN}/$
>> {BP}.tar.gz \
>>   SRC_URI[md5sum] = "6ca08c0e14380f87df8e8aceac123671"
>>   SRC_URI[sha256sum] =
>> "49c2d04105cad2526302627e040fa24b1916a9a3e059539bc8bb919b973890af"
>>   
>> -inherit autotools update-rc.d qemu pkgconfig distro_features_check
>> +inherit autotools update-rc.d qemu pkgconfig distro_features_check
>> multilib_script
>> +
>> +MULTILIB_SCRIPTS = "${PN}-dev:${datadir}/pkgconfig/udev.pc"
>>   
>>   CONFLICT_DISTRO_FEATURES = "systemd"
>>   
>> @@ -65,7 +67,7 @@ PACKAGES =+ "eudev-hwdb"
>>   
>>   
>>   FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
>> -FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
>> +FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc* \
>>                      ${includedir}/libudev.h ${libdir}/libudev.so \
>>                      ${includedir}/udev.h ${libdir}/libudev.la \
>>                      ${libdir}/libudev.a
>> ${libdir}/pkgconfig/libudev.pc"
> I already commented on this, the file should be installed into libdir
> if its arch specific. I suspect libudev.pc is, udev.pc is not and
> udev.pc needs to stop referencing libdir.

Sorry, I thought no good way to deal ${libdir} in .pc files. I'll fix it.

Regards,
Kai


>   
>
> Regardless, we're not using MULTILIB_SCRIPTS for .pc files.
>
> Cheers,
>
> Richard
>

-- 
Regards,
Neil | Kai Kang



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v5 0/7] disable allarch when multilib is used
  2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
                   ` (7 preceding siblings ...)
  2018-09-06 17:04 ` ✗ patchtest: failure for disable allarch when multilib is used Patchwork
@ 2018-09-07  8:32 ` richard.purdie
  8 siblings, 0 replies; 20+ messages in thread
From: richard.purdie @ 2018-09-07  8:32 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

On Thu, 2018-09-06 at 23:52 +0800, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
> 
> V5:
> * set PACKAGE_ARCH in event handler bb.event.RecipePreFinalise
> * add execption of target-sdk-provides-dummy for package_qa_multilib
> check

In general this looks good but oe-selftest -r
sstatetests.SStateTests.test_sstate_nativesdk_samesigs_multilib fails:

https://typhoon.yocto.io/#/builders/28/builds/44/steps/7/logs/step2d

Cheers,

Richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
@ 2018-09-13 18:20   ` Martin Jansa
  2018-09-13 20:10     ` Martin Jansa
  0 siblings, 1 reply; 20+ messages in thread
From: Martin Jansa @ 2018-09-13 18:20 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 7539 bytes --]

On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
> 
> 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 required.
> 
> Only enable allarch when multilib is not used to fix the issue.
> 
> signed-off-by: kai kang <kai.kang@windriver.com>
> ---
>  meta/classes/allarch.bbclass         | 12 +++++++++++-
>  meta/classes/icecc.bbclass           |  2 +-
>  meta/classes/multilib.bbclass        |  3 ++-
>  meta/classes/multilib_global.bbclass |  4 +---
>  meta/classes/package.bbclass         |  9 ++++++---
>  5 files changed, 21 insertions(+), 9 deletions(-)
> 
> diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> index 1eebe0bf2e..45f62a5939 100644
> --- a/meta/classes/allarch.bbclass
> +++ b/meta/classes/allarch.bbclass
> @@ -2,7 +2,17 @@
>  # This class is used for architecture independent recipes/data files (usually scripts)
>  #
>  
> -PACKAGE_ARCH = "all"
> +python allarch_package_arch_handler () {
> +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> +        return
> +
> +    variants = d.getVar("MULTILIB_VARIANTS")
> +    if not variants:
> +        d.setVar("PACKAGE_ARCH", "all" )
> +}
> +
> +addhandler allarch_package_arch_handler
> +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"

Maybe I'm overlooking something, but doesn't this overwrite whatever
PACKAGE_ARCH as set before this?

I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
another bbclass, but then overwritten with "all" by allarch_package_arch_handler:

# $PACKAGE_ARCH [5 operations]
#   set oe-core/meta/conf/bitbake.conf:150
#     [_defaultval] "${TUNE_PKGARCH}"
#   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
#     "${MACHINE_ARCH}"
#   set oe-core/meta/conf/documentation.conf:304
#     [doc] "The architecture of the resulting package or packages."
#   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
#     "${MACHINE_ARCH}"
#   set allarch.bbclass:12 [allarch_package_arch_handler]
#     "all"
# pre-expansion value:
#   "all"
PACKAGE_ARCH="all"

But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:

# $PACKAGE_ARCH [4 operations]
#   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
#     [_defaultval] "${TUNE_PKGARCH}"
#   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
#     [doc] "The architecture of the resulting package or packages."
#   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
#     "${MACHINE_ARCH}"
#   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
#     "all"
# pre-expansion value:
#   "${MACHINE_ARCH}"
PACKAGE_ARCH="qemux86_64"

Why isn't allarch_package_arch_handler executed in the 2nd case?

Cheers,

>  
>  python () {
>      # Allow this class to be included but overridden - only set
> diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> index 0ca8de86c2..b5a8457747 100644
> --- a/meta/classes/icecc.bbclass
> +++ b/meta/classes/icecc.bbclass
> @@ -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 \
> diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> index f2ac8bdfef..7b4d6472b0 100644
> --- a/meta/classes/multilib.bbclass
> +++ b/meta/classes/multilib.bbclass
> @@ -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
> diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> index d2ec1adfea..1bb62427b0 100644
> --- a/meta/classes/multilib_global.bbclass
> +++ b/meta/classes/multilib_global.bbclass
> @@ -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
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 0b6f65a855..d1e9138c66 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -494,7 +494,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]
>  
> @@ -1413,7 +1414,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')
> @@ -1502,7 +1504,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 variants \
> +        and not bb.data.inherits_class('packagegroup', d):
>          write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
>  
>  }
> -- 
> 2.18.0
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-13 18:20   ` Martin Jansa
@ 2018-09-13 20:10     ` Martin Jansa
  2018-09-14 11:25       ` Martin Jansa
  0 siblings, 1 reply; 20+ messages in thread
From: Martin Jansa @ 2018-09-13 20:10 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 8568 bytes --]

On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> > From: Kai Kang <kai.kang@windriver.com>
> > 
> > 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 required.
> > 
> > Only enable allarch when multilib is not used to fix the issue.
> > 
> > signed-off-by: kai kang <kai.kang@windriver.com>
> > ---
> >  meta/classes/allarch.bbclass         | 12 +++++++++++-
> >  meta/classes/icecc.bbclass           |  2 +-
> >  meta/classes/multilib.bbclass        |  3 ++-
> >  meta/classes/multilib_global.bbclass |  4 +---
> >  meta/classes/package.bbclass         |  9 ++++++---
> >  5 files changed, 21 insertions(+), 9 deletions(-)
> > 
> > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > index 1eebe0bf2e..45f62a5939 100644
> > --- a/meta/classes/allarch.bbclass
> > +++ b/meta/classes/allarch.bbclass
> > @@ -2,7 +2,17 @@
> >  # This class is used for architecture independent recipes/data files (usually scripts)
> >  #
> >  
> > -PACKAGE_ARCH = "all"
> > +python allarch_package_arch_handler () {
> > +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> > +        return
> > +
> > +    variants = d.getVar("MULTILIB_VARIANTS")
> > +    if not variants:
> > +        d.setVar("PACKAGE_ARCH", "all" )
> > +}
> > +
> > +addhandler allarch_package_arch_handler
> > +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
> 
> Maybe I'm overlooking something, but doesn't this overwrite whatever
> PACKAGE_ARCH as set before this?
> 
> I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
> another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
> 
> # $PACKAGE_ARCH [5 operations]
> #   set oe-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> #     "${MACHINE_ARCH}"
> #   set oe-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> #     "${MACHINE_ARCH}"
> #   set allarch.bbclass:12 [allarch_package_arch_handler]
> #     "all"
> # pre-expansion value:
> #   "all"
> PACKAGE_ARCH="all"
> 
> But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
> 
> # $PACKAGE_ARCH [4 operations]
> #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
> #     "${MACHINE_ARCH}"
> #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> #     "all"
> # pre-expansion value:
> #   "${MACHINE_ARCH}"
> PACKAGE_ARCH="qemux86_64"
> 
> Why isn't allarch_package_arch_handler executed in the 2nd case?

Now I see the difference, I was still living in the days when
"disabling" allarch was possible just by setting PACKAGE_ARCH before
inheritting allarch, but now I see that packagegroups do conditional
inherit as well since:
http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
so I'll modify currently failing recipes to do the same and stop
inheritting allarch when PACKAGE_ARCH is set to something else.

Cheers,

> >  python () {
> >      # Allow this class to be included but overridden - only set
> > diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> > index 0ca8de86c2..b5a8457747 100644
> > --- a/meta/classes/icecc.bbclass
> > +++ b/meta/classes/icecc.bbclass
> > @@ -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 \
> > diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> > index f2ac8bdfef..7b4d6472b0 100644
> > --- a/meta/classes/multilib.bbclass
> > +++ b/meta/classes/multilib.bbclass
> > @@ -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
> > diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> > index d2ec1adfea..1bb62427b0 100644
> > --- a/meta/classes/multilib_global.bbclass
> > +++ b/meta/classes/multilib_global.bbclass
> > @@ -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
> > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> > index 0b6f65a855..d1e9138c66 100644
> > --- a/meta/classes/package.bbclass
> > +++ b/meta/classes/package.bbclass
> > @@ -494,7 +494,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]
> >  
> > @@ -1413,7 +1414,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')
> > @@ -1502,7 +1504,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 variants \
> > +        and not bb.data.inherits_class('packagegroup', d):
> >          write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
> >  
> >  }
> > -- 
> > 2.18.0
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-13 20:10     ` Martin Jansa
@ 2018-09-14 11:25       ` Martin Jansa
  2018-09-14 14:12         ` Martin Jansa
  0 siblings, 1 reply; 20+ messages in thread
From: Martin Jansa @ 2018-09-14 11:25 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 9348 bytes --]

On Thu, Sep 13, 2018 at 10:10:46PM +0200, Martin Jansa wrote:
> On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> > On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> > > From: Kai Kang <kai.kang@windriver.com>
> > > 
> > > 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 required.
> > > 
> > > Only enable allarch when multilib is not used to fix the issue.
> > > 
> > > signed-off-by: kai kang <kai.kang@windriver.com>
> > > ---
> > >  meta/classes/allarch.bbclass         | 12 +++++++++++-
> > >  meta/classes/icecc.bbclass           |  2 +-
> > >  meta/classes/multilib.bbclass        |  3 ++-
> > >  meta/classes/multilib_global.bbclass |  4 +---
> > >  meta/classes/package.bbclass         |  9 ++++++---
> > >  5 files changed, 21 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > > index 1eebe0bf2e..45f62a5939 100644
> > > --- a/meta/classes/allarch.bbclass
> > > +++ b/meta/classes/allarch.bbclass
> > > @@ -2,7 +2,17 @@
> > >  # This class is used for architecture independent recipes/data files (usually scripts)
> > >  #
> > >  
> > > -PACKAGE_ARCH = "all"
> > > +python allarch_package_arch_handler () {
> > > +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> > > +        return
> > > +
> > > +    variants = d.getVar("MULTILIB_VARIANTS")
> > > +    if not variants:
> > > +        d.setVar("PACKAGE_ARCH", "all" )
> > > +}
> > > +
> > > +addhandler allarch_package_arch_handler
> > > +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
> > 
> > Maybe I'm overlooking something, but doesn't this overwrite whatever
> > PACKAGE_ARCH as set before this?
> > 
> > I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
> > another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
> > 
> > # $PACKAGE_ARCH [5 operations]
> > #   set oe-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> > #     "${MACHINE_ARCH}"
> > #   set oe-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> > #     "${MACHINE_ARCH}"
> > #   set allarch.bbclass:12 [allarch_package_arch_handler]
> > #     "all"
> > # pre-expansion value:
> > #   "all"
> > PACKAGE_ARCH="all"
> > 
> > But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
> > 
> > # $PACKAGE_ARCH [4 operations]
> > #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
> > #     "${MACHINE_ARCH}"
> > #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> > #     "all"
> > # pre-expansion value:
> > #   "${MACHINE_ARCH}"
> > PACKAGE_ARCH="qemux86_64"
> > 
> > Why isn't allarch_package_arch_handler executed in the 2nd case?
> 
> Now I see the difference, I was still living in the days when
> "disabling" allarch was possible just by setting PACKAGE_ARCH before
> inheritting allarch, but now I see that packagegroups do conditional
> inherit as well since:
> http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
> http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
> so I'll modify currently failing recipes to do the same and stop
> inheritting allarch when PACKAGE_ARCH is set to something else.

From public layers I've found with test-signatures script only
fbset-nodes recipe in meta-oe which was setting PACKAGE_ARCH after
allarch inherit, allarch removal sent here:
http://lists.openembedded.org/pipermail/openembedded-devel/2018-September/120560.html

> 
> Cheers,
> 
> > >  python () {
> > >      # Allow this class to be included but overridden - only set
> > > diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> > > index 0ca8de86c2..b5a8457747 100644
> > > --- a/meta/classes/icecc.bbclass
> > > +++ b/meta/classes/icecc.bbclass
> > > @@ -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 \
> > > diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> > > index f2ac8bdfef..7b4d6472b0 100644
> > > --- a/meta/classes/multilib.bbclass
> > > +++ b/meta/classes/multilib.bbclass
> > > @@ -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
> > > diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> > > index d2ec1adfea..1bb62427b0 100644
> > > --- a/meta/classes/multilib_global.bbclass
> > > +++ b/meta/classes/multilib_global.bbclass
> > > @@ -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
> > > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> > > index 0b6f65a855..d1e9138c66 100644
> > > --- a/meta/classes/package.bbclass
> > > +++ b/meta/classes/package.bbclass
> > > @@ -494,7 +494,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]
> > >  
> > > @@ -1413,7 +1414,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')
> > > @@ -1502,7 +1504,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 variants \
> > > +        and not bb.data.inherits_class('packagegroup', d):
> > >          write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
> > >  
> > >  }
> > > -- 
> > > 2.18.0
> > > 
> > > -- 
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > 
> > -- 
> > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> 
> 
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-14 11:25       ` Martin Jansa
@ 2018-09-14 14:12         ` Martin Jansa
  2018-09-17  2:25           ` Kang Kai
  0 siblings, 1 reply; 20+ messages in thread
From: Martin Jansa @ 2018-09-14 14:12 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 13386 bytes --]

On Fri, Sep 14, 2018 at 01:25:12PM +0200, Martin Jansa wrote:
> On Thu, Sep 13, 2018 at 10:10:46PM +0200, Martin Jansa wrote:
> > On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> > > On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> > > > From: Kai Kang <kai.kang@windriver.com>
> > > > 
> > > > 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 required.
> > > > 
> > > > Only enable allarch when multilib is not used to fix the issue.
> > > > 
> > > > signed-off-by: kai kang <kai.kang@windriver.com>
> > > > ---
> > > >  meta/classes/allarch.bbclass         | 12 +++++++++++-
> > > >  meta/classes/icecc.bbclass           |  2 +-
> > > >  meta/classes/multilib.bbclass        |  3 ++-
> > > >  meta/classes/multilib_global.bbclass |  4 +---
> > > >  meta/classes/package.bbclass         |  9 ++++++---
> > > >  5 files changed, 21 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > > > index 1eebe0bf2e..45f62a5939 100644
> > > > --- a/meta/classes/allarch.bbclass
> > > > +++ b/meta/classes/allarch.bbclass
> > > > @@ -2,7 +2,17 @@
> > > >  # This class is used for architecture independent recipes/data files (usually scripts)
> > > >  #
> > > >  
> > > > -PACKAGE_ARCH = "all"
> > > > +python allarch_package_arch_handler () {
> > > > +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> > > > +        return
> > > > +
> > > > +    variants = d.getVar("MULTILIB_VARIANTS")
> > > > +    if not variants:
> > > > +        d.setVar("PACKAGE_ARCH", "all" )
> > > > +}
> > > > +
> > > > +addhandler allarch_package_arch_handler
> > > > +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
> > > 
> > > Maybe I'm overlooking something, but doesn't this overwrite whatever
> > > PACKAGE_ARCH as set before this?
> > > 
> > > I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
> > > another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
> > > 
> > > # $PACKAGE_ARCH [5 operations]
> > > #   set oe-core/meta/conf/bitbake.conf:150
> > > #     [_defaultval] "${TUNE_PKGARCH}"
> > > #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> > > #     "${MACHINE_ARCH}"
> > > #   set oe-core/meta/conf/documentation.conf:304
> > > #     [doc] "The architecture of the resulting package or packages."
> > > #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> > > #     "${MACHINE_ARCH}"
> > > #   set allarch.bbclass:12 [allarch_package_arch_handler]
> > > #     "all"
> > > # pre-expansion value:
> > > #   "all"
> > > PACKAGE_ARCH="all"
> > > 
> > > But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
> > > 
> > > # $PACKAGE_ARCH [4 operations]
> > > #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> > > #     [_defaultval] "${TUNE_PKGARCH}"
> > > #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> > > #     [doc] "The architecture of the resulting package or packages."
> > > #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
> > > #     "${MACHINE_ARCH}"
> > > #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> > > #     "all"
> > > # pre-expansion value:
> > > #   "${MACHINE_ARCH}"
> > > PACKAGE_ARCH="qemux86_64"
> > > 
> > > Why isn't allarch_package_arch_handler executed in the 2nd case?
> > 
> > Now I see the difference, I was still living in the days when
> > "disabling" allarch was possible just by setting PACKAGE_ARCH before
> > inheritting allarch, but now I see that packagegroups do conditional
> > inherit as well since:
> > http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
> > http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
> > so I'll modify currently failing recipes to do the same and stop
> > inheritting allarch when PACKAGE_ARCH is set to something else.
> 
> From public layers I've found with test-signatures script only
> fbset-nodes recipe in meta-oe which was setting PACKAGE_ARCH after
> allarch inherit, allarch removal sent here:
> http://lists.openembedded.org/pipermail/openembedded-devel/2018-September/120560.html

target-sdk-provides-dummy seems to be affected as well:
 === Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemux86copy ===
ERROR: lib32-target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from b0a44b2c7003b6b4aa3a023d9cb9fe82 to 3a59fa25ddb6a95aff079d477ebf3457
Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'

ERROR: target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
basehash changed from 9e44f1deb3d15886ee96db1a3332764c to 6b417d08a5113c9b06d13b3681f5ab4f
Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'


It's using:
inherit allarch

python() {
    # Put the package somewhere separate to ensure it's never used except
    # when we want it
    # (note that we have to do this in anonymous python here to avoid
    # allarch.bbclass disabling itself)
    d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
}

and DUMMYARCH = "sdk-provides-dummy-target"

The difference as shown with bitbake -e before and after reverting this commit:

before revert:
# $SSTATE_MANMACH [2 operations]
#   set? oe-core/meta/classes/sstate.bbclass:61
#     "${SSTATE_PKGARCH}"
#   set sstate.bbclass:100 [__anon_111_oe_core_meta_classes_sstate_bbclass]
#     "machineName"
# pre-expansion value:
#   "machineName"
SSTATE_MANMACH="machineName"

# $SSTATE_PKGARCH
#   set oe-core/meta/classes/sstate.bbclass:11
#     "${PACKAGE_ARCH}"
SSTATE_PKGARCH="sdk-provides-dummy-target"

# $PACKAGE_ARCH [3 operations]
#   set oe-core/meta/conf/bitbake.conf:150
#     [_defaultval] "${TUNE_PKGARCH}"
#   set oe-core/meta/conf/documentation.conf:304
#     [doc] "The architecture of the resulting package or packages."
#   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
#     "${DUMMYARCH}"
# pre-expansion value:
#   "${DUMMYARCH}"
PACKAGE_ARCH="sdk-provides-dummy-target"

after revert:
# $SSTATE_MANMACH
#   set? oe-core/meta/classes/sstate.bbclass:61
#     "${SSTATE_PKGARCH}"
SSTATE_MANMACH="allarch"

# $SSTATE_PKGARCH [2 operations]
#   set oe-core/meta/classes/sstate.bbclass:11
#     "${PACKAGE_ARCH}"
#   set sstate.bbclass:98 [__anon_111__oe_core_meta_classes_sstate_bbclass]
#     "allarch"
# pre-expansion value:
#   "allarch"
SSTATE_PKGARCH="allarch"

# $PACKAGE_ARCH [4 operations]
#   set oe-core/meta/conf/bitbake.conf:150
#     [_defaultval] "${TUNE_PKGARCH}"
#   set oe-core/meta/conf/documentation.conf:304
#     [doc] "The architecture of the resulting package or packages."
#   set oe-core/meta/classes/allarch.bbclass:5
#     "all"
#   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
#     "${DUMMYARCH}"
# pre-expansion value:
#   "${DUMMYARCH}"
PACKAGE_ARCH="sdk-provides-dummy-target"


the relevant part of the anonymous python in sstate.bbclass:

    elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
        d.setVar('SSTATE_PKGARCH', "allarch")
    else:
        d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))

So with your change, the PACKAGE_ARCH isn't set to "all" because multilib is enabled,
but that causes sstate.bbclass to set SSTATE_MANMACH to MACHINE instead of SSTATE_PKGARCH
allarch, where it got MACHINE is still a bit of mystery to me.

Cheers,

> 
> > 
> > Cheers,
> > 
> > > >  python () {
> > > >      # Allow this class to be included but overridden - only set
> > > > diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> > > > index 0ca8de86c2..b5a8457747 100644
> > > > --- a/meta/classes/icecc.bbclass
> > > > +++ b/meta/classes/icecc.bbclass
> > > > @@ -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 \
> > > > diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> > > > index f2ac8bdfef..7b4d6472b0 100644
> > > > --- a/meta/classes/multilib.bbclass
> > > > +++ b/meta/classes/multilib.bbclass
> > > > @@ -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
> > > > diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> > > > index d2ec1adfea..1bb62427b0 100644
> > > > --- a/meta/classes/multilib_global.bbclass
> > > > +++ b/meta/classes/multilib_global.bbclass
> > > > @@ -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
> > > > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> > > > index 0b6f65a855..d1e9138c66 100644
> > > > --- a/meta/classes/package.bbclass
> > > > +++ b/meta/classes/package.bbclass
> > > > @@ -494,7 +494,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]
> > > >  
> > > > @@ -1413,7 +1414,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')
> > > > @@ -1502,7 +1504,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 variants \
> > > > +        and not bb.data.inherits_class('packagegroup', d):
> > > >          write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
> > > >  
> > > >  }
> > > > -- 
> > > > 2.18.0
> > > > 
> > > > -- 
> > > > _______________________________________________
> > > > Openembedded-core mailing list
> > > > Openembedded-core@lists.openembedded.org
> > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > > 
> > > -- 
> > > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> > 
> > 
> > 
> > -- 
> > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> 
> 
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-14 14:12         ` Martin Jansa
@ 2018-09-17  2:25           ` Kang Kai
  2018-09-17  5:50             ` Martin Jansa
  2019-01-17 16:10             ` Dan Dedrick
  0 siblings, 2 replies; 20+ messages in thread
From: Kang Kai @ 2018-09-17  2:25 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core

On 2018年09月14日 22:12, Martin Jansa wrote:
> On Fri, Sep 14, 2018 at 01:25:12PM +0200, Martin Jansa wrote:
>> On Thu, Sep 13, 2018 at 10:10:46PM +0200, Martin Jansa wrote:
>>> On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
>>>> On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
>>>>> From: Kai Kang <kai.kang@windriver.com>
>>>>>
>>>>> 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 required.
>>>>>
>>>>> Only enable allarch when multilib is not used to fix the issue.
>>>>>
>>>>> signed-off-by: kai kang <kai.kang@windriver.com>
>>>>> ---
>>>>>   meta/classes/allarch.bbclass         | 12 +++++++++++-
>>>>>   meta/classes/icecc.bbclass           |  2 +-
>>>>>   meta/classes/multilib.bbclass        |  3 ++-
>>>>>   meta/classes/multilib_global.bbclass |  4 +---
>>>>>   meta/classes/package.bbclass         |  9 ++++++---
>>>>>   5 files changed, 21 insertions(+), 9 deletions(-)
>>>>>
>>>>> diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
>>>>> index 1eebe0bf2e..45f62a5939 100644
>>>>> --- a/meta/classes/allarch.bbclass
>>>>> +++ b/meta/classes/allarch.bbclass
>>>>> @@ -2,7 +2,17 @@
>>>>>   # This class is used for architecture independent recipes/data files (usually scripts)
>>>>>   #
>>>>>   
>>>>> -PACKAGE_ARCH = "all"
>>>>> +python allarch_package_arch_handler () {
>>>>> +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
>>>>> +        return
>>>>> +
>>>>> +    variants = d.getVar("MULTILIB_VARIANTS")
>>>>> +    if not variants:
>>>>> +        d.setVar("PACKAGE_ARCH", "all" )
>>>>> +}
>>>>> +
>>>>> +addhandler allarch_package_arch_handler
>>>>> +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
>>>> Maybe I'm overlooking something, but doesn't this overwrite whatever
>>>> PACKAGE_ARCH as set before this?
>>>>
>>>> I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
>>>> another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
>>>>
>>>> # $PACKAGE_ARCH [5 operations]
>>>> #   set oe-core/meta/conf/bitbake.conf:150
>>>> #     [_defaultval] "${TUNE_PKGARCH}"
>>>> #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
>>>> #     "${MACHINE_ARCH}"
>>>> #   set oe-core/meta/conf/documentation.conf:304
>>>> #     [doc] "The architecture of the resulting package or packages."
>>>> #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
>>>> #     "${MACHINE_ARCH}"
>>>> #   set allarch.bbclass:12 [allarch_package_arch_handler]
>>>> #     "all"
>>>> # pre-expansion value:
>>>> #   "all"
>>>> PACKAGE_ARCH="all"
>>>>
>>>> But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
>>>>
>>>> # $PACKAGE_ARCH [4 operations]
>>>> #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
>>>> #     [_defaultval] "${TUNE_PKGARCH}"
>>>> #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
>>>> #     [doc] "The architecture of the resulting package or packages."
>>>> #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
>>>> #     "${MACHINE_ARCH}"
>>>> #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
>>>> #     "all"
>>>> # pre-expansion value:
>>>> #   "${MACHINE_ARCH}"
>>>> PACKAGE_ARCH="qemux86_64"
>>>>
>>>> Why isn't allarch_package_arch_handler executed in the 2nd case?
>>> Now I see the difference, I was still living in the days when
>>> "disabling" allarch was possible just by setting PACKAGE_ARCH before
>>> inheritting allarch, but now I see that packagegroups do conditional
>>> inherit as well since:
>>> http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
>>> http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
>>> so I'll modify currently failing recipes to do the same and stop
>>> inheritting allarch when PACKAGE_ARCH is set to something else.
>>  From public layers I've found with test-signatures script only
>> fbset-nodes recipe in meta-oe which was setting PACKAGE_ARCH after
>> allarch inherit, allarch removal sent here:
>> http://lists.openembedded.org/pipermail/openembedded-devel/2018-September/120560.html
> target-sdk-provides-dummy seems to be affected as well:
>   === Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemux86copy ===
> ERROR: lib32-target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
> basehash changed from b0a44b2c7003b6b4aa3a023d9cb9fe82 to 3a59fa25ddb6a95aff079d477ebf3457
> Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
>
> ERROR: target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
> basehash changed from 9e44f1deb3d15886ee96db1a3332764c to 6b417d08a5113c9b06d13b3681f5ab4f
> Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
>
>
> It's using:
> inherit allarch
>
> python() {
>      # Put the package somewhere separate to ensure it's never used except
>      # when we want it
>      # (note that we have to do this in anonymous python here to avoid
>      # allarch.bbclass disabling itself)
>      d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
> }
>
> and DUMMYARCH = "sdk-provides-dummy-target"
>
> The difference as shown with bitbake -e before and after reverting this commit:
>
> before revert:
> # $SSTATE_MANMACH [2 operations]
> #   set? oe-core/meta/classes/sstate.bbclass:61
> #     "${SSTATE_PKGARCH}"
> #   set sstate.bbclass:100 [__anon_111_oe_core_meta_classes_sstate_bbclass]
> #     "machineName"
> # pre-expansion value:
> #   "machineName"
> SSTATE_MANMACH="machineName"
>
> # $SSTATE_PKGARCH
> #   set oe-core/meta/classes/sstate.bbclass:11
> #     "${PACKAGE_ARCH}"
> SSTATE_PKGARCH="sdk-provides-dummy-target"
>
> # $PACKAGE_ARCH [3 operations]
> #   set oe-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set oe-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> #     "${DUMMYARCH}"
> # pre-expansion value:
> #   "${DUMMYARCH}"
> PACKAGE_ARCH="sdk-provides-dummy-target"
>
> after revert:
> # $SSTATE_MANMACH
> #   set? oe-core/meta/classes/sstate.bbclass:61
> #     "${SSTATE_PKGARCH}"
> SSTATE_MANMACH="allarch"
>
> # $SSTATE_PKGARCH [2 operations]
> #   set oe-core/meta/classes/sstate.bbclass:11
> #     "${PACKAGE_ARCH}"
> #   set sstate.bbclass:98 [__anon_111__oe_core_meta_classes_sstate_bbclass]
> #     "allarch"
> # pre-expansion value:
> #   "allarch"
> SSTATE_PKGARCH="allarch"
>
> # $PACKAGE_ARCH [4 operations]
> #   set oe-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set oe-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set oe-core/meta/classes/allarch.bbclass:5
> #     "all"
> #   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> #     "${DUMMYARCH}"
> # pre-expansion value:
> #   "${DUMMYARCH}"
> PACKAGE_ARCH="sdk-provides-dummy-target"
>
>
> the relevant part of the anonymous python in sstate.bbclass:
>
>      elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
>          d.setVar('SSTATE_PKGARCH', "allarch")
>      else:
>          d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
>
> So with your change, the PACKAGE_ARCH isn't set to "all" because multilib is enabled,
> but that causes sstate.bbclass to set SSTATE_MANMACH to MACHINE instead of SSTATE_PKGARCH
> allarch, where it got MACHINE is still a bit of mystery to me.

The original story is that multilib packages such as lib32-curl depends 
on non-multilib package openssl that allarch package ca-certificates
is in the dependency chain:

lib32-curl -> ca-certificates -> openssl

I sent some versions of commits to Richard but he thought these 
solutions affect current non-multilib build too much. And Richard proposed
this solution which not affect current non-multilib build. When multilib 
is enabled/used, allarch packages are eliminated and treated as common
packages. The vars SSTATE_*  are set as the same as normal packages such 
as zlib.

Package target-sdk-provides-dummy is a little special that it sets its 
PACKAGE_ARCH in its own recipe. And affects vars which depends on 
PACKAGE_ARCH.

Regards,
Kai

>
> Cheers,
>
>>> Cheers,
>>>
>>>>>   python () {
>>>>>       # Allow this class to be included but overridden - only set
>>>>> diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
>>>>> index 0ca8de86c2..b5a8457747 100644
>>>>> --- a/meta/classes/icecc.bbclass
>>>>> +++ b/meta/classes/icecc.bbclass
>>>>> @@ -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 \
>>>>> diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
>>>>> index f2ac8bdfef..7b4d6472b0 100644
>>>>> --- a/meta/classes/multilib.bbclass
>>>>> +++ b/meta/classes/multilib.bbclass
>>>>> @@ -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
>>>>> diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
>>>>> index d2ec1adfea..1bb62427b0 100644
>>>>> --- a/meta/classes/multilib_global.bbclass
>>>>> +++ b/meta/classes/multilib_global.bbclass
>>>>> @@ -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
>>>>> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
>>>>> index 0b6f65a855..d1e9138c66 100644
>>>>> --- a/meta/classes/package.bbclass
>>>>> +++ b/meta/classes/package.bbclass
>>>>> @@ -494,7 +494,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]
>>>>>   
>>>>> @@ -1413,7 +1414,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')
>>>>> @@ -1502,7 +1504,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 variants \
>>>>> +        and not bb.data.inherits_class('packagegroup', d):
>>>>>           write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
>>>>>   
>>>>>   }
>>>>> -- 
>>>>> 2.18.0
>>>>>
>>>>> -- 
>>>>> _______________________________________________
>>>>> Openembedded-core mailing list
>>>>> Openembedded-core@lists.openembedded.org
>>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>>> -- 
>>>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>>>
>>>
>>> -- 
>>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>>
>>
>> -- 
>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>
>

-- 
Regards,
Neil | Kai Kang



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-17  2:25           ` Kang Kai
@ 2018-09-17  5:50             ` Martin Jansa
  2019-01-17 16:10             ` Dan Dedrick
  1 sibling, 0 replies; 20+ messages in thread
From: Martin Jansa @ 2018-09-17  5:50 UTC (permalink / raw)
  To: Kang Kai; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 14936 bytes --]

On Mon, Sep 17, 2018 at 10:25:38AM +0800, Kang Kai wrote:
> On 2018年09月14日 22:12, Martin Jansa wrote:
> > On Fri, Sep 14, 2018 at 01:25:12PM +0200, Martin Jansa wrote:
> >> On Thu, Sep 13, 2018 at 10:10:46PM +0200, Martin Jansa wrote:
> >>> On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> >>>> On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> >>>>> From: Kai Kang <kai.kang@windriver.com>
> >>>>>
> >>>>> 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 required.
> >>>>>
> >>>>> Only enable allarch when multilib is not used to fix the issue.
> >>>>>
> >>>>> signed-off-by: kai kang <kai.kang@windriver.com>
> >>>>> ---
> >>>>>   meta/classes/allarch.bbclass         | 12 +++++++++++-
> >>>>>   meta/classes/icecc.bbclass           |  2 +-
> >>>>>   meta/classes/multilib.bbclass        |  3 ++-
> >>>>>   meta/classes/multilib_global.bbclass |  4 +---
> >>>>>   meta/classes/package.bbclass         |  9 ++++++---
> >>>>>   5 files changed, 21 insertions(+), 9 deletions(-)
> >>>>>
> >>>>> diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> >>>>> index 1eebe0bf2e..45f62a5939 100644
> >>>>> --- a/meta/classes/allarch.bbclass
> >>>>> +++ b/meta/classes/allarch.bbclass
> >>>>> @@ -2,7 +2,17 @@
> >>>>>   # This class is used for architecture independent recipes/data files (usually scripts)
> >>>>>   #
> >>>>>   
> >>>>> -PACKAGE_ARCH = "all"
> >>>>> +python allarch_package_arch_handler () {
> >>>>> +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> >>>>> +        return
> >>>>> +
> >>>>> +    variants = d.getVar("MULTILIB_VARIANTS")
> >>>>> +    if not variants:
> >>>>> +        d.setVar("PACKAGE_ARCH", "all" )
> >>>>> +}
> >>>>> +
> >>>>> +addhandler allarch_package_arch_handler
> >>>>> +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
> >>>> Maybe I'm overlooking something, but doesn't this overwrite whatever
> >>>> PACKAGE_ARCH as set before this?
> >>>>
> >>>> I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
> >>>> another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
> >>>>
> >>>> # $PACKAGE_ARCH [5 operations]
> >>>> #   set oe-core/meta/conf/bitbake.conf:150
> >>>> #     [_defaultval] "${TUNE_PKGARCH}"
> >>>> #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set oe-core/meta/conf/documentation.conf:304
> >>>> #     [doc] "The architecture of the resulting package or packages."
> >>>> #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set allarch.bbclass:12 [allarch_package_arch_handler]
> >>>> #     "all"
> >>>> # pre-expansion value:
> >>>> #   "all"
> >>>> PACKAGE_ARCH="all"
> >>>>
> >>>> But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
> >>>>
> >>>> # $PACKAGE_ARCH [4 operations]
> >>>> #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> >>>> #     [_defaultval] "${TUNE_PKGARCH}"
> >>>> #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> >>>> #     [doc] "The architecture of the resulting package or packages."
> >>>> #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> >>>> #     "all"
> >>>> # pre-expansion value:
> >>>> #   "${MACHINE_ARCH}"
> >>>> PACKAGE_ARCH="qemux86_64"
> >>>>
> >>>> Why isn't allarch_package_arch_handler executed in the 2nd case?
> >>> Now I see the difference, I was still living in the days when
> >>> "disabling" allarch was possible just by setting PACKAGE_ARCH before
> >>> inheritting allarch, but now I see that packagegroups do conditional
> >>> inherit as well since:
> >>> http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
> >>> http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
> >>> so I'll modify currently failing recipes to do the same and stop
> >>> inheritting allarch when PACKAGE_ARCH is set to something else.
> >>  From public layers I've found with test-signatures script only
> >> fbset-nodes recipe in meta-oe which was setting PACKAGE_ARCH after
> >> allarch inherit, allarch removal sent here:
> >> http://lists.openembedded.org/pipermail/openembedded-devel/2018-September/120560.html
> > target-sdk-provides-dummy seems to be affected as well:
> >   === Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemux86copy ===
> > ERROR: lib32-target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
> > basehash changed from b0a44b2c7003b6b4aa3a023d9cb9fe82 to 3a59fa25ddb6a95aff079d477ebf3457
> > Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
> >
> > ERROR: target-sdk-provides-dummy different signature for task do_populate_sysroot.sigdata between qemux86 and qemux86copy
> > basehash changed from 9e44f1deb3d15886ee96db1a3332764c to 6b417d08a5113c9b06d13b3681f5ab4f
> > Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
> >
> >
> > It's using:
> > inherit allarch
> >
> > python() {
> >      # Put the package somewhere separate to ensure it's never used except
> >      # when we want it
> >      # (note that we have to do this in anonymous python here to avoid
> >      # allarch.bbclass disabling itself)
> >      d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
> > }
> >
> > and DUMMYARCH = "sdk-provides-dummy-target"
> >
> > The difference as shown with bitbake -e before and after reverting this commit:
> >
> > before revert:
> > # $SSTATE_MANMACH [2 operations]
> > #   set? oe-core/meta/classes/sstate.bbclass:61
> > #     "${SSTATE_PKGARCH}"
> > #   set sstate.bbclass:100 [__anon_111_oe_core_meta_classes_sstate_bbclass]
> > #     "machineName"
> > # pre-expansion value:
> > #   "machineName"
> > SSTATE_MANMACH="machineName"
> >
> > # $SSTATE_PKGARCH
> > #   set oe-core/meta/classes/sstate.bbclass:11
> > #     "${PACKAGE_ARCH}"
> > SSTATE_PKGARCH="sdk-provides-dummy-target"
> >
> > # $PACKAGE_ARCH [3 operations]
> > #   set oe-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set oe-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> > #     "${DUMMYARCH}"
> > # pre-expansion value:
> > #   "${DUMMYARCH}"
> > PACKAGE_ARCH="sdk-provides-dummy-target"
> >
> > after revert:
> > # $SSTATE_MANMACH
> > #   set? oe-core/meta/classes/sstate.bbclass:61
> > #     "${SSTATE_PKGARCH}"
> > SSTATE_MANMACH="allarch"
> >
> > # $SSTATE_PKGARCH [2 operations]
> > #   set oe-core/meta/classes/sstate.bbclass:11
> > #     "${PACKAGE_ARCH}"
> > #   set sstate.bbclass:98 [__anon_111__oe_core_meta_classes_sstate_bbclass]
> > #     "allarch"
> > # pre-expansion value:
> > #   "allarch"
> > SSTATE_PKGARCH="allarch"
> >
> > # $PACKAGE_ARCH [4 operations]
> > #   set oe-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set oe-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set oe-core/meta/classes/allarch.bbclass:5
> > #     "all"
> > #   set dummy-sdk-package.inc:12 [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> > #     "${DUMMYARCH}"
> > # pre-expansion value:
> > #   "${DUMMYARCH}"
> > PACKAGE_ARCH="sdk-provides-dummy-target"
> >
> >
> > the relevant part of the anonymous python in sstate.bbclass:
> >
> >      elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
> >          d.setVar('SSTATE_PKGARCH', "allarch")
> >      else:
> >          d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
> >
> > So with your change, the PACKAGE_ARCH isn't set to "all" because multilib is enabled,
> > but that causes sstate.bbclass to set SSTATE_MANMACH to MACHINE instead of SSTATE_PKGARCH
> > allarch, where it got MACHINE is still a bit of mystery to me.
> 
> The original story is that multilib packages such as lib32-curl depends 
> on non-multilib package openssl that allarch package ca-certificates
> is in the dependency chain:
> 
> lib32-curl -> ca-certificates -> openssl
> 
> I sent some versions of commits to Richard but he thought these 
> solutions affect current non-multilib build too much. And Richard proposed
> this solution which not affect current non-multilib build. When multilib 
> is enabled/used, allarch packages are eliminated and treated as common
> packages. The vars SSTATE_*  are set as the same as normal packages such 
> as zlib.
> 
> Package target-sdk-provides-dummy is a little special that it sets its 
> PACKAGE_ARCH in its own recipe. And affects vars which depends on 
> PACKAGE_ARCH.

I've sent possible work around:
http://lists.openembedded.org/pipermail/openembedded-core/2018-September/155743.html

> 
> Regards,
> Kai
> 
> >
> > Cheers,
> >
> >>> Cheers,
> >>>
> >>>>>   python () {
> >>>>>       # Allow this class to be included but overridden - only set
> >>>>> diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> >>>>> index 0ca8de86c2..b5a8457747 100644
> >>>>> --- a/meta/classes/icecc.bbclass
> >>>>> +++ b/meta/classes/icecc.bbclass
> >>>>> @@ -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 \
> >>>>> diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> >>>>> index f2ac8bdfef..7b4d6472b0 100644
> >>>>> --- a/meta/classes/multilib.bbclass
> >>>>> +++ b/meta/classes/multilib.bbclass
> >>>>> @@ -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
> >>>>> diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> >>>>> index d2ec1adfea..1bb62427b0 100644
> >>>>> --- a/meta/classes/multilib_global.bbclass
> >>>>> +++ b/meta/classes/multilib_global.bbclass
> >>>>> @@ -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
> >>>>> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> >>>>> index 0b6f65a855..d1e9138c66 100644
> >>>>> --- a/meta/classes/package.bbclass
> >>>>> +++ b/meta/classes/package.bbclass
> >>>>> @@ -494,7 +494,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]
> >>>>>   
> >>>>> @@ -1413,7 +1414,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')
> >>>>> @@ -1502,7 +1504,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 variants \
> >>>>> +        and not bb.data.inherits_class('packagegroup', d):
> >>>>>           write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
> >>>>>   
> >>>>>   }
> >>>>> -- 
> >>>>> 2.18.0
> >>>>>
> >>>>> -- 
> >>>>> _______________________________________________
> >>>>> Openembedded-core mailing list
> >>>>> Openembedded-core@lists.openembedded.org
> >>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >>>> -- 
> >>>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >>>
> >>>
> >>> -- 
> >>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >>
> >>
> >> -- 
> >> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >
> >
> 
> -- 
> Regards,
> Neil | Kai Kang
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2018-09-17  2:25           ` Kang Kai
  2018-09-17  5:50             ` Martin Jansa
@ 2019-01-17 16:10             ` Dan Dedrick
  2019-01-17 22:19               ` Richard Purdie
  1 sibling, 1 reply; 20+ messages in thread
From: Dan Dedrick @ 2019-01-17 16:10 UTC (permalink / raw)
  To: Kang Kai; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 17410 bytes --]

I'm resurrecting this thread because this change negatively affects our use
of multilib. The use case that this is fixing seems to be a a case that
would be a better fit for multiconfig than it would multilib. My
interpretation of the use cases of multilib and multiconfig is as follows
and someone can correct me if this is wrong.

Multilib allows images to be built that support multiple architectures on
the same image. Specifically this use case is interesting for cases where
some library or tool has to be 32-bit (for whatever reason might apply) but
the rest of the image is 64-bit. For example we have a 32-bit library from
a third party vendor and that vendor won't provide us with a 64-bit
version. So we want the majority of our system to be 64-bit but need
multilib to support the subset of our image that needs to be 32-bit. The
result is that some portion of our image has to be 32-bit but whenever
possible we'd like to be using the 64-bit packages to reduce duplicating
packages between 32 and 64 bit.

Multiconfig allows for multiple configs and seems well suited to cases
where there are separate images for each config. So you could have a 32-bit
image from one config and a 64-bit image from another config. If no image
cross-contamination is required, as seems to be the intent of the request
here, then multiconfig can ensure that while not reducing the usefulness of
allarch. The original scenario seemed to follow this pattern where there is
a lib32-core-image-sato and a core-image-sato.

In our multilib case we want the behavior from before this change. So in
the specific use case of 'lib32-curl -> ca-certificate -> openssl' we
actually want this. The reason behind this being the desired behavior is
that the main architecture would certainly already require openssl so
adding the 32-bit version would cause duplication and therefore increase
our images size unnecessarily. In the past we had actually found that
installing some duplicate things that overlapped like "/usr/bin/openssl"
would cause racey behavior where sometimes we got the 32-bit version and
others we got the 64-bit version.

Additionally the removal of allarch from all multilib builds also seem like
a poor choice as multilib builds now lose all of the benefits that are
generally available from allarch.

On Sun, Sep 16, 2018 at 10:27 PM Kang Kai <Kai.Kang@windriver.com> wrote:

> On 2018年09月14日 22:12, Martin Jansa wrote:
> > On Fri, Sep 14, 2018 at 01:25:12PM +0200, Martin Jansa wrote:
> >> On Thu, Sep 13, 2018 at 10:10:46PM +0200, Martin Jansa wrote:
> >>> On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> >>>> On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com
> wrote:
> >>>>> From: Kai Kang <kai.kang@windriver.com>
> >>>>>
> >>>>> 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 required.
> >>>>>
> >>>>> Only enable allarch when multilib is not used to fix the issue.
> >>>>>
> >>>>> signed-off-by: kai kang <kai.kang@windriver.com>
> >>>>> ---
> >>>>>   meta/classes/allarch.bbclass         | 12 +++++++++++-
> >>>>>   meta/classes/icecc.bbclass           |  2 +-
> >>>>>   meta/classes/multilib.bbclass        |  3 ++-
> >>>>>   meta/classes/multilib_global.bbclass |  4 +---
> >>>>>   meta/classes/package.bbclass         |  9 ++++++---
> >>>>>   5 files changed, 21 insertions(+), 9 deletions(-)
> >>>>>
> >>>>> diff --git a/meta/classes/allarch.bbclass
> b/meta/classes/allarch.bbclass
> >>>>> index 1eebe0bf2e..45f62a5939 100644
> >>>>> --- a/meta/classes/allarch.bbclass
> >>>>> +++ b/meta/classes/allarch.bbclass
> >>>>> @@ -2,7 +2,17 @@
> >>>>>   # This class is used for architecture independent recipes/data
> files (usually scripts)
> >>>>>   #
> >>>>>
> >>>>> -PACKAGE_ARCH = "all"
> >>>>> +python allarch_package_arch_handler () {
> >>>>> +    if bb.data.inherits_class("nativesdk", d) or
> bb.data.inherits_class("crosssdk", d):
> >>>>> +        return
> >>>>> +
> >>>>> +    variants = d.getVar("MULTILIB_VARIANTS")
> >>>>> +    if not variants:
> >>>>> +        d.setVar("PACKAGE_ARCH", "all" )
> >>>>> +}
> >>>>> +
> >>>>> +addhandler allarch_package_arch_handler
> >>>>> +allarch_package_arch_handler[eventmask] =
> "bb.event.RecipePreFinalise"
> >>>> Maybe I'm overlooking something, but doesn't this overwrite whatever
> >>>> PACKAGE_ARCH as set before this?
> >>>>
> >>>> I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH
> through
> >>>> another bbclass, but then overwritten with "all" by
> allarch_package_arch_handler:
> >>>>
> >>>> # $PACKAGE_ARCH [5 operations]
> >>>> #   set oe-core/meta/conf/bitbake.conf:150
> >>>> #     [_defaultval] "${TUNE_PKGARCH}"
> >>>> #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set oe-core/meta/conf/documentation.conf:304
> >>>> #     [doc] "The architecture of the resulting package or packages."
> >>>> #   set
> meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set allarch.bbclass:12 [allarch_package_arch_handler]
> >>>> #     "all"
> >>>> # pre-expansion value:
> >>>> #   "all"
> >>>> PACKAGE_ARCH="all"
> >>>>
> >>>> But surprisingly if I do the same with e.g. packagegroup-core-boot in
> oe-core I get:
> >>>>
> >>>> # $PACKAGE_ARCH [4 operations]
> >>>> #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> >>>> #     [_defaultval] "${TUNE_PKGARCH}"
> >>>> #   set
> /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> >>>> #     [doc] "The architecture of the resulting package or packages."
> >>>> #   set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/
> packagegroup-core-boot.bb:9
> >>>> #     "${MACHINE_ARCH}"
> >>>> #   set?
> /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> >>>> #     "all"
> >>>> # pre-expansion value:
> >>>> #   "${MACHINE_ARCH}"
> >>>> PACKAGE_ARCH="qemux86_64"
> >>>>
> >>>> Why isn't allarch_package_arch_handler executed in the 2nd case?
> >>> Now I see the difference, I was still living in the days when
> >>> "disabling" allarch was possible just by setting PACKAGE_ARCH before
> >>> inheritting allarch, but now I see that packagegroups do conditional
> >>> inherit as well since:
> >>>
> http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
> >>>
> http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
> >>> so I'll modify currently failing recipes to do the same and stop
> >>> inheritting allarch when PACKAGE_ARCH is set to something else.
> >>  From public layers I've found with test-signatures script only
> >> fbset-nodes recipe in meta-oe which was setting PACKAGE_ARCH after
> >> allarch inherit, allarch removal sent here:
> >>
> http://lists.openembedded.org/pipermail/openembedded-devel/2018-September/120560.html
> > target-sdk-provides-dummy seems to be affected as well:
> >   === Comparing signatures for task do_populate_sysroot.sigdata between
> qemux86 and qemux86copy ===
> > ERROR: lib32-target-sdk-provides-dummy different signature for task
> do_populate_sysroot.sigdata between qemux86 and qemux86copy
> > basehash changed from b0a44b2c7003b6b4aa3a023d9cb9fe82 to
> 3a59fa25ddb6a95aff079d477ebf3457
> > Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
> >
> > ERROR: target-sdk-provides-dummy different signature for task
> do_populate_sysroot.sigdata between qemux86 and qemux86copy
> > basehash changed from 9e44f1deb3d15886ee96db1a3332764c to
> 6b417d08a5113c9b06d13b3681f5ab4f
> > Variable SSTATE_MANMACH value changed from 'qemux86' to 'qemux86copy'
> >
> >
> > It's using:
> > inherit allarch
> >
> > python() {
> >      # Put the package somewhere separate to ensure it's never used
> except
> >      # when we want it
> >      # (note that we have to do this in anonymous python here to avoid
> >      # allarch.bbclass disabling itself)
> >      d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
> > }
> >
> > and DUMMYARCH = "sdk-provides-dummy-target"
> >
> > The difference as shown with bitbake -e before and after reverting this
> commit:
> >
> > before revert:
> > # $SSTATE_MANMACH [2 operations]
> > #   set? oe-core/meta/classes/sstate.bbclass:61
> > #     "${SSTATE_PKGARCH}"
> > #   set sstate.bbclass:100
> [__anon_111_oe_core_meta_classes_sstate_bbclass]
> > #     "machineName"
> > # pre-expansion value:
> > #   "machineName"
> > SSTATE_MANMACH="machineName"
> >
> > # $SSTATE_PKGARCH
> > #   set oe-core/meta/classes/sstate.bbclass:11
> > #     "${PACKAGE_ARCH}"
> > SSTATE_PKGARCH="sdk-provides-dummy-target"
> >
> > # $PACKAGE_ARCH [3 operations]
> > #   set oe-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set oe-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set dummy-sdk-package.inc:12
> [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> > #     "${DUMMYARCH}"
> > # pre-expansion value:
> > #   "${DUMMYARCH}"
> > PACKAGE_ARCH="sdk-provides-dummy-target"
> >
> > after revert:
> > # $SSTATE_MANMACH
> > #   set? oe-core/meta/classes/sstate.bbclass:61
> > #     "${SSTATE_PKGARCH}"
> > SSTATE_MANMACH="allarch"
> >
> > # $SSTATE_PKGARCH [2 operations]
> > #   set oe-core/meta/classes/sstate.bbclass:11
> > #     "${PACKAGE_ARCH}"
> > #   set sstate.bbclass:98
> [__anon_111__oe_core_meta_classes_sstate_bbclass]
> > #     "allarch"
> > # pre-expansion value:
> > #   "allarch"
> > SSTATE_PKGARCH="allarch"
> >
> > # $PACKAGE_ARCH [4 operations]
> > #   set oe-core/meta/conf/bitbake.conf:150
> > #     [_defaultval] "${TUNE_PKGARCH}"
> > #   set oe-core/meta/conf/documentation.conf:304
> > #     [doc] "The architecture of the resulting package or packages."
> > #   set oe-core/meta/classes/allarch.bbclass:5
> > #     "all"
> > #   set dummy-sdk-package.inc:12
> [__anon_12_oe_core_meta_recipes_core_meta_dummy_sdk_package_inc]
> > #     "${DUMMYARCH}"
> > # pre-expansion value:
> > #   "${DUMMYARCH}"
> > PACKAGE_ARCH="sdk-provides-dummy-target"
> >
> >
> > the relevant part of the anonymous python in sstate.bbclass:
> >
> >      elif bb.data.inherits_class('allarch', d) and
> d.getVar("PACKAGE_ARCH") == "all":
> >          d.setVar('SSTATE_PKGARCH', "allarch")
> >      else:
> >          d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
> >
> > So with your change, the PACKAGE_ARCH isn't set to "all" because
> multilib is enabled,
> > but that causes sstate.bbclass to set SSTATE_MANMACH to MACHINE instead
> of SSTATE_PKGARCH
> > allarch, where it got MACHINE is still a bit of mystery to me.
>
> The original story is that multilib packages such as lib32-curl depends
> on non-multilib package openssl that allarch package ca-certificates
> is in the dependency chain:
>
> lib32-curl -> ca-certificates -> openssl
>
> I sent some versions of commits to Richard but he thought these
> solutions affect current non-multilib build too much. And Richard proposed
> this solution which not affect current non-multilib build. When multilib
> is enabled/used, allarch packages are eliminated and treated as common
> packages. The vars SSTATE_*  are set as the same as normal packages such
> as zlib.
>
> Package target-sdk-provides-dummy is a little special that it sets its
> PACKAGE_ARCH in its own recipe. And affects vars which depends on
> PACKAGE_ARCH.
>
> Regards,
> Kai
>
> >
> > Cheers,
> >
> >>> Cheers,
> >>>
> >>>>>   python () {
> >>>>>       # Allow this class to be included but overridden - only set
> >>>>> diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> >>>>> index 0ca8de86c2..b5a8457747 100644
> >>>>> --- a/meta/classes/icecc.bbclass
> >>>>> +++ b/meta/classes/icecc.bbclass
> >>>>> @@ -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 \
> >>>>> diff --git a/meta/classes/multilib.bbclass
> b/meta/classes/multilib.bbclass
> >>>>> index f2ac8bdfef..7b4d6472b0 100644
> >>>>> --- a/meta/classes/multilib.bbclass
> >>>>> +++ b/meta/classes/multilib.bbclass
> >>>>> @@ -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
> >>>>> diff --git a/meta/classes/multilib_global.bbclass
> b/meta/classes/multilib_global.bbclass
> >>>>> index d2ec1adfea..1bb62427b0 100644
> >>>>> --- a/meta/classes/multilib_global.bbclass
> >>>>> +++ b/meta/classes/multilib_global.bbclass
> >>>>> @@ -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
> >>>>> diff --git a/meta/classes/package.bbclass
> b/meta/classes/package.bbclass
> >>>>> index 0b6f65a855..d1e9138c66 100644
> >>>>> --- a/meta/classes/package.bbclass
> >>>>> +++ b/meta/classes/package.bbclass
> >>>>> @@ -494,7 +494,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]
> >>>>>
> >>>>> @@ -1413,7 +1414,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')
> >>>>> @@ -1502,7 +1504,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 variants \
> >>>>> +        and not bb.data.inherits_class('packagegroup', d):
> >>>>>           write_extra_runtime_pkgs(global_variants, packages,
> pkgdatadir)
> >>>>>
> >>>>>   }
> >>>>> --
> >>>>> 2.18.0
> >>>>>
> >>>>> --
> >>>>> _______________________________________________
> >>>>> Openembedded-core mailing list
> >>>>> Openembedded-core@lists.openembedded.org
> >>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >>>> --
> >>>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >>>
> >>>
> >>> --
> >>> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >>
> >>
> >> --
> >> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >
> >
>
> --
> Regards,
> Neil | Kai Kang
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 23897 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
  2019-01-17 16:10             ` Dan Dedrick
@ 2019-01-17 22:19               ` Richard Purdie
  0 siblings, 0 replies; 20+ messages in thread
From: Richard Purdie @ 2019-01-17 22:19 UTC (permalink / raw)
  To: Dan Dedrick, Kang Kai; +Cc: openembedded-core

On Thu, 2019-01-17 at 11:10 -0500, Dan Dedrick wrote:
> I'm resurrecting this thread because this change negatively affects
> our use of multilib. The use case that this is fixing seems to be a a
> case that would be a better fit for multiconfig than it would
> multilib. My interpretation of the use cases of multilib and
> multiconfig is as follows and someone can correct me if this is
> wrong.

I think the problem here is there is no correct answer which will work
for everyone.

People don't expect that it would build openssl if you build lib32-curl 
and you could certainly get systems where only lib32-openssl was used
or desired.

I don't think its related to multiconfig, its just that people have
different expectations of multilib.

> Multilib allows images to be built that support multiple
> architectures on the same image. Specifically this use case is
> interesting for cases where some library or tool has to be 32-bit
> (for whatever reason might apply) but the rest of the image is 64-
> bit. For example we have a 32-bit library from a third party vendor
> and that vendor won't provide us with a 64-bit version. So we want
> the majority of our system to be 64-bit but need multilib to support
> the subset of our image that needs to be 32-bit. The result is that
> some portion of our image has to be 32-bit but whenever possible we'd
> like to be using the 64-bit packages to reduce duplicating packages
> between 32 and 64 bit.

For your usecase I can see the justification. The fact remains we had
users complaining about this behaviour too though.

> Multiconfig allows for multiple configs and seems well suited to
> cases where there are separate images for each config. So you could
> have a 32-bit image from one config and a 64-bit image from another
> config. If no image cross-contamination is required, as seems to be
> the intent of the request here, then multiconfig can ensure that
> while not reducing the usefulness of allarch. The original scenario
> seemed to follow this pattern where there is a lib32-core-image-sato
> and a core-image-sato.
> 
> In our multilib case we want the behavior from before this change. So
> in the specific use case of 'lib32-curl -> ca-certificate -> openssl'
> we actually want this. The reason behind this being the desired
> behavior is that the main architecture would certainly already
> require openssl so adding the 32-bit version would cause duplication
> and therefore increase our images size unnecessarily. In the past we
> had actually found that installing some duplicate things that
> overlapped like "/usr/bin/openssl" would cause racey behavior where
> sometimes we got the 32-bit version and others we got the 64-bit
> version.
> 
> Additionally the removal of allarch from all multilib builds also
> seem like a poor choice as multilib builds now lose all of the
> benefits that are generally available from allarch.

I never liked that side of this either, however, generically fixing the
problems reported was effectively "impossible" any other way as far as
I could see.

For your use case it should be possible to "coerce" the lib32-X allarch
recipes to prefer the "normal" architecture and get the old behaviour
back? The main cost would be buildtime of two sets of allarch recipes
but that in the scheme of things should be small...

Its a difficult situation which I can see both sides of.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-01-17 22:19 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
2018-09-13 18:20   ` Martin Jansa
2018-09-13 20:10     ` Martin Jansa
2018-09-14 11:25       ` Martin Jansa
2018-09-14 14:12         ` Martin Jansa
2018-09-17  2:25           ` Kang Kai
2018-09-17  5:50             ` Martin Jansa
2019-01-17 16:10             ` Dan Dedrick
2019-01-17 22:19               ` Richard Purdie
2018-09-06 15:52 ` [PATCH 2/7] sstate.bbclass: update SSTATE_DUPWHITELIST kai.kang
2018-09-06 15:52 ` [PATCH 3/7] update_font_cache: update script for multilib kai.kang
2018-09-06 15:52 ` [PATCH 4/7] update_gtk_immodules_cache: update " kai.kang
2018-09-06 15:52 ` [PATCH 5/7] statetests.py: drop test_sstate_allarch_samesigs_multilib kai.kang
2018-09-06 15:52 ` [PATCH 6/7] multilib: fix install file conflicts kai.kang
2018-09-06 22:31   ` richard.purdie
2018-09-07  1:22     ` Kang Kai
2018-09-06 15:52 ` [PATCH 7/7] target-sdk-provides-dummy: skip package_qa_multilib check kai.kang
2018-09-06 17:04 ` ✗ patchtest: failure for disable allarch when multilib is used Patchwork
2018-09-07  8:32 ` [PATCH v5 0/7] " richard.purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.