Skip to contentSkip to conversation

sstate: Drop unneeded SSTATE_MANMACH variable

PATCH In review Richard Purdie 5 participants 12 messages Mar 14 – Mar 16 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 sstate: Drop unneeded SSTATE_MANMACH variable

This variable doesn't appear needed and just confuses the code, remove it.

---
 meta/classes-global/sstate.bbclass | 13 +++++--------
 meta/classes/toaster.bbclass       |  8 ++++----
 meta/lib/oe/sstatesig.py           |  2 +-
 3 files changed, 10 insertions(+), 13 deletions(-)
meta/classes-global/sstate.bbclass +5 -8
index 3b2e307134e..fec4d88c4cf 100644
@@ -9,7 +9,7 @@ SSTATE_VERSION = "14"
 SSTATE_ZSTD_CLEVEL ??= "8"
 
 SSTATE_MANIFESTS ?= "${TMPDIR}/sstate-control"
-SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
+SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_PKGARCH}-${PN}"
 
 def generate_sstatefn(spec, hash, taskname, siginfo, d):
     if taskname is None:
@@ -96,8 +96,6 @@ SSTATE_ARCHS = " \
     ${MACHINE_ARCH}"
 SSTATE_ARCHS[vardepsexclude] = "ORIGNATIVELSBSTRING"
 
-SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
-
 SSTATECREATEFUNCS += "sstate_hardcode_path"
 SSTATECREATEFUNCS[vardeps] = "SSTATE_SCAN_FILES"
 SSTATEPOSTCREATEFUNCS = ""
@@ -148,8 +146,7 @@ python () {
         d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
     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}"))
+    # Fall back to the default of SSTATE_PKGARCH=PACKAGE_ARCH
 
     if bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d):
         d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
@@ -320,7 +317,7 @@ def sstate_install(ss, d):
 
     # Append to the list of manifests for this PACKAGE_ARCH
 
-    i = d2.expand("${SSTATE_MANIFESTS}/index-${SSTATE_MANMACH}")
+    i = d2.expand("${SSTATE_MANIFESTS}/index-${SSTATE_PKGARCH}")
     l = bb.utils.lockfile(i + ".lock")
     filedata = d.getVar("STAMP") + " " + d2.getVar("SSTATE_MANFILEPREFIX") + " " + d.getVar("WORKDIR") + "\n"
     manifests = []
@@ -353,7 +350,7 @@ def sstate_install(ss, d):
     for lock in locks:
         bb.utils.unlockfile(lock)
 
-sstate_install[vardepsexclude] += "SSTATE_ALLOW_OVERLAP_FILES SSTATE_MANMACH SSTATE_MANFILEPREFIX STAMP"
+sstate_install[vardepsexclude] += "SSTATE_ALLOW_OVERLAP_FILES SSTATE_PKGARCH SSTATE_MANFILEPREFIX STAMP"
 
 def sstate_installpkg(ss, d):
     from oe.gpg_sign import get_signer
@@ -520,7 +517,7 @@ def sstate_clean(ss, d):
     stamp_clean = d.getVar("STAMPCLEAN")
     extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info')
     if extrainf:
-        d2.setVar("SSTATE_MANMACH", extrainf)
+        d2.setVar("SSTATE_PKGARCH", extrainf)
         wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
     else:
         wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
meta/classes/toaster.bbclass +4 -4
index af7c4578088..10c728885ae 100644
@@ -343,15 +343,15 @@ python toaster_artifacts() {
         d2 = d.createCopy()
         d2.setVar('FILE', e.taskfile)
         # Use 'stamp-extra-info' if present, else use workaround
-        # to determine 'SSTATE_MANMACH'
+        # to determine 'SSTATE_PKGARCH'
         extrainf = d2.getVarFlag(e.taskname, 'stamp-extra-info')
         if extrainf:
-            d2.setVar('SSTATE_MANMACH', extrainf)
+            d2.setVar('SSTATE_PKGARCH', extrainf)
         else:
             if "do_populate_sdk" == e.taskname:
-                d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}${SDKMACHINE}"))
+                d2.setVar('SSTATE_PKGARCH', d2.expand("${MACHINE}${SDKMACHINE}"))
             else:
-                d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}"))
+                d2.setVar('SSTATE_PKGARCH', d2.expand("${MACHINE}"))
         manifest = oe.sstatesig.sstate_get_manifest_filename(e.taskname[3:], d2)[0]
 
         if os.access(manifest, os.R_OK):
