summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-07 18:11:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-12 17:48:51 +0100
commitb2e26f1db28d74f2dd9df8ab4ed3b472503b9a5c (patch)
treece5edd4913e340a5b8f0dbbfb66ed8487c8b4c07 /lib/bb/event.py
parentad8bf10d873abb94d987860a3f6d06b134fb8a99 (diff)
downloadbitbake-contrib-b2e26f1db28d74f2dd9df8ab4ed3b472503b9a5c.tar.gz
runqueue: Split runqueue to use bitbake-worker
This is a pretty fundamental change to the way bitbake operates. It splits out the task execution part of runqueue into a completely separately exec'd process called bitbake-worker. This means that the separate process has to build its own datastore and that configuration needs to be passed from the cooker over to the bitbake worker process. Known issues: * Hob is broken with this patch since it writes to the configuration and that configuration isn't preserved in bitbake-worker. * We create a worker for setscene, then a new worker for the main task execution. This is wasteful but shouldn't be hard to fix. * We probably send too much data over to bitbake-worker, need to see if we can streamline it. These are issues which will be followed up in subsequent patches. This patch sets the groundwork for the removal of the double bitbake execution for psuedo which will be in a follow on patch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index 2826e3554..d73067fcf 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -33,11 +33,12 @@ import atexit
import traceback
import bb.utils
import bb.compat
+import bb.exceptions
# This is the pid for which we should generate the event. This is set when
# the runqueue forks off.
worker_pid = 0
-worker_pipe = None
+worker_fire = None
logger = logging.getLogger('BitBake.Event')
@@ -150,20 +151,12 @@ def fire(event, d):
# don't have a datastore so the datastore context isn't a problem.
fire_class_handlers(event, d)
- if worker_pid != 0:
+ if worker_fire:
worker_fire(event, d)
else:
fire_ui_handlers(event, d)
-def worker_fire(event, d):
- data = "<event>" + pickle.dumps(event) + "</event>"
- worker_pipe.write(data)
-
def fire_from_worker(event, d):
- if not event.startswith("<event>") or not event.endswith("</event>"):
- print("Error, not an event %s" % event)
- return
- event = pickle.loads(event[7:-8])
fire_ui_handlers(event, d)
noop = lambda _: None