Skip to contentSkip to conversation

packagegroup-core-buildessential: Mark as TUNE_PKGARCH specific

PATCH New Richard Purdie 1 participant 4 messages Nov 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 packagegroup-core-buildessential: Mark as TUNE_PKGARCH specific

The libstdc++ dependency is debian renamed so this shouldn't be allarch, mark accordingly.

---
 .../packagegroups/packagegroup-core-buildessential.bb          | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb +3 -0
index 32f4ac35861..2cd67ad05f8 100644
@@ -5,6 +5,9 @@
 
 SUMMARY = "Essential build dependencies"
 
+# libstdc++ gets debian renamed
+PACKAGE_ARCH = "${TUNE_PKGARCH}"
+
 inherit packagegroup
 
 RDEPENDS:packagegroup-core-buildessential = "\
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/4 packagegroups-core-full-cmdline: Drop libraries packagegroup and gmp

We pull in libraries as/where needed as dependencies so there is no need to have them as specific packagegroups. This change removes glib-2.0 and gmp.

This also has the advantage of meaning debian renaming now isn't used anywhere and the packagegroup can remain allarch.

---
 .../packagegroups/packagegroup-core-full-cmdline.bb       | 8 --------
 1 file changed, 8 deletions(-)
meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb +0 -8
index 14a7bded953..c0647b21883 100644
@@ -10,7 +10,6 @@ inherit packagegroup
 
 PACKAGES = "\
     packagegroup-core-full-cmdline \
-    packagegroup-core-full-cmdline-libs \
     packagegroup-core-full-cmdline-utils \
     packagegroup-core-full-cmdline-extended \
     packagegroup-core-full-cmdline-dev-utils \
@@ -23,7 +22,6 @@ python __anonymous () {
     # For backwards compatibility after rename
     namemap = {}
     namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic"
-    namemap["packagegroup-core-full-cmdline-libs"] = "packagegroup-core-basic-libs"
     namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils"
     namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended"
     namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils"
@@ -56,7 +54,6 @@ python __anonymous () {
 
 
 RDEPENDS:packagegroup-core-full-cmdline = "\
-    packagegroup-core-full-cmdline-libs \
     packagegroup-core-full-cmdline-utils \
     packagegroup-core-full-cmdline-extended \
     packagegroup-core-full-cmdline-dev-utils \
@@ -65,10 +62,6 @@ RDEPENDS:packagegroup-core-full-cmdline = "\
     packagegroup-core-full-cmdline-sys-services \
     "
 
-RDEPENDS:packagegroup-core-full-cmdline-libs = "\
-    glib-2.0 \
-    "
-
 RDEPENDS:packagegroup-core-full-cmdline-utils = "\
     bash \
     acl \
@@ -81,7 +74,6 @@ RDEPENDS:packagegroup-core-full-cmdline-utils = "\
     file \
     findutils \
     gawk \
-    gmp \
     grep \
     less \
     makedevs \
Signature · 1 line
2.32.0
#2 lore raw

PATCH 3/4 packagegrou-core-full-cmdline: Drop compatibility mappings

In reply to Richard Purdie

The task-core namespace was dropped years ago and we've had the compatibility mappings for a long time. We should no longer need them as everyone should long since have adapted.

---
 .../packagegroup-core-full-cmdline.bb         | 35 -------------------
 1 file changed, 35 deletions(-)
meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb +0 -35
index c0647b21883..b66617fbf61 100644
@@ -18,41 +18,6 @@ PACKAGES = "\
     packagegroup-core-full-cmdline-sys-services \
     "
 
-python __anonymous () {
-    # For backwards compatibility after rename
-    namemap = {}
-    namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic"
-    namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils"
-    namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended"
-    namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils"
-    namemap["packagegroup-core-full-cmdline-multiuser"] = "packagegroup-core-multiuser"
-    namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts"
-    namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services"
-
-    packages = d.getVar("PACKAGES").split()
-    mlprefix = d.getVar("MLPREFIX")
-    for pkg in packages:
-        pkg2 = pkg[len(mlprefix):]
-        if pkg.endswith('-dev'):
-            mapped = namemap.get(pkg2[:-4], None)
-            if mapped:
-                mapped += '-dev'
-        elif pkg.endswith('-dbg'):
-            mapped = namemap.get(pkg2[:-4], None)
-            if mapped:
-                mapped += '-dbg'
-        else:
-            mapped = namemap.get(pkg2, None)
-
-        if mapped:
-            oldtaskname = mapped.replace("packagegroup-core", "task-core")
-            mapstr = " %s%s %s%s" % (mlprefix, mapped, mlprefix, oldtaskname)
-            d.appendVar("RPROVIDES:%s" % pkg, mapstr)
-            d.appendVar("RREPLACES:%s" % pkg, mapstr)
-            d.appendVar("RCONFLICTS:%s" % pkg, mapstr)
-}
-
-
 RDEPENDS:packagegroup-core-full-cmdline = "\
     packagegroup-core-full-cmdline-utils \
     packagegroup-core-full-cmdline-extended \
Signature · 1 line
2.32.0
#3 lore raw

PATCH 4/4 package: Add sanity check for allarch packagegroups

In reply to Richard Purdie

We exclude allarch packagegroups from rebuilding when their dependencies change. The reasoning is that we are just depending on a name so having these rebuild lots is just pointless and inefficient. We also don't want them duplicated for multiple machines for efficiency.

In general this works fine, as long as the package names don't change. That is also rare but there is one corner case which does catch users out - debian package renaming. When this does break, users question sstate and so on and lose faith in the system even if this is a known choice we made.

This commit adds an error message if an allarch packagegroup depends on any package which shows package renaming in action (through the PKG variable being set).

If you run into this issue you either need to remove the dependency from the packagegroup or mark the packagegroup as tune specific, i.e. set:

PACKAGE_ARCH = "${TUNE_PKGARCH}"

before the packagegroup inherit.

[YOCTO #7298]

---
 meta/classes/package.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/package.bbclass +2 -0
index 92eba988929..84eafbd5293 100644
@@ -619,6 +619,8 @@ def get_package_mapping (pkg, basepkg, d, depversions=None):
     key = "PKG:%s" % pkg
 
     if key in data:
+        if bb.data.inherits_class('allarch', d) and bb.data.inherits_class('packagegroup', d) and pkg != data[key]:
+            bb.error("An allarch packagegroup shouldn't depend on packages which are dynamically renamed (%s to %s)" % (pkg, data[key]))
         # Have to avoid undoing the write_extra_pkgs(global_variants...)
         if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
             and data[key] == basepkg:
Signature · 1 line
2.32.0