summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-06 11:46:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 22:26:38 +0100
commitc49991441c9a5bf0d0ec2dd951e4ad2d76a42eca (patch)
tree319ffdc4ffc1ad9ed5430e3a7b4ba52053529049
parentbb4dd2e54d775d2d4b6cbc1b8ee528d6e9154128 (diff)
downloadpoky-c49991441c9a5bf0d0ec2dd951e4ad2d76a42eca.tar.gz
base: Add deferred class event handler
Use the new deferred class event to set the class overrides earlier. This improves interaction of the override with PACKAGECONFIG values that control conditional inherits (such as python support). This also allows toolchain configuration in an easier and more user friendly way. (From OE-Core rev: d58f94d5684332bd4fac3747688558bb261b9c63) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/base.bbclass11
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 8215969c7b..4ac3b83eb5 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -267,10 +267,19 @@ def buildcfg_neededvars(d):
267 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) 267 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
268 268
269addhandler base_eventhandler 269addhandler base_eventhandler
270base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.MultiConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.event.RecipeParsed" 270base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.MultiConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.event.RecipeParsed bb.event.RecipePreDeferredInherits"
271python base_eventhandler() { 271python base_eventhandler() {
272 import bb.runqueue 272 import bb.runqueue
273 273
274 if isinstance(e, bb.event.RecipePreDeferredInherits):
275 # Use this to snoop on class extensions and set these up before the deferred inherits
276 # are processed which allows overrides on conditional variables.
277 for c in ['native', 'nativesdk', 'crosssdk', 'cross']:
278 if c in e.inherits:
279 d.setVar('CLASSOVERRIDE', 'class-' + c)
280 break
281 return
282
274 if isinstance(e, bb.event.ConfigParsed): 283 if isinstance(e, bb.event.ConfigParsed):
275 if not d.getVar("NATIVELSBSTRING", False): 284 if not d.getVar("NATIVELSBSTRING", False):
276 d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d)) 285 d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d))