Patchwork [bitbake-devel] Remove global scope class event handlers

mail settings
Submitter Richard Purdie
Date May 23, 2013, 9:48 a.m.
Message ID <1369302506.14887.27.camel@ted>
Download mbox | patch
Permalink /patch/50383/
State New
Headers show


Richard Purdie - May 23, 2013, 9:48 a.m.
Its confusing when an event handler in for example a bbclass receives
events for a recipe which doesn't use the class. This is due to the
class event handlers having confusing scope. Worse, the issue is not
deterministic and the events a handler will see depends on the parse

To avoid these issues, remove the class event handler global scope
and only have class handlers recieve events for recipes using the

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index eed489f..41f70ab 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -1455,6 +1455,7 @@  class Parser(multiprocessing.Process):
         self.init = init
         self.context = bb.utils._context.copy()
+        self.handlers = bb.event._handlers.copy()
     def run(self):
         if self.init:
@@ -1490,6 +1491,7 @@  class Parser(multiprocessing.Process):
     def parse(self, filename, appends, caches_array):
             bb.utils._context = self.context.copy()
+            bb.event._handlers = self.handlers.copy()
             return True, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array)
         except Exception as exc:
             tb = sys.exc_info()[2]