summaryrefslogtreecommitdiffstats
path: root/bitbake/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-16 11:26:11 +0000
commit8b792d4f75b451f9e08fdb13464a0b66c11bc075 (patch)
tree0f02eba054c6eb9b498be77ef70e53fbda04b064 /bitbake/lib/bb/parse/ast.py
parentf162c34fdba51902abb9e8fb79ddc5044deab275 (diff)
downloadpoky-8b792d4f75b451f9e08fdb13464a0b66c11bc075.tar.gz
bitbake: 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. (Bitbake rev: 5f7fdf7b2d8c59805c8ef4dae84f536baa5e172b) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 0596993d01..50a88f7da7 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -335,7 +335,7 @@ def finalize(fn, d, variant = None):
335 if not handlerfn: 335 if not handlerfn:
336 bb.fatal("Undefined event handler function '%s'" % var) 336 bb.fatal("Undefined event handler function '%s'" % var)
337 handlerln = int(d.getVarFlag(var, "lineno", False)) 337 handlerln = int(d.getVarFlag(var, "lineno", False))
338 bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln) 338 bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln, data=d)
339 339
340 bb.event.fire(bb.event.RecipePreFinalise(fn), d) 340 bb.event.fire(bb.event.RecipePreFinalise(fn), d)
341 341