summaryrefslogtreecommitdiffstats
path: root/meta/classes/multilib.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-15 16:25:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-27 10:47:05 +0100
commitedbf8d3999126e3c271a47dada54d1724f59f573 (patch)
tree98f7ca63aba6fa135555406454a7d4fcb78f4159 /meta/classes/multilib.bbclass
parent706b623c12f4576805e999ece91acf89ea22e5ef (diff)
downloadpoky-edbf8d3999126e3c271a47dada54d1724f59f573.tar.gz
multilib/recipes: Use new RecipePostKeyExpansion event
There are issues with multilib due to the ordering of events where some functions see the remapped multilib dependencies and some do not. A significant problem is that the multilib class needs to make some changes before key expansion and some afterwards but by using existing event handlers, some code sees things in a partially translated state, leading to bugs. This patch changes things to use a new event handler from bitbake which makes the ordering of the changes explcit. The challenge in doing this is that it breaks some existing anonymous python and dyanmic assignments. In some cases these used to be translated and no longer are, meaning MLPREFIX has to be added. In some cases these are now translated and the MLPREFIX can be removed. This change does now make it very clear when MLPREFIX is required and when it is not, its just the migration path which is harder. The patch changes the small number of cases where fixes are needed. In particular, where a variable like RDEPENDS is conditionally extended (e.g. with an override), MLPREFIX is now required. This patch also reverts: base: Revert 'base.bbclass: considering multilib when setting LICENSE_EXCLUSION' This reverts 6597130256a1609c3e05ec5891aceaf549c37985 as the changes to multilib datastore handling mean its no longer necessary. (From OE-Core rev: b3fda056a674889cd9697e779de023d4f993d3ce) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/multilib.bbclass')
-rw-r--r--meta/classes/multilib.bbclass28
1 files changed, 23 insertions, 5 deletions
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index ee677da1e2..9f726e4537 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -91,13 +91,12 @@ addhandler multilib_virtclass_handler
91multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" 91multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
92 92
93python __anonymous () { 93python __anonymous () {
94 variant = d.getVar("BBEXTENDVARIANT") 94 if bb.data.inherits_class('image', d):
95 95 variant = d.getVar("BBEXTENDVARIANT")
96 import oe.classextend 96 import oe.classextend
97 97
98 clsextend = oe.classextend.ClassExtender(variant, d) 98 clsextend = oe.classextend.ClassExtender(variant, d)
99 99
100 if bb.data.inherits_class('image', d):
101 clsextend.map_depends_variable("PACKAGE_INSTALL") 100 clsextend.map_depends_variable("PACKAGE_INSTALL")
102 clsextend.map_depends_variable("LINGUAS_INSTALL") 101 clsextend.map_depends_variable("LINGUAS_INSTALL")
103 clsextend.map_depends_variable("RDEPENDS") 102 clsextend.map_depends_variable("RDEPENDS")
@@ -109,6 +108,22 @@ python __anonymous () {
109 bb.build.deltask('do_populate_sdk', d) 108 bb.build.deltask('do_populate_sdk', d)
110 bb.build.deltask('do_populate_sdk_ext', d) 109 bb.build.deltask('do_populate_sdk_ext', d)
111 return 110 return
111}
112
113python multilib_virtclass_handler_postkeyexp () {
114 cls = d.getVar("BBEXTENDCURR")
115 variant = d.getVar("BBEXTENDVARIANT")
116 if cls != "multilib" or not variant:
117 return
118
119 variant = d.getVar("BBEXTENDVARIANT")
120
121 import oe.classextend
122
123 clsextend = oe.classextend.ClassExtender(variant, d)
124
125 if bb.data.inherits_class('image', d):
126 return
112 127
113 clsextend.map_depends_variable("DEPENDS") 128 clsextend.map_depends_variable("DEPENDS")
114 clsextend.map_variable("PROVIDES") 129 clsextend.map_variable("PROVIDES")
@@ -129,6 +144,9 @@ python __anonymous () {
129 reset_alternative_priority(d) 144 reset_alternative_priority(d)
130} 145}
131 146
147addhandler multilib_virtclass_handler_postkeyexp
148multilib_virtclass_handler_postkeyexp[eventmask] = "bb.event.RecipePostKeyExpansion"
149
132def reset_alternative_priority(d): 150def reset_alternative_priority(d):
133 if not bb.data.inherits_class('update-alternatives', d): 151 if not bb.data.inherits_class('update-alternatives', d):
134 return 152 return