diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-15 18:03:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-18 10:06:26 +0100 |
commit | b50b14e37249fb23b8e4f3a86f9b245cba85ca86 (patch) | |
tree | 9e7becee9892a76b9468513414c2e257290fde22 /bitbake/bin | |
parent | b176189df1163d92aaec8b565bf69dcf76bab458 (diff) | |
download | poky-b50b14e37249fb23b8e4f3a86f9b245cba85ca86.tar.gz |
bitbake: 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.
(Bitbake rev: fef18b445c0cb6b266cd939b9c78d7cbce38663f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake-worker | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 963b4cdf93..1926b89882 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -115,7 +115,7 @@ def sigterm_handler(signum, frame): | |||
115 | os.killpg(0, signal.SIGTERM) | 115 | os.killpg(0, signal.SIGTERM) |
116 | sys.exit() | 116 | sys.exit() |
117 | 117 | ||
118 | def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False): | 118 | def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False): |
119 | # We need to setup the environment BEFORE the fork, since | 119 | # We need to setup the environment BEFORE the fork, since |
120 | # a fork() or exec*() activates PSEUDO... | 120 | # a fork() or exec*() activates PSEUDO... |
121 | 121 | ||
@@ -193,15 +193,18 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat | |||
193 | if umask: | 193 | if umask: |
194 | os.umask(umask) | 194 | os.umask(umask) |
195 | 195 | ||
196 | data.setVar("BB_WORKERCONTEXT", "1") | ||
197 | data.setVar("BB_TASKDEPDATA", taskdepdata) | ||
198 | data.setVar("BUILDNAME", workerdata["buildname"]) | ||
199 | data.setVar("DATE", workerdata["date"]) | ||
200 | data.setVar("TIME", workerdata["time"]) | ||
201 | bb.parse.siggen.set_taskdata(workerdata["sigdata"]) | ||
202 | ret = 0 | ||
203 | try: | 196 | try: |
204 | the_data = bb.cache.Cache.loadDataFull(fn, appends, data) | 197 | bb_cache = bb.cache.NoCache(databuilder) |
198 | the_data = databuilder.data | ||
199 | the_data.setVar("BB_WORKERCONTEXT", "1") | ||
200 | the_data.setVar("BB_TASKDEPDATA", taskdepdata) | ||
201 | the_data.setVar("BUILDNAME", workerdata["buildname"]) | ||
202 | the_data.setVar("DATE", workerdata["date"]) | ||
203 | the_data.setVar("TIME", workerdata["time"]) | ||
204 | bb.parse.siggen.set_taskdata(workerdata["sigdata"]) | ||
205 | ret = 0 | ||
206 | |||
207 | the_data = bb_cache.loadDataFull(fn, appends) | ||
205 | the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task]) | 208 | the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task]) |
206 | 209 | ||
207 | bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN", True), taskname.replace("do_", ""))) | 210 | bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN", True), taskname.replace("do_", ""))) |
@@ -389,7 +392,7 @@ class BitbakeWorker(object): | |||
389 | fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data) | 392 | fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data) |
390 | workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname)) | 393 | workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname)) |
391 | 394 | ||
392 | pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors) | 395 | pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors) |
393 | 396 | ||
394 | self.build_pids[pid] = task | 397 | self.build_pids[pid] = task |
395 | self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout) | 398 | self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout) |