meta/lib/oe/sstatesig.py +1 -1
index ef687f5d417..1e07c71e944 100644
@@ -491,7 +491,7 @@ def sstate_get_manifest_filename(task, d):
     d2 = d.createCopy()
     extrainf = d.getVarFlag("do_" + task, 'stamp-extra-info')
     if extrainf:
-        d2.setVar("SSTATE_MANMACH", extrainf)
+        d2.setVar("SSTATE_PKGARCH", extrainf)
     return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
 
 @bb.parse.vardepsexclude("BBEXTENDCURR", "BBEXTENDVARIANT", "OVERRIDES", "PACKAGE_EXTRA_ARCHS")
#1 lore raw

PATCH 2/5 bitbake.conf: Add SDKMACHINE to BUILDCFG_VARS, drop TARGET_FPU

Tweak the default build header to add SDKMACHINE and drop TARGET_FPU since that data is more likely to be of use to the general user.

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 5f632d9f8e7..6b3443695a0 100644
@@ -761,7 +761,7 @@ PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
 
 # Pre-build configuration output
 BUILDCFG_HEADER = "Build Configuration${@" (mc:${BB_CURRENT_MC})" if d.getVar("BBMULTICONFIG") else ""}:"
-BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
+BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE SDKMACHINE DISTRO DISTRO_VERSION TUNE_FEATURES"
 BUILDCFG_VARS[type] = "list"
 BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
 BUILDCFG_NEEDEDVARS[type] = "list"
#2 lore raw

Re: [OE-core] [PATCH 2/5] bitbake.conf: Add SDKMACHINE to BUILDCFG_VARS, drop TARGET_FPU

Hello,

What are your thoughts on including TCLIBC in BUILCFG_VARS?.

I often find myself missing this key information, but I may be biased due to my particular usecase, hence I would like other folks opinion on how useful this may be for the general public, sometimes we get similar information from TARGET_OS / LIBCEXTENSION, but that isn't always the case.

Thanks

Alejandro

Quoted 30 lines · Richard Purdie via lists.openembedded.org

Tweak the default build header to add SDKMACHINE and drop TARGET_FPU since that data is more likely to be of use to the general user.

---
  meta/conf/bitbake.conf | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -2
index 5f632d9f8e7..6b3443695a0 100644
@@ -761,7 +761,7 @@ PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
 
  # Pre-build configuration output
  BUILDCFG_HEADER = "Build Configuration${@" (mc:${BB_CURRENT_MC})" if d.getVar("BBMULTICONFIG") else ""}:"
-BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
+BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE SDKMACHINE DISTRO DISTRO_VERSION TUNE_FEATURES"
  BUILDCFG_VARS[type] = "list"
  BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
  BUILDCFG_NEEDEDVARS[type] = "list"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#233077):https://lists.openembedded.org/g/openembedded-core/message/233077 Mute This Topic:https://lists.openembedded.org/mt/118311455/4354175
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [OE-core] [PATCH 2/5] bitbake.conf: Add SDKMACHINE to BUILDCFG_VARS, drop TARGET_FPU

Quoted 8 lines · Alejandro Hernandez

What are your thoughts on including TCLIBC in BUILCFG_VARS?.

I often find myself missing this key information, but I may be biased due to my particular usecase,
hence I would like other folks opinion on how useful this may be for the general public, sometimes
we get similar information from TARGET_OS / LIBCEXTENSION, but that isn't always the case.

We need to try and keep the information concise and not have too much there. I'd have thought TARGET_SYS should already have the libc information as part of the target triplet?

Also, you can customise this locally if that helps.

Cheers,

Richard

#4 lore raw

PATCH 3/5 allarch/lib: Convert core of allarch code into a function

In reply to Richard Purdie

We need to call the functionality in allarch.bbclass from other contexts and the current conditionals are problematic enough without further changes confusing things. Move the code to a funtion in oe.utils so we can call it as needed.

---
 meta/classes-recipe/allarch.bbclass | 41 +------------------------
 meta/lib/oe/utils.py                | 47 +++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 40 deletions(-)
meta/classes-recipe/allarch.bbclass +1 -40
index e429b924370..7cdaa63ae2c 100644
@@ -25,46 +25,7 @@ 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")
-
-        d.setVar("qemu_wrapper_cmdline", "def qemu_wrapper_cmdline(data, rootfs_path, library_paths):\n    return 'false'")
+        oe.utils.make_arch_independent(d)
     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/lib/oe/utils.py +47 -0

