Skip to contentSkip to conversation

event: Prevent bitbake from executing events that don't exist for multiconfig target

PATCH Superseded Tomasz Dziendzielski 1 participant 1 message Feb 3, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event: Prevent bitbake from executing events that don't exist for 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.

See [YOCTO #13071] for detailed bug information.

I added a condition to check if the handler exists for target using __BBHANDLERS variable.

---
 lib/bb/event.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/event.py +1 -1
index 694b4705..bfc1e67c 100644
@@ -114,7 +114,7 @@ def fire_class_handlers(event, d):
     eid = str(event.__class__)[8:-2]
     evt_hmap = _event_handler_map.get(eid, {})
     for name, handler in list(_handlers.items()):
-        if name in _catchall_handlers or name in evt_hmap:
+        if name in d.getVar("__BBHANDLERS") and (name in _catchall_handlers or name in evt_hmap):
             if _eventfilter:
                 if not _eventfilter(name, handler, event, d):
                     continue
Signature · 1 line
2.30.0