diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-07 18:11:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-14 12:52:56 +0100 |
commit | d0f0e5d9e69cc22f0c6635c7e416de93660c6bca (patch) | |
tree | 1877f962137e31bbf93be5c13763488fb2321886 /bitbake/lib/bb/event.py | |
parent | cd7b7de91a98e712e796a8d6a3a8e3741950396e (diff) | |
download | poky-d0f0e5d9e69cc22f0c6635c7e416de93660c6bca.tar.gz |
bitbake: 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.
(Bitbake rev: b2e26f1db28d74f2dd9df8ab4ed3b472503b9a5c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r-- | bitbake/lib/bb/event.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 2826e3554f..d73067fcf9 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -33,11 +33,12 @@ import atexit | |||
33 | import traceback | 33 | import traceback |
34 | import bb.utils | 34 | import bb.utils |
35 | import bb.compat | 35 | import bb.compat |
36 | import bb.exceptions | ||
36 | 37 | ||
37 | # This is the pid for which we should generate the event. This is set when | 38 | # This is the pid for which we should generate the event. This is set when |
38 | # the runqueue forks off. | 39 | # the runqueue forks off. |
39 | worker_pid = 0 | 40 | worker_pid = 0 |
40 | worker_pipe = None | 41 | worker_fire = None |
41 | 42 | ||
42 | logger = logging.getLogger('BitBake.Event') | 43 | logger = logging.getLogger('BitBake.Event') |
43 | 44 | ||
@@ -150,20 +151,12 @@ def fire(event, d): | |||
150 | # don't have a datastore so the datastore context isn't a problem. | 151 | # don't have a datastore so the datastore context isn't a problem. |
151 | 152 | ||
152 | fire_class_handlers(event, d) | 153 | fire_class_handlers(event, d) |
153 | if worker_pid != 0: | 154 | if worker_fire: |
154 | worker_fire(event, d) | 155 | worker_fire(event, d) |
155 | else: | 156 | else: |
156 | fire_ui_handlers(event, d) | 157 | fire_ui_handlers(event, d) |
157 | 158 | ||
158 | def worker_fire(event, d): | ||
159 | data = "<event>" + pickle.dumps(event) + "</event>" | ||
160 | worker_pipe.write(data) | ||
161 | |||
162 | def fire_from_worker(event, d): | 159 | def fire_from_worker(event, d): |
163 | if not event.startswith("<event>") or not event.endswith("</event>"): | ||
164 | print("Error, not an event %s" % event) | ||
165 | return | ||
166 | event = pickle.loads(event[7:-8]) | ||
167 | fire_ui_handlers(event, d) | 160 | fire_ui_handlers(event, d) |
168 | 161 | ||
169 | noop = lambda _: None | 162 | noop = lambda _: None |