summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.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/runqueue.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/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 2f521e5a14..b8b217c64a 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1466,7 +1466,7 @@ class RunQueue:
1466 if not self.dm_event_handler_registered: 1466 if not self.dm_event_handler_registered:
1467 res = bb.event.register(self.dm_event_handler_name, 1467 res = bb.event.register(self.dm_event_handler_name,
1468 lambda x: self.dm.check(self) if self.state in [runQueueRunning, runQueueCleanUp] else False, 1468 lambda x: self.dm.check(self) if self.state in [runQueueRunning, runQueueCleanUp] else False,
1469 ('bb.event.HeartbeatEvent',)) 1469 ('bb.event.HeartbeatEvent',), data=self.cfgData)
1470 self.dm_event_handler_registered = True 1470 self.dm_event_handler_registered = True
1471 1471
1472 dump = self.cooker.configuration.dump_signatures 1472 dump = self.cooker.configuration.dump_signatures
@@ -1505,7 +1505,7 @@ class RunQueue:
1505 build_done = self.state is runQueueComplete or self.state is runQueueFailed 1505 build_done = self.state is runQueueComplete or self.state is runQueueFailed
1506 1506
1507 if build_done and self.dm_event_handler_registered: 1507 if build_done and self.dm_event_handler_registered:
1508 bb.event.remove(self.dm_event_handler_name, None) 1508 bb.event.remove(self.dm_event_handler_name, None, data=self.cfgData)
1509 self.dm_event_handler_registered = False 1509 self.dm_event_handler_registered = False
1510 1510
1511 if build_done and self.rqexe: 1511 if build_done and self.rqexe: