Skip to contentSkip to conversation

allarch: disable allarch when multilib is used

PATCH Superseded Kai Kang 3 participants 17 messages Aug 26, 2018 – Sep 5, 2018

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

v4 cover allarch: disable allarch when multilib is used

V4:
* rebase on origin/master-next
* update postinstall script update_gtk_immodules_cache

V3:
* drop commit "cmake.bbclass: fix wrong toolchain flags of nativesdk package" which causes some oe-selftest cases fail
* update postinstall script update_font_cache
* drop oe-selftest case test_sstate_allarch_samesigs_multilib
* fix some install file conflicts

The following changes since commit ec8f8ba112abe2d57b91a00d0c9d6c9a597f83a0:

cmake: add CMAKE_SYSROOT to generated toolchain file (2018-08-24 16:01:59 +0100)

are available in the git repository at:

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

Kai Kang (6):
allarch: disable allarch when multilib is 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

 meta/classes/allarch-enabled.bbclass               | 52 ++++++++++++++++++++++
 meta/classes/allarch.bbclass                       | 51 +--------------------
 meta/classes/icecc.bbclass                         |  2 +-
 meta/classes/multilib.bbclass                      |  2 +-
 meta/classes/multilib_global.bbclass               |  2 +-
 meta/classes/package.bbclass                       |  6 +--
 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 ++-
 .../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, 104 insertions(+), 79 deletions(-)
 create mode 100644 meta/classes/allarch-enabled.bbclass
Signature · 1 line
2.11.0
author
#1 lore raw

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

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.

Copy allarch.bbclass to allarch-enabled.bbclass and only inherit allarch-enabled.bbclass when multilib is not used.

---
 meta/classes/allarch-enabled.bbclass | 52 ++++++++++++++++++++++++++++++++++++
 meta/classes/allarch.bbclass         | 51 ++---------------------------------
 meta/classes/icecc.bbclass           |  2 +-
 meta/classes/multilib.bbclass        |  2 +-
 meta/classes/multilib_global.bbclass |  2 +-
 meta/classes/package.bbclass         |  6 ++---
 6 files changed, 60 insertions(+), 55 deletions(-)
 create mode 100644 meta/classes/allarch-enabled.bbclass
meta/classes/allarch-enabled.bbclass new file +52 -0
new file mode 100644
index 00000000000..1eebe0bf2e7
@@ -0,0 +1,52 @@
+#
+# This class is used for architecture independent recipes/data files (usually scripts)
+#
+
+PACKAGE_ARCH = "all"
+
+python () {
+    # Allow this class to be included but overridden - only set
+    # the values if we're still "all" package arch.
+    if d.getVar("PACKAGE_ARCH") == "all":
+        # No need for virtual/libc or a cross compiler
+        d.setVar("INHIBIT_DEFAULT_DEPS","1")
+
+        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
+        # naming anyway
+        d.setVar("baselib", "lib")
+        d.setVar("TARGET_ARCH", "allarch")
+        d.setVar("TARGET_OS", "linux")
+        d.setVar("TARGET_CC_ARCH", "none")
+        d.setVar("TARGET_LD_ARCH", "none")
+        d.setVar("TARGET_AS_ARCH", "none")
+        d.setVar("TARGET_FPU", "")
+        d.setVar("TARGET_PREFIX", "")
+        # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
+        # (this removes any dependencies from the hash perspective)
+        d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
+        d.setVar("SDK_ARCH", "none")
+        d.setVar("SDK_CC_ARCH", "none")
+        d.setVar("TARGET_CPPFLAGS", "none")
+        d.setVar("TARGET_CFLAGS", "none")
+        d.setVar("TARGET_CXXFLAGS", "none")
+        d.setVar("TARGET_LDFLAGS", "none")
+        d.setVar("POPULATESYSROOTDEPS", "")
+
+        # Avoid this being unnecessarily different due to nuances of
+        # the target machine that aren't important for "all" arch
+        # packages.
+        d.setVar("LDFLAGS", "")
+
+        # No need to do shared library processing or debug symbol handling
+        d.setVar("EXCLUDE_FROM_SHLIBS", "1")
+        d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
+        d.setVar("INHIBIT_PACKAGE_STRIP", "1")
+
+        # These multilib values shouldn't change allarch packages so exclude them
+        d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
+        d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
+        d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
+    elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
+        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
+}
+
meta/classes/allarch.bbclass +2 -49

54 lines not on this page · raw message

meta/classes/icecc.bbclass +1 -1
index 0ca8de86c24..bb925b8d244 100644
@@ -171,7 +171,7 @@ def use_icecc(bb,d):
     return "yes"
 
 def icecc_is_allarch(bb, d):
-    return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch', d)
+    return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch-enabled', d)
 
 def icecc_is_kernel(bb, d):
     return \
meta/classes/multilib.bbclass +1 -1
index f2ac8bdfef0..c576cd8b403 100644
@@ -50,7 +50,7 @@ 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-enabled', e.data) and not bb.data.inherits_class('packagegroup', e.data):
         raise bb.parse.SkipRecipe("Don't extend allarch recipes which are not packagegroups")
 
     # Expand this since this won't work correctly once we set a multilib into place
meta/classes/multilib_global.bbclass +1 -1
index d2ec1adfea6..4e2b6718dfa 100644
@@ -166,7 +166,7 @@ python multilib_virtclass_handler_global () {
 
     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\
+            (bb.data.inherits_class('allarch-enabled', e.data) and\
              not bb.data.inherits_class('packagegroup', e.data)):
             variants = (e.data.getVar("MULTILIB_VARIANTS") or "").split()
 
meta/classes/package.bbclass +3 -3
index 9cfe43cbd14..d48336d0084 100644
@@ -494,7 +494,7 @@ 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-enabled', d) and data[key] == basepkg:
             return pkg
         return data[key]
 
@@ -1409,7 +1409,7 @@ 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-enabled', d) and not bb.data.inherits_class('packagegroup', d)):
         write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
 
     workdir = d.getVar('WORKDIR')
@@ -1498,7 +1498,7 @@ 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-enabled', d) and not bb.data.inherits_class('packagegroup', d):
         write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
 
 }
Signature · 1 line
2.11.0
author
#6 lore raw

PATCH v4 2/6 sstate.bbclass: update SSTATE_DUPWHITELIST

In reply to Kai Kang

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

---
 meta/classes/sstate.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/sstate.bbclass +3 -1
index ecf08fb2d02..efb0096c709 100644
@@ -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
Signature · 1 line
2.11.0
author
#7 lore raw

PATCH v4 3/6 update_font_cache: update script for multilib

In reply to Kai Kang

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.

---
 meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb | 8 +++++++-
 scripts/postinst-intercepts/update_font_cache         | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +7 -1
index d4cbce80b45..db36c867741 100644
@@ -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}
+    cp ${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"
scripts/postinst-intercepts/update_font_cache +1 -1
index 20e9048adfc..e0ec471964c 100644
@@ -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}
Signature · 1 line
2.11.0
author
#10 lore raw

PATCH v4 4/6 update_gtk_immodules_cache: update for multilib

In reply to Kai Kang

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.

---
 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(-)
meta/recipes-gnome/gtk+/gtk+.inc +4 -0
index 558bc485adc..b8f0abb49e1 100644
@@ -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}
+    cp ${D}${bindir}/gtk-query-immodules-2.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-2.0
 }
 
 SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess"
meta/recipes-gnome/gtk+/gtk+3.inc +4 -0
index 420ead2ca2e..d8242ad5fc0 100644
@@ -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}
+    cp ${D}${bindir}/gtk-query-immodules-3.0 ${D}${libexecdir}/${MLPREFIX}gtk-query-immodules-3.0
 }
 
 PACKAGES =+ "${PN}-demo"
