summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-06 11:45:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 22:23:18 +0100
commite20af03c0210a0a0af1a5daad7cf859ea3e70cc5 (patch)
tree40bc07367332f3e7ca25cd5632dc4fd1985514b9 /bitbake
parentf2a15854e2ed9d6e5be395bfe2b92f8fed6f897a (diff)
downloadpoky-e20af03c0210a0a0af1a5daad7cf859ea3e70cc5.tar.gz
bitbake: event: Add event for deferred inherits
Now that deferred inherits are extension specific, we can pass this list to an event, which our metadata can use to set class overrides earlier (as an example). There are limitations to this, the list of classes is unexpanded and recursive classes are not visible. There isn't much that can be done about this, the ones we are interested in would usually be visible at the top level (such as class extensions). (Bitbake rev: 205d461c05fc7b4a7c81039af3bc3fd71cbb982c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/event.py10
-rw-r--r--bitbake/lib/bb/parse/ast.py3
2 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index a12adbc937..b29f0a5568 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -431,6 +431,16 @@ class RecipeEvent(Event):
431 self.fn = fn 431 self.fn = fn
432 Event.__init__(self) 432 Event.__init__(self)
433 433
434class RecipePreDeferredInherits(RecipeEvent):
435 """
436 Called before deferred inherits are processed so code can snoop on class extensions for example
437 Limitations: It won't see inherits of inherited classes and the data is unexpanded
438 """
439 def __init__(self, fn, inherits):
440 self.fn = fn
441 self.inherits = inherits
442 Event.__init__(self)
443
434class RecipePreFinalise(RecipeEvent): 444class RecipePreFinalise(RecipeEvent):
435 """ Recipe Parsing Complete but not yet finalised""" 445 """ Recipe Parsing Complete but not yet finalised"""
436 446
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index f9998798d8..5a086b4e95 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -471,6 +471,9 @@ def finalize(fn, d, variant = None):
471 if d.getVar("_FAILPARSINGERRORHANDLED", False) == True: 471 if d.getVar("_FAILPARSINGERRORHANDLED", False) == True:
472 raise bb.BBHandledException() 472 raise bb.BBHandledException()
473 473
474 inherits = [x[0] for x in (d.getVar('__BBDEFINHERITS', False) or [('',)])]
475 bb.event.fire(bb.event.RecipePreDeferredInherits(fn, inherits), d)
476
474 while True: 477 while True:
475 inherits = d.getVar('__BBDEFINHERITS', False) or [] 478 inherits = d.getVar('__BBDEFINHERITS', False) or []
476 if not inherits: 479 if not inherits: