summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-15 18:03:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:23:01 +0100
commitfef18b445c0cb6b266cd939b9c78d7cbce38663f (patch)
tree331a3b8e2203b817f2dd3f05584703de79b64563 /bin
parent120b64ea6a0c0ecae7af0fd15d989934fa4f1c36 (diff)
downloadbitbake-contrib-fef18b445c0cb6b266cd939b9c78d7cbce38663f.zip
bitbake-contrib-fef18b445c0cb6b266cd939b9c78d7cbce38663f.tar.gz
bitbake-contrib-fef18b445c0cb6b266cd939b9c78d7cbce38663f.tar.bz2
cache: Build datastores from databuilder object
Rather than passing in a datastore to build on top of, use the data builder object in the cache and base the parsed recipe from this. This turns things into proper objects building from one another rather than messy mixes of static and class functions. This sets things up so we can support parsing and building multiple configurations. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bitbake-worker23
1 files changed, 13 insertions, 10 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 963b4cd..1926b89 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -115,7 +115,7 @@ def sigterm_handler(signum, frame):
os.killpg(0, signal.SIGTERM)
sys.exit()
-def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False):
+def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False):
# We need to setup the environment BEFORE the fork, since
# a fork() or exec*() activates PSEUDO...
@@ -193,15 +193,18 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
if umask:
os.umask(umask)
- data.setVar("BB_WORKERCONTEXT", "1")
- data.setVar("BB_TASKDEPDATA", taskdepdata)
- data.setVar("BUILDNAME", workerdata["buildname"])
- data.setVar("DATE", workerdata["date"])
- data.setVar("TIME", workerdata["time"])
- bb.parse.siggen.set_taskdata(workerdata["sigdata"])
- ret = 0
try:
- the_data = bb.cache.Cache.loadDataFull(fn, appends, data)
+ bb_cache = bb.cache.NoCache(databuilder)
+ the_data = databuilder.data
+ the_data.setVar("BB_WORKERCONTEXT", "1")
+ the_data.setVar("BB_TASKDEPDATA", taskdepdata)
+ the_data.setVar("BUILDNAME", workerdata["buildname"])
+ the_data.setVar("DATE", workerdata["date"])
+ the_data.setVar("TIME", workerdata["time"])
+ bb.parse.siggen.set_taskdata(workerdata["sigdata"])
+ ret = 0
+
+ the_data = bb_cache.loadDataFull(fn, appends)
the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN", True), taskname.replace("do_", "")))
@@ -389,7 +392,7 @@ class BitbakeWorker(object):
fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data)
workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
- pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
+ pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
self.build_pids[pid] = task
self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)