scripts/postinst-intercepts/update_gtk_immodules_cache +4 -4
index d85d3622c21..395516971e9 100644
@@ -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
Signature · 1 line
2.11.0
author
#11 lore raw

PATCH v4 5/6 statetests.py: drop test_sstate_allarch_samesigs_multilib

In reply to Kai Kang

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.

---
 meta/lib/oeqa/selftest/cases/sstatetests.py | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
meta/lib/oeqa/selftest/cases/sstatetests.py +2 -9
index 7b008e409f4..7194225c0a6 100644
@@ -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])
 
Signature · 1 line
2.11.0
author
#12 lore raw

PATCH v4 6/6 multilib: fix install file conflicts

In reply to Kai Kang

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
---
 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(-)
meta/recipes-core/udev/eudev_3.2.5.bb +4 -2
index 75617c8d4ec..75130f03efd 100644
@@ -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"
meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb +4 -2
index f3479565ea7..887ff580497 100644
@@ -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
meta/recipes-graphics/cairo/cairo_1.14.12.bb +4 -2
index a902c268798..18b947948a3 100644
@@ -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"
meta/recipes-support/icu/icu.inc +3 -1
index f0786baa03e..e20085fbf52 100644
@@ -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
meta/recipes-support/libgpg-error/libgpg-error_1.32.bb +4 -1
index 098242ea105..a4c720be9d8 100644
@@ -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
Signature · 1 line
2.11.0
#15 lore raw

✗ patchtest: failure for allarch: disable allarch when multilib is used (rev4)

In reply to Kai Kang

== Series Details ==

Series: allarch: disable allarch when multilib is used (rev4)
Revision: 4
URL : https://patchwork.openembedded.org/series/13457/
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:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 0791c4d39e)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) 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
author
#16 lore raw

Re: ✗ patchtest: failure for allarch: disable allarch when multilib is used (rev4)

Quoted 16 lines · Patchwork

== Series Details ==

Series: allarch: disable allarch when multilib is used (rev4)
Revision: 4
URL : https://patchwork.openembedded.org/series/13457/
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:

Quoted 3 lines
* Issue             Series does not apply on top of target branch [test_series_merge_on_head]
   Suggested fix    Rebase your series on top of targeted branch
   Targeted branch  master (currently at 0791c4d39e)

There is commit
3fc8eb641c4468bbdb156a796373d8ad61b8247e: cairo: merge cairo.inc into cairo recipe
in branch master-next. And my commit "multilib: fix install file conflicts" also modifies cairo recipe, so I rebase on origin/master-next.

Regards,
Kai

Quoted 16 lines

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) 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
Signature · 2 lines
Regards,
Neil | Kai Kang
#2 lore raw
In reply to Kai Kang

Hi,

I think this is close and it passes the tests on the autobuilder however I did spot a couple of potential issues after thinking about this for a bit.

Quoted 76 lines · Kai Kang

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.

Copy allarch.bbclass to allarch-enabled.bbclass and only inherit allarch-enabled.bbclass when multilib is not used.

---
 meta/classes/allarch-enabled.bbclass | 52 ++++++++++++++++++++++++++++++++++++
 meta/classes/allarch.bbclass         | 51 ++---------------------------------
 meta/classes/icecc.bbclass           |  2 +-
 meta/classes/multilib.bbclass        |  2 +-
 meta/classes/multilib_global.bbclass |  2 +-
 meta/classes/package.bbclass         |  6 ++---
 6 files changed, 60 insertions(+), 55 deletions(-)
 create mode 100644 meta/classes/allarch-enabled.bbclass
meta/classes/allarch.bbclass +1 -40
index 1eebe0bf2e7..0eca076df0b 100644
@@ -1,52 +1,5 @@
 #
-# This class is used for architecture independent recipes/data files (usually scripts)
+# This class enables allarch only when multilib is not used.
 #
 
