Skip to contentSkip to conversation

package/classextend: Extend package variables for a multilib variant

PATCH RESEND 정재윤/Task Leader/SW Platform(연)선행Platform개발실 Lightweight System Task 1 participant 1 message Apr 22 1 message not in the archive

lore
Share & tools
lore

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

#1 lore raw

Hi,

I resent the patch about a week ago, but I don't see it in any branch at the moment, so I'm wondering if it might have been missed again. I can resend it if necessary but wanted to check if there is anything missing from my submission.

Best regards,
---
Jaeyoon Jung
Software Platform Lab. / Corporate R&D / LG Electronics Inc.

________________________________
From: [email protected] <[email protected]> on behalf of Jaeyoon Jung (LGE) via lists.openembedded.org <[email protected]>
Sent: Wednesday, April 15, 2026 07:14
To: [email protected] <[email protected]>
Cc: 정재윤/Task Leader/SW Platform(연)선행Platform개발실 Lightweight System Task <[email protected]>; Mathieu Dubois-Briand <[email protected]>
Subject: [OE-core] [RESEND PATCH] package/classextend: Extend package variables for a multilib variant

From: Jaeyoon Jung <[email protected]>

It extends package variables in case missing for a dynamic package added during do_split_packages. It's needed for a multilib build where some per-package variables should be treated as multilib variants.

---
 meta/classes-global/package.bbclass | 11 +++++++++++
 meta/lib/oe/classextend.py          |  5 +++--
 2 files changed, 14 insertions(+), 2 deletions(-)
meta/classes-global/package.bbclass +11 -0
index 67148fc1ac..cfadd36c16 100644
@@ -169,6 +169,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
 
     for o in sorted(objs):
         import re, stat
+        import oe.package
         if match_path:
             m = re.match(file_regex, o)
         else:
@@ -225,6 +226,16 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
             hook(f, pkg, file_regex, output_pattern, m.group(1))
 
     d.setVar('PACKAGES', ' '.join(packages))
+
+    variant = d.getVar("BBEXTENDVARIANT")
+    prefixes = (d.getVar("MULTILIB_VARIANTS") or "").split()
+    if variant and prefixes:
+        import oe.classextend
+
+        # Extend package variables for the given variant if unset
+        clsextend = oe.classextend.ClassExtender(variant, prefixes, d)
+        clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split(), overwrite=False)
+
     return list(split_packages)
 
 PACKAGE_DEPENDS += "file-native"
meta/lib/oe/classextend.py +3 -2
index ddca10dee5..8b9602e316 100644
@@ -128,7 +128,7 @@ class ClassExtender(object):
         self.set_filter("RCONFLICTS", deps=True)
         self.set_filter("PKG", deps=True)
 
-    def rename_package_variables(self, variables):
+    def rename_package_variables(self, variables, overwrite=True):
         pkgs_mapping = get_package_mappings(self.d.getVar('PACKAGES'), self.extname)
         self.d.setVarFilter('PACKAGES', "package_suffix_filter(val, '" + self.extname + "')")
         self.d.setVarFilter('PACKAGES_DYNAMIC', "suffix_filter_regex(val, '" + self.extname + "', " + str(self.prefixes) + ")")
@@ -137,4 +137,5 @@ class ClassExtender(object):
             if pkg_mapping[0].startswith("${") and pkg_mapping[0].endswith("}"):
                 continue
             for subs in variables:
-                self.d.renameVar("%s:%s" % (subs, pkg_mapping[0]), "%s:%s" % (subs, pkg_mapping[1]))
+                if overwrite or not self.d.getVar("%s:%s" % (subs, pkg_mapping[1])):
+                    self.d.renameVar("%s:%s" % (subs, pkg_mapping[0]), "%s:%s" % (subs, pkg_mapping[1]))