Skip to contentSkip to conversation

package/classextend: Extend package variables for a multilib variant

PATCH 정재윤/Task Leader/SW Platform(연)선행Platform개발실 Lightweight System Task 2 participants 2 messages Mar 12 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 noticed that this hasn't been accepted yet, nor marked as needing improvement. Should I resend it rebased to the latest HEAD?

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: Thursday, February 12, 2026 20:30
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; 정재윤/Task Leader/SW Platform(연)선행Platform개발실 Lightweight System Task <[email protected]>
Subject: [OE-core] [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 bd32a6ede5..1d779f714b 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]))

--
2.47.2

#2 lore raw
Quoted 4 lines · Jaeyoon Jung (LGE) via lists.openembedded.org

Hi,

I noticed that this hasn't been accepted yet, nor marked as needing improvement. Should I resend it rebased to the latest HEAD?

Yes, I guess it got lost somewhere.
The simplest solution is for you to rebase/resend.

Thanks!

Quoted 77 lines

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: Thursday, February 12, 2026 20:30
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; 정재윤/Task Leader/SW Platform(연)선행Platform개발실 Lightweight System Task <[email protected]>
Subject: [OE-core] [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 bd32a6ede5..1d779f714b 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 -3
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]))
--

2.47.2

Signature · 2 lines
Yoann Congal
Smile ECS