50 lines not on this page · raw message

#5 lore raw

PATCH 4/5 meta/dummy-sdk-package: Improve SDK dummy package handling

In reply to Richard Purdie

Currently, the dummy SDK packages are re-running for different SDKMACHINE values when they should not. The usage of allarch is broken and not triggering the right PACKAGE_ARCH value due to the deferred nature of nativesdk. This was probably broken when we switched to add deferred classes.

To try and make this all more explict and less prone to breakage, switch to calling oe.utils.make_arch_independent() directly.

Add the 'special' package architecture values to SSTATE_ARCHS so the system cna properly track them.

Remove the pointless tasks we don't need from the dummy recipes, mark the packagedata as machine independent and then remove from the conflict list in sstate.bbclass.

---
 meta/classes-global/sstate.bbclass            |  6 ++---
 meta/lib/oe/sstatesig.py                      |  6 ++++-
 meta/recipes-core/meta/dummy-sdk-package.inc  | 25 +++++++++++++------
 .../meta/nativesdk-buildtools-perl-dummy.bb   |  2 ++
 .../meta/nativesdk-sdk-provides-dummy.bb      |  3 +++
 .../meta/target-sdk-provides-dummy.bb         |  2 ++
 6 files changed, 33 insertions(+), 11 deletions(-)
meta/classes-global/sstate.bbclass +3 -3
index fec4d88c4cf..f124f33b2d3 100644
@@ -57,9 +57,6 @@ SSTATE_EXTRAPATHWILDCARD[vardepvalue] = ""
 
 # Avoid docbook/sgml catalog warnings for now
 SSTATE_ALLOW_OVERLAP_FILES += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
-# sdk-provides-dummy-nativesdk and nativesdk-buildtools-perl-dummy overlap for different SDKMACHINE
-SSTATE_ALLOW_OVERLAP_FILES += "${DEPLOY_DIR_RPM}/sdk_provides_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-nativesdk/"
-SSTATE_ALLOW_OVERLAP_FILES += "${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_ALLOW_OVERLAP_FILES += "${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
@@ -90,6 +87,9 @@ SSTATE_ARCHS = " \
     ${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
     ${SDK_ARCH}_${SDK_OS} \
     ${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX} \
+    buildtools-dummy-${SDKPKGSUFFIX} \
+    sdk-provides-dummy-target \
+    sdk-provides-dummy-${SDKPKGSUFFIX} \
     allarch \
     ${SSTATE_ARCHS_TUNEPKG} \
     ${PACKAGE_EXTRA_ARCHS} \
meta/lib/oe/sstatesig.py +5 -1
index 1e07c71e944..4693b73375e 100644
@@ -513,7 +513,10 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
     if taskdata.endswith("-native"):
         pkgarchs = ["${BUILD_ARCH}", "${BUILD_ARCH}_${ORIGNATIVELSBSTRING}"]
     elif taskdata.startswith("nativesdk-"):
-        pkgarchs = ["${SDK_ARCH}_${SDK_OS}", "allarch"]
+        pkgarchs = ["${SDK_ARCH}_${SDK_OS}",
+                    "allarch",
+                    "buildtools-dummy-${SDKPKGSUFFIX}",
+                    "sdk-provides-dummy-${SDKPKGSUFFIX}"]
     elif "-cross-canadian" in taskdata:
         pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
     elif "-cross-" in taskdata:
@@ -524,6 +527,7 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
         pkgarchs = ['${MACHINE_ARCH}']
         pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
         pkgarchs.append('allarch')
+        pkgarchs.append('sdk-provides-dummy-target')
         pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')
 
     searched_manifests = []
meta/recipes-core/meta/dummy-sdk-package.inc +18 -7
index bf453cac9be..60dfe9f73bb 100644
@@ -1,18 +1,21 @@
 SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools"
 LICENSE = "MIT"
 
-PACKAGE_ARCH = "all"
-
-inherit allarch
-
 INHIBIT_DEFAULT_DEPS = "1"
 
 python() {
+    pkgdata_var = d.getVar("DUMMYSDK_PKGDATA_VARNAME")
+    # Expand PKGDATA_DIR_SDK/SDK_SYS and stamp-extra-info before we lose the values
+    d.setVar(pkgdata_var, d.getVar(pkgdata_var))
+    stampinfo = d.getVar("DUMMYSDK_EXTRASTAMP_VARNAME")
+    d.setVarFlag("do_packagedata", "stamp-extra-info", d.getVar(stampinfo))
+
+    oe.utils.make_arch_independent(d)
+
     # 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}')
+    # Need to set PACKAGE_ARCH after deferred nativesdk inherit
+    d.setVar("PACKAGE_ARCH", "${DUMMYARCH}")
 }
 
 ALLOW_EMPTY:${PN} = "1"
@@ -31,3 +34,11 @@ python populate_packages:prepend() {
     d.appendVar("RREPLACES:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
 }
 
+deltask fetch
+deltask unpack
+deltask patch
+deltask prepare_recipe_sysroot
+deltask configure
+deltask compile
+deltask install
+deltask populate_sysroot
meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb +2 -0
index 0ba1ca6e426..f97a28cab56 100644
@@ -1,4 +1,6 @@
 DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR_SDK"
+DUMMYSDK_EXTRASTAMP_VARNAME = "SDK_SYS"
 
 DUMMYPROVIDES_PACKAGES = "\
     nativesdk-perl \
meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb +3 -0
index 1d71f373a4e..37dad54409f 100644
@@ -1,5 +1,8 @@
 DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}"
 
+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR_SDK"
+DUMMYSDK_EXTRASTAMP_VARNAME = "SDK_SYS"
+
 DUMMYPROVIDES_PACKAGES = "\
     pkgconfig \
 "
meta/recipes-core/meta/target-sdk-provides-dummy.bb +2 -0
index 849407cca57..65b87fd97dd 100644
@@ -1,4 +1,6 @@
 DUMMYARCH = "sdk-provides-dummy-target"
+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR"
+DUMMYSDK_EXTRASTAMP_VARNAME = "MACHINE"
 
 DUMMYPROVIDES_PACKAGES = "\
     busybox \
#6 lore raw

Re: [OE-core] [PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Quoted 8 lines · Richard Purdie via lists.openembedded.org

Currently, the dummy SDK packages are re-running for different SDKMACHINE values when they should not. The usage of allarch is broken and not triggering the right PACKAGE_ARCH value due to the deferred nature of nativesdk. This was probably broken when we switched to add deferred classes.

To try and make this all more explict and less prone to breakage, switch to calling oe.utils.make_arch_independent() directly.

Quoted 8 lines

Add the 'special' package architecture values to SSTATE_ARCHS so the system cna properly track them.

Remove the pointless tasks we don't need from the dummy recipes, mark the packagedata as machine independent and then remove from the conflict list in sstate.bbclass.

---

Hi Richard,

I get some failures with this commit:

ERROR: core-image-sato-1.0-r0 do_populate_sdk: Error executing a python function in exec_func_python() autogenerated:
...
File: '/srv/pokybuild/yocto-worker/genericx86-64/build/layers/openembedded-core/meta/lib/oe/package_manager/__init__.py', lineno: 529, function: create_packages_dir
0525: start = next
0526:
0527: for dep in pkgdeps:
0528: c = taskdepdata[dep][0]
*** 0529: manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
0530: if not manifest:
0531: bb.fatal("No manifest generated from: %s in %s" % (c, taskdepdata[dep][2]))
0532: if not os.path.exists(manifest):
0533: continue
File: '/srv/pokybuild/yocto-worker/genericx86-64/build/layers/openembedded-core/meta/lib/oe/sstatesig.py', lineno: 536, function: find_sstate_manifest
0532: if os.path.exists(manifest):
0533: return manifest, d2
0534: searched_manifests.append(manifest)
0535: bb.fatal("The sstate manifest for task '%s:%s' (multilib variant '%s') could not be found.\nThe pkgarchs considered were: %s.\nBut none of these manifests exists:\n %s"
*** 0536: % (taskdata, taskname, variant, d2.expand(", ".join(pkgarchs)),"\n ".join(searched_manifests)))

     0537:    return None, d2
     0538:
     0539:def OEOuthashBasic(path, sigfile, task, d):
     0540:    """

Exception: TypeError: sequence item 2: expected str instance, list found

https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/3385
https://autobuilder.yoctoproject.org/valkyrie/#/builders/8/builds/3416

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH 5/5 sstate: Tweak SDK sstate package architecture

In reply to Richard Purdie

While in this area of the code, it is worth noting that PACKAGE_ARCH + PN are already designed to capture the needed information that we need in SSTATE_PKGARCH.

We can therefore simplify things by just using the standard fallack for SSTATE_PKGARCH instead of more complex manipulations.

---
 meta/classes-global/sstate.bbclass | 7 +------
 meta/lib/oe/sstatesig.py           | 8 +++-----
 2 files changed, 4 insertions(+), 11 deletions(-)
meta/classes-global/sstate.bbclass +1 -6
index f124f33b2d3..a7c3f5332a2 100644
@@ -85,8 +85,7 @@ SSTATE_ARCHS = " \
     ${BUILD_ARCH} \
     ${BUILD_ARCH}_${ORIGNATIVELSBSTRING} \
     ${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
-    ${SDK_ARCH}_${SDK_OS} \
-    ${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX} \
+    ${SDK_ARCH}-${SDKPKGSUFFIX} \
     buildtools-dummy-${SDKPKGSUFFIX} \
     sdk-provides-dummy-target \
     sdk-provides-dummy-${SDKPKGSUFFIX} \
@@ -140,10 +139,6 @@ python () {
         d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"))
     elif bb.data.inherits_class('cross', d):
         d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}"))
-    elif bb.data.inherits_class('nativesdk', d):
-        d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${SDK_OS}"))
-    elif bb.data.inherits_class('cross-canadian', d):
-        d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
     elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
         d.setVar('SSTATE_PKGARCH', "allarch")
     # Fall back to the default of SSTATE_PKGARCH=PACKAGE_ARCH
meta/lib/oe/sstatesig.py +3 -5
index 4693b73375e..86d159ed209 100644
@@ -512,13 +512,11 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
 
     if taskdata.endswith("-native"):
         pkgarchs = ["${BUILD_ARCH}", "${BUILD_ARCH}_${ORIGNATIVELSBSTRING}"]
-    elif taskdata.startswith("nativesdk-"):
-        pkgarchs = ["${SDK_ARCH}_${SDK_OS}",
+    elif taskdata.startswith("nativesdk-") or "-cross-canadian" in taskdata:
+        pkgarchs = ["${SDK_ARCH}-${SDKPKGSUFFIX}",
                     "allarch",
                     "buildtools-dummy-${SDKPKGSUFFIX}",
                     "sdk-provides-dummy-${SDKPKGSUFFIX}"]
-    elif "-cross-canadian" in taskdata:
-        pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
     elif "-cross-" in taskdata:
         pkgarchs = ["${BUILD_ARCH}"]
     elif "-crosssdk" in taskdata:
@@ -528,7 +526,7 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
         pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
         pkgarchs.append('allarch')
         pkgarchs.append('sdk-provides-dummy-target')
-        pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')
+        pkgarchs.append('${SDK_ARCH}-${SDKPKGSUFFIX}')
 
     searched_manifests = []
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Re: [OE-core] [PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Quoted 8 lines · Richard Purdie via lists.openembedded.org

Currently, the dummy SDK packages are re-running for different SDKMACHINE values when they should not. The usage of allarch is broken and not triggering the right PACKAGE_ARCH value due to the deferred nature of nativesdk. This was probably broken when we switched to add deferred classes.

To try and make this all more explict and less prone to breakage, switch to calling oe.utils.make_arch_independent() directly.

Quoted 7 lines

Add the 'special' package architecture values to SSTATE_ARCHS so the system cna properly track them.

Remove the pointless tasks we don't need from the dummy recipes, mark the packagedata as machine independent and then remove from the conflict list in sstate.bbclass.

This patch fixes real issues with the way the dummy recipes are currently being handled. Unfortunately this change still isn't without issues, this is shown by the failure in meta-virtualization it introduces. It is starting to feel like I'm somehow targeting Bruce recently, sorry!

The failure this patchset triggers in meta-virtualization is here:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/89/builds/3215

The reason is that it is doing this:

recipes-core/meta/container-dummy-provides.bb:require recipes-core/meta/dummy-sdk-package.inc

which is fine, I hadn't realised layers were using that but it should be something you can do. At first glance, the fix looks easy, just add:

DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR"
DUMMYSDK_EXTRASTAMP_VARNAME = "MACHINE"

to the recipe. That doesn't account for the sstate.bbclass and sstatesig.py changes this patch is making though.

I've never been happy at having to add these individually to the "feed" lists in the first place and another layer trying to do this illustrates why.

I'm at a bit of a loss on what to do from here. Options could be:

a) move the recipe to core and add another entry to sstate.bbclass/sstatesig.py . That doesn't help it anyone else does this

b) Create some layer.conf variables which allow these to be defined/added generically. That would need careful manipulation of the hash variable dependencies to stop things rebuilding like crazy.

c) Find a way for the core not to need this list hardcoded. That would be nicer and removes what looks like a horrible scaling issue we have right now I don't know how to do that.

d) Something else

I'm open to ideas, these changes are needed to unblock the spdx changes.

Cheers,

Richard

#10 lore raw

Re: [OE-core] [PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Quoted 23 lines · Richard Purdie
Quoted 1 line · Richard Purdie via lists.openembedded.org

Currently, the dummy SDK packages are re-running for different

SDKMACHINE values

Quoted 1 line

when they should not. The usage of allarch is broken and not triggering

the right

Quoted 1 line

PACKAGE_ARCH value due to the deferred nature of nativesdk. This was

probably

Quoted 3 lines

broken when we switched to add deferred classes.

To try and make this all more explict and less prone to breakage, switch

to calling

Quoted 3 lines

oe.utils.make_arch_independent() directly.

Add the 'special' package architecture values to SSTATE_ARCHS so the

system cna properly

Quoted 3 lines

track them.

Remove the pointless tasks we don't need from the dummy recipes, mark

the packagedata

Quoted 1 line

as machine independent and then remove from the conflict list in

sstate.bbclass.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

This patch fixes real issues with the way the dummy recipes are currently being handled. Unfortunately this change still isn't without issues, this is shown by the failure in meta-virtualization it introduces. It is starting to feel like I'm somehow targeting Bruce recently, sorry!

It's probably more that I'm doing strange and niche things :)

I see your patch, I'll pull it in shortly, thanks for the fixup, I would have taken ages to figure that out!

Bruce

Quoted 46 lines

The failure this patchset triggers in meta-virtualization is here:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/89/builds/3215

The reason is that it is doing this:

recipes-core/meta/container-dummy-provides.bb:require recipes-core/meta/dummy-sdk-package.inc

which is fine, I hadn't realised layers were using that but it should be something you can do. At first glance, the fix looks easy, just add:

DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR"
DUMMYSDK_EXTRASTAMP_VARNAME = "MACHINE"

to the recipe. That doesn't account for the sstate.bbclass and sstatesig.py changes this patch is making though.

I've never been happy at having to add these individually to the "feed" lists in the first place and another layer trying to do this illustrates why.

I'm at a bit of a loss on what to do from here. Options could be:

a) move the recipe to core and add another entry to sstate.bbclass/sstatesig.py . That doesn't help it anyone else does this

b) Create some layer.conf variables which allow these to be defined/added generically. That would need careful manipulation of the hash variable dependencies to stop things rebuilding like crazy.

c) Find a way for the core not to need this list hardcoded. That would be nicer and removes what looks like a horrible scaling issue we have right now I don't know how to do that.

d) Something else

I'm open to ideas, these changes are needed to unblock the spdx changes.

Cheers,

Richard

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Re: [OE-core] [PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Quoted 9 lines · Richard Purdie via lists.openembedded.org

Options could be:

a) move the recipe to core and add another entry to sstate.bbclass/sstatesig.py . That doesn't help it anyone else does this

b) Create some layer.conf variables which allow these to be defined/added generically. That would need careful manipulation of the hash variable dependencies to stop things rebuilding like crazy.

Having said this all out loud, b) is the only realistic option so I've just sent a patch which does that. I don't like it but it is the least worst option I can see right now.

Cheers,

Richard

#13 lore raw

Re: [OE-core] [PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Quoted 10 lines · Richard Purdie via lists.openembedded.org
Quoted 9 lines · Richard Purdie via lists.openembedded.org

Options could be:

a) move the recipe to core and add another entry to sstate.bbclass/sstatesig.py . That doesn't help it anyone else does this

b) Create some layer.conf variables which allow these to be defined/added generically. That would need careful manipulation of the hash variable dependencies to stop things rebuilding like crazy.

Quoted 7 lines

Having said this all out loud, b) is the only realistic option so I've just sent a patch which does that. I don't like it but it is the least worst option I can see right now.

Cheers,

Richard

Notes from patch review meeting:

Joshua said that he'd write a test based on the native-sstate being machine independent. Here the sdk dummy packages should be independent of SDK machine.

Is that right Joshua? Want a YP BZ ?

../Randy

Quoted 10 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#233083):https://lists.openembedded.org/g/openembedded-core/message/233083 Mute This Topic:https://lists.openembedded.org/mt/118311680/3616765
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
# Randy MacLeod
# Wind River Linux