-PACKAGE_ARCH = "all"
-
-python () {
-    # Allow this class to be included but overridden - only set
-    # the values if we're still "all" package arch.
-    if d.getVar("PACKAGE_ARCH") == "all":
-        # No need for virtual/libc or a cross compiler
-        d.setVar("INHIBIT_DEFAULT_DEPS","1")
-
-        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
-        # naming anyway
-        d.setVar("baselib", "lib")
-        d.setVar("TARGET_ARCH", "allarch")
-        d.setVar("TARGET_OS", "linux")
-        d.setVar("TARGET_CC_ARCH", "none")
-        d.setVar("TARGET_LD_ARCH", "none")
-        d.setVar("TARGET_AS_ARCH", "none")
-        d.setVar("TARGET_FPU", "")
-        d.setVar("TARGET_PREFIX", "")
-        # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
-        # (this removes any dependencies from the hash perspective)
-        d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
-        d.setVar("SDK_ARCH", "none")
-        d.setVar("SDK_CC_ARCH", "none")
-        d.setVar("TARGET_CPPFLAGS", "none")
-        d.setVar("TARGET_CFLAGS", "none")
-        d.setVar("TARGET_CXXFLAGS", "none")
-        d.setVar("TARGET_LDFLAGS", "none")
-        d.setVar("POPULATESYSROOTDEPS", "")
-
-        # Avoid this being unnecessarily different due to nuances of
-        # the target machine that aren't important for "all" arch
-        # packages.
-        d.setVar("LDFLAGS", "")
-
-        # No need to do shared library processing or debug symbol handling
-        d.setVar("EXCLUDE_FROM_SHLIBS", "1")
-        d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
-        d.setVar("INHIBIT_PACKAGE_STRIP", "1")

meta/classes/allarch.bbclass line 5

Quoted 10 lines
meta/classes/allarch.bbclass +1 -9
-
-        # These multilib values shouldn't change allarch packages so exclude them
-        d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
-        d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
-        d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
-    elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
-        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
-}
-
+inherit ${@oe.utils.ifelse(d.getVar('MULTILIB_VARIANTS'), '', 'allarch-enabled')}

Firstly, whilst I do understand why you've made this change like this, I don't really like one line classes which clutter up the classes directory. Using inherit like this does force the expansion of the variable early and is very prone to "race" conditions. The above is safe but see below.

FWIW the original code tried to switch off the value of the PACKAGE_ARCH variable. If we change the way we enable/disable the code, we should consider whether we can consistently use one mechanism for both.

Secondly, does this change affect the behaviour of nativesdk?

I think this will disable allarch for nativesdk in any multilib build and we don't want to do that, we only have a problem with target multilib allarch.

At a guess you probably need to check class-target is in overrides and multilib_variants is set? The problem could be that class-target is set comparatively late and then we're into ordering issues.

I do want to get the nativesdk issue fixed before we merge this though.

Cheers,

Richard

author
#3 lore raw
Quoted 99 lines · On 2018年09月04日 16:36, [email protected] wrote:

Hi,

I think this is close and it passes the tests on the autobuilder however I did spot a couple of potential issues after thinking about this for a bit.

Quoted 76 lines · Kai Kang

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.

Copy allarch.bbclass to allarch-enabled.bbclass and only inherit allarch-enabled.bbclass when multilib is not used.

---
  meta/classes/allarch-enabled.bbclass | 52 ++++++++++++++++++++++++++++++++++++
  meta/classes/allarch.bbclass         | 51 ++---------------------------------
  meta/classes/icecc.bbclass           |  2 +-
  meta/classes/multilib.bbclass        |  2 +-
  meta/classes/multilib_global.bbclass |  2 +-
  meta/classes/package.bbclass         |  6 ++---
  6 files changed, 60 insertions(+), 55 deletions(-)

create mode 100644 meta/classes/allarch-enabled.bbclass

meta/classes/allarch.bbclass +1 -40
index 1eebe0bf2e7..0eca076df0b 100644
@@ -1,52 +1,5 @@
  #
-# This class is used for architecture independent recipes/data files (usually scripts)
+# This class enables allarch only when multilib is not used.
  #
 
-PACKAGE_ARCH = "all"
-
-python () {
-    # Allow this class to be included but overridden - only set
-    # the values if we're still "all" package arch.
-    if d.getVar("PACKAGE_ARCH") == "all":
-        # No need for virtual/libc or a cross compiler
-        d.setVar("INHIBIT_DEFAULT_DEPS","1")
-
-        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
-        # naming anyway
-        d.setVar("baselib", "lib")
-        d.setVar("TARGET_ARCH", "allarch")
-        d.setVar("TARGET_OS", "linux")
-        d.setVar("TARGET_CC_ARCH", "none")
-        d.setVar("TARGET_LD_ARCH", "none")
-        d.setVar("TARGET_AS_ARCH", "none")
-        d.setVar("TARGET_FPU", "")
-        d.setVar("TARGET_PREFIX", "")
-        # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
-        # (this removes any dependencies from the hash perspective)
-        d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
-        d.setVar("SDK_ARCH", "none")
-        d.setVar("SDK_CC_ARCH", "none")
-        d.setVar("TARGET_CPPFLAGS", "none")
-        d.setVar("TARGET_CFLAGS", "none")
-        d.setVar("TARGET_CXXFLAGS", "none")
-        d.setVar("TARGET_LDFLAGS", "none")
-        d.setVar("POPULATESYSROOTDEPS", "")
-
-        # Avoid this being unnecessarily different due to nuances of
-        # the target machine that aren't important for "all" arch
-        # packages.
-        d.setVar("LDFLAGS", "")
-
-        # No need to do shared library processing or debug symbol handling
-        d.setVar("EXCLUDE_FROM_SHLIBS", "1")
-        d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
-        d.setVar("INHIBIT_PACKAGE_STRIP", "1")

meta/classes/allarch.bbclass line 5

Quoted 10 lines
meta/classes/allarch.bbclass +1 -9
-
-        # These multilib values shouldn't change allarch packages so exclude them
-        d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
-        d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
-        d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
-    elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
-        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
-}
-
+inherit ${@oe.utils.ifelse(d.getVar('MULTILIB_VARIANTS'), '', 'allarch-enabled')}

Firstly, whilst I do understand why you've made this change like this, I don't really like one line classes which clutter up the classes directory. Using inherit like this does force the expansion of the variable early and is very prone to "race" conditions. The above is safe but see below.

Quoted 4 lines

FWIW the original code tried to switch off the value of the PACKAGE_ARCH variable. If we change the way we enable/disable the code, we should consider whether we can consistently use one mechanism for both.

It has bugs in original code that the PACKAGE_ARCH is set in a python anonymous function and too later to set PACKAGE_ARCH. I'll check how to do it with a better way.

Quoted 10 lines

Secondly, does this change affect the behaviour of nativesdk?

I think this will disable allarch for nativesdk in any multilib build and we don't want to do that, we only have a problem with target multilib allarch.

At a guess you probably need to check class-target is in overrides and multilib_variants is set? The problem could be that class-target is set comparatively late and then we're into ordering issues.

Ok. I'll do it.

Thanks a lot.

--Kai

Quoted 7 lines

I do want to get the nativesdk issue fixed before we merge this though.

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang
#8 lore raw

Re: [PATCH 3/6] update_font_cache: update script for multilib

In reply to Kai Kang
Quoted 23 lines · Kai Kang

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.

---
 meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb | 8 +++++++-
 scripts/postinst-intercepts/update_font_cache         | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +0 -0
index d4cbce80b45..db36c867741 100644

meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb do_configure_prepend() { · line 41

Quoted 7 lines
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +4 -0
@@ -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}
+    cp ${D}${bindir}/fc-cache ${D}${libexecdir}/${MLPREFIX}fc-cache

We may as well hardlink this, same for the following patch too.

Cheers,

Richard

#13 lore raw

Re: [PATCH 6/6] multilib: fix install file conflicts

In reply to Kai Kang
Quoted 10 lines · Kai Kang

Fix install files conflicts between multlib packages:

Quoted 8 lines

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

.pc files installed into /usr/share are architecture independent. Either it is arch dependent in which case its in the wrong place, or it needs to be fixed.

We are not putting these under control of update-alternatives!

It would be helpful to understand the kinds of differences in some of these files. gir files in /usr/share/gir-1.0/ should also really be arch independent...

Cheers,

Richard

author
#9 lore raw

Re: [PATCH 3/6] update_font_cache: update script for multilib

In reply to [email protected]
Quoted 27 lines · On 2018年09月04日 17:12, [email protected] wrote:
Quoted 26 lines · Kai Kang

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.

---
  meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb | 8 +++++++-
  scripts/postinst-intercepts/update_font_cache         | 2 +-
  2 files changed, 8 insertions(+), 2 deletions(-)
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +0 -0
index d4cbce80b45..db36c867741 100644
@@ -35,9 +35,15 @@ do_configure_prepend() {
      rm -f ${S}/src/fcobjshash.h ${S}/src/fcobjshash.gperf
  }
 
Quoted 5 lines

meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb do_configure_prepend() { · line 41

Quoted 4 lines
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +4 -0
+do_install_append_class-target() {
+    # duplicate fc-cache for postinstall script
+    mkdir -p ${D}${libexecdir}
+    cp ${D}${bindir}/fc-cache ${D}${libexecdir}/${MLPREFIX}fc-cache

We may as well hardlink this, same for the following patch too.

OK. Got it.

--Kai

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang
author
#14 lore raw

Re: [PATCH 6/6] multilib: fix install file conflicts

In reply to [email protected]
Quoted 11 lines · On 2018年09月04日 17:16, [email protected] wrote:
Quoted 10 lines · Kai Kang

Fix install files conflicts between multlib packages:

Quoted 8 lines

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

Quoted 3 lines

.pc files installed into /usr/share are architecture independent. Either it is arch dependent in which case its in the wrong place, or it needs to be fixed.

For .pc file of eudev, it sets udevdir with prefix ${libdir}

$ diff -u image/usr/share/pkgconfig/udev.pc ../../../x86-pokymllib32-linux/lib32-eudev/3.2.5-r0/image/usr/share/pkgconfig/udev.pc
--- image/usr/share/pkgconfig/udev.pc   2018-08-31 16:03:35.721580345 +0800
+++ ../../../x86-pokymllib32-linux/lib32-eudev/3.2.5-r0/image/usr/share/pkgconfig/udev.pc 2018-09-03 14:20:05.320474868 +0800
@@ -3,4 +3,4 @@
 Version: 220
 prefix=/usr
 exec_prefix=/usr
-udevdir=/lib64/udev
+udevdir=/lib/udev
Quoted 6 lines

We are not putting these under control of update-alternatives!

It would be helpful to understand the kinds of differences in some of these files. gir files in /usr/share/gir-1.0/ should also really be arch independent...

For the .gir file, it contains some length of types, such as long and pointer.

@@ -21251,16 +21251,16 @@
 This is ":" on UNIX machines and ";" under Windows.</doc>
       <type name="utf8" c:type="gchar*"/>
     </constant>
-    <constant name="SIZEOF_LONG" value="8" c:type="GLIB_SIZEOF_LONG"> +    <constant name="SIZEOF_LONG" value="4" c:type="GLIB_SIZEOF_LONG"> <type name="gint" c:type="gint"/>
     </constant>
-    <constant name="SIZEOF_SIZE_T" value="8" c:type="GLIB_SIZEOF_SIZE_T"> +    <constant name="SIZEOF_SIZE_T" value="4" c:type="GLIB_SIZEOF_SIZE_T"> <type name="gint" c:type="gint"/>
     </constant>
-    <constant name="SIZEOF_SSIZE_T" value="8" c:type="GLIB_SIZEOF_SSIZE_T"> +    <constant name="SIZEOF_SSIZE_T" value="4" c:type="GLIB_SIZEOF_SSIZE_T"> <type name="gint" c:type="gint"/>
     </constant>
-    <constant name="SIZEOF_VOID_P" value="8" c:type="GLIB_SIZEOF_VOID_P"> +    <constant name="SIZEOF_VOID_P" value="4" c:type="GLIB_SIZEOF_VOID_P"> <type name="gint" c:type="gint"/>
     </constant>
     <record name="SList" c:type="GSList">

Regards,
Kai

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang
author
#4 lore raw
In reply to [email protected]
Quoted 104 lines · On 2018年09月04日 16:36, [email protected] wrote:

Hi,

I think this is close and it passes the tests on the autobuilder however I did spot a couple of potential issues after thinking about this for a bit.

Quoted 76 lines · Kai Kang

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.

Copy allarch.bbclass to allarch-enabled.bbclass and only inherit allarch-enabled.bbclass when multilib is not used.

---
  meta/classes/allarch-enabled.bbclass | 52 ++++++++++++++++++++++++++++++++++++
  meta/classes/allarch.bbclass         | 51 ++---------------------------------
  meta/classes/icecc.bbclass           |  2 +-
  meta/classes/multilib.bbclass        |  2 +-
  meta/classes/multilib_global.bbclass |  2 +-
  meta/classes/package.bbclass         |  6 ++---
  6 files changed, 60 insertions(+), 55 deletions(-)

create mode 100644 meta/classes/allarch-enabled.bbclass

meta/classes/allarch.bbclass +1 -40
index 1eebe0bf2e7..0eca076df0b 100644
@@ -1,52 +1,5 @@
  #
-# This class is used for architecture independent recipes/data files (usually scripts)
+# This class enables allarch only when multilib is not used.
  #
 
-PACKAGE_ARCH = "all"
-
-python () {
-    # Allow this class to be included but overridden - only set
-    # the values if we're still "all" package arch.
-    if d.getVar("PACKAGE_ARCH") == "all":
-        # No need for virtual/libc or a cross compiler
-        d.setVar("INHIBIT_DEFAULT_DEPS","1")
-
-        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
-        # naming anyway
-        d.setVar("baselib", "lib")
-        d.setVar("TARGET_ARCH", "allarch")
-        d.setVar("TARGET_OS", "linux")
-        d.setVar("TARGET_CC_ARCH", "none")
-        d.setVar("TARGET_LD_ARCH", "none")
-        d.setVar("TARGET_AS_ARCH", "none")
-        d.setVar("TARGET_FPU", "")
-        d.setVar("TARGET_PREFIX", "")
-        # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
-        # (this removes any dependencies from the hash perspective)
-        d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
-        d.setVar("SDK_ARCH", "none")
-        d.setVar("SDK_CC_ARCH", "none")
-        d.setVar("TARGET_CPPFLAGS", "none")
-        d.setVar("TARGET_CFLAGS", "none")
-        d.setVar("TARGET_CXXFLAGS", "none")
-        d.setVar("TARGET_LDFLAGS", "none")
-        d.setVar("POPULATESYSROOTDEPS", "")
-
-        # Avoid this being unnecessarily different due to nuances of
-        # the target machine that aren't important for "all" arch
-        # packages.
-        d.setVar("LDFLAGS", "")
-
-        # No need to do shared library processing or debug symbol handling
-        d.setVar("EXCLUDE_FROM_SHLIBS", "1")
-        d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
-        d.setVar("INHIBIT_PACKAGE_STRIP", "1")

meta/classes/allarch.bbclass line 5

Quoted 10 lines
meta/classes/allarch.bbclass +1 -9
-
-        # These multilib values shouldn't change allarch packages so exclude them
-        d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
-        d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
-        d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
-    elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
-        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
-}
-
+inherit ${@oe.utils.ifelse(d.getVar('MULTILIB_VARIANTS'), '', 'allarch-enabled')}

Firstly, whilst I do understand why you've made this change like this, I don't really like one line classes which clutter up the classes directory. Using inherit like this does force the expansion of the variable early and is very prone to "race" conditions. The above is safe but see below.

FWIW the original code tried to switch off the value of the PACKAGE_ARCH variable. If we change the way we enable/disable the code, we should consider whether we can consistently use one mechanism for both.

Quoted 5 lines

Secondly, does this change affect the behaviour of nativesdk?

I think this will disable allarch for nativesdk in any multilib build and we don't want to do that, we only have a problem with target multilib allarch.

I searched oe-core for which inherits allarch and bbextend nativesdk by:

$ rgrep 'inherit.*allarch' -l meta | xargs grep -l 'BBCLASSEXTEND.*nativesdk'
meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb
meta/recipes-support/ca-certificates/ca-certificates_20180409.bb
meta/recipes-core/update-rc.d/update-rc.d_0.8.bb

And I checked one of them:

$ bitbake -e nativesdk-autoconf-archive > be.nativesdk-autoconf-archive

The var PACKAGE_ARCH will be set with value from nativesdk.bbclass and overwrite the value from allarch.bbclass:

# $PACKAGE_ARCH [4 operations]
#   set /buildarea/kkang/yocto/poky/meta/conf/bitbake.conf:150 #     [_defaultval] "${TUNE_PKGARCH}"
#   set /buildarea/kkang/yocto/poky/meta/conf/documentation.conf:304 #     [doc] "The architecture of the resulting package or packages." #   set /buildarea/kkang/yocto/poky/meta/classes/allarch.bbclass:5 # "all"
#   set /buildarea/kkang/yocto/poky/meta/classes/nativesdk.bbclass:18 # "${SDK_ARCH}-${SDKPKGSUFFIX}"

# pre-expansion value:
# "${SDK_ARCH}-${SDKPKGSUFFIX}"
PACKAGE_ARCH="x86_64-nativesdk"

It seems update of allarch.bbclass doesn't affect nativesdk. Or did I miss something? Thanks.

--Kai

Quoted 11 lines

At a guess you probably need to check class-target is in overrides and multilib_variants is set? The problem could be that class-target is set comparatively late and then we're into ordering issues.

I do want to get the nativesdk issue fixed before we merge this though.

Cheers,

Richard

Signature · 2 lines
Regards,
Neil | Kai Kang
#5 lore raw
Quoted 27 lines · Kang Kai

I searched oe-core for which inherits allarch and bbextend nativesdk by:

$ rgrep 'inherit.*allarch' -l meta | xargs grep -l 
'BBCLASSEXTEND.*nativesdk'
meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb
meta/recipes-support/ca-certificates/ca-certificates_20180409.bb
meta/recipes-core/update-rc.d/update-rc.d_0.8.bb

And I checked one of them:

$ bitbake -e nativesdk-autoconf-archive > be.nativesdk-autoconf-
archive

The var PACKAGE_ARCH will be set with value from nativesdk.bbclass and
overwrite the value from allarch.bbclass:

# $PACKAGE_ARCH [4 operations]
# set /buildarea/kkang/yocto/poky/meta/conf/bitbake.conf:150
# [_defaultval] "${TUNE_PKGARCH}"
# set /buildarea/kkang/yocto/poky/meta/conf/documentation.conf:304
# [doc] "The architecture of the resulting package or packages."
# set /buildarea/kkang/yocto/poky/meta/classes/allarch.bbclass:5
# "all"
# set /buildarea/kkang/yocto/poky/meta/classes/nativesdk.bbclass:18
# "${SDK_ARCH}-${SDKPKGSUFFIX}"

Quoted 6 lines
# pre-expansion value:
# "${SDK_ARCH}-${SDKPKGSUFFIX}"
PACKAGE_ARCH="x86_64-nativesdk"

It seems update of allarch.bbclass doesn't affect nativesdk. Or did I miss something? Thanks.

Sorry, I think its me that is confused. I could have sworn there was a noarch-nativesdk package class. I think we abandoned it due to is not giving much benefit but high complexity and you're right, looking at the code, it doesn't exist now.

Cheers,

Richard