summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cookerdata.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-14 12:52:56 +0100
commitd0f0e5d9e69cc22f0c6635c7e416de93660c6bca (patch)
tree1877f962137e31bbf93be5c13763488fb2321886 /bitbake/lib/bb/cookerdata.py
parentcd7b7de91a98e712e796a8d6a3a8e3741950396e (diff)
downloadpoky-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/cookerdata.py')
-rw-r--r--bitbake/lib/bb/cookerdata.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 149878f402..1bed455d16 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -25,7 +25,9 @@
25import os, sys 25import os, sys
26from functools import wraps 26from functools import wraps
27import logging 27import logging
28import bb
28from bb import data 29from bb import data
30import bb.parse
29 31
30logger = logging.getLogger("BitBake") 32logger = logging.getLogger("BitBake")
31parselog = logging.getLogger("BitBake.Parsing") 33parselog = logging.getLogger("BitBake.Parsing")
@@ -139,6 +141,20 @@ class CookerConfiguration(object):
139 def setServerRegIdleCallback(self, srcb): 141 def setServerRegIdleCallback(self, srcb):
140 self.server_register_idlecallback = srcb 142 self.server_register_idlecallback = srcb
141 143
144 def __getstate__(self):
145 state = {}
146 for key in self.__dict__.keys():
147 if key == "server_register_idlecallback":
148 state[key] = None
149 else:
150 state[key] = getattr(self, key)
151 return state
152
153 def __setstate__(self,state):
154 for k in state:
155 setattr(self, k, state[k])
156
157
142def catch_parse_error(func): 158def catch_parse_error(func):
143 """Exception handling bits for our parsing""" 159 """Exception handling bits for our parsing"""
144 @wraps(func) 160 @wraps(func)
@@ -146,6 +162,8 @@ def catch_parse_error(func):
146 try: 162 try:
147 return func(fn, *args) 163 return func(fn, *args)
148 except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: 164 except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
165 import traceback
166 parselog.critical( traceback.format_exc())
149 parselog.critical("Unable to parse %s: %s" % (fn, exc)) 167 parselog.critical("Unable to parse %s: %s" % (fn, exc))
150 sys.exit(1) 168 sys.exit(1)
151 return wrapped 169 return wrapped