aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorTomasz Dziendzielski <tomasz.dziendzielski@gmail.com>2021-02-10 12:15:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-11 17:52:11 +0000
commit5f7fdf7b2d8c59805c8ef4dae84f536baa5e172b (patch)
tree02d019adda729e1e9817416d021fa533da50b750 /lib/bb/parse/ast.py
parent9f23fa605c542a705d00c6c263491899d55bb0d9 (diff)
downloadbitbake-5f7fdf7b2d8c59805c8ef4dae84f536baa5e172b.tar.gz
event: Prevent bitbake from executing event handler for wrong multiconfig target
When multiconfig is used bitbake might try to run events that don't exist for specific mc target. In cooker.py we pass `self.databuilder.mcdata[mc]` data that contains names of events' handlers per mc target, but fire_class_handlers uses global _handlers variable that is created during parsing of all the targets. This leads to a problem where bitbake runs event handler that don't exist for a target or even overrides them - if multiple targets use event handler with the same name but different code then only one version will be executed for all targets. See [YOCTO #13071] for detailed bug information. Add mc target name as a prefix to event handler name so there won't be two different handlers with the same name. Add internal __BBHANDLERS_MC variable to have the handlers lists per machine. Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 0596993d0..50a88f7da 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -335,7 +335,7 @@ def finalize(fn, d, variant = None):
if not handlerfn:
bb.fatal("Undefined event handler function '%s'" % var)
handlerln = int(d.getVarFlag(var, "lineno", False))
- bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
+ bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln, data=d)
bb.event.fire(bb.event.RecipePreFinalise(fn), d)