diff options
| -rwxr-xr-x | bitbake/bin/bitbake-worker | 8 | ||||
| -rw-r--r-- | bitbake/lib/bb/runqueue.py | 15 |
2 files changed, 10 insertions, 13 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index e925054b7f..cd687e6e43 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
| @@ -136,7 +136,7 @@ def sigterm_handler(signum, frame): | |||
| 136 | os.killpg(0, signal.SIGTERM) | 136 | os.killpg(0, signal.SIGTERM) |
| 137 | sys.exit() | 137 | sys.exit() |
| 138 | 138 | ||
| 139 | def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, extraconfigdata, quieterrors=False, dry_run_exec=False): | 139 | def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskhash, appends, taskdepdata, extraconfigdata, quieterrors=False, dry_run_exec=False): |
| 140 | # We need to setup the environment BEFORE the fork, since | 140 | # We need to setup the environment BEFORE the fork, since |
| 141 | # a fork() or exec*() activates PSEUDO... | 141 | # a fork() or exec*() activates PSEUDO... |
| 142 | 142 | ||
| @@ -234,7 +234,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append | |||
| 234 | ret = 0 | 234 | ret = 0 |
| 235 | 235 | ||
| 236 | the_data = bb_cache.loadDataFull(fn, appends) | 236 | the_data = bb_cache.loadDataFull(fn, appends) |
| 237 | the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task]) | 237 | the_data.setVar('BB_TASKHASH', taskhash) |
| 238 | 238 | ||
| 239 | bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", ""))) | 239 | bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", ""))) |
| 240 | 240 | ||
| @@ -425,10 +425,10 @@ class BitbakeWorker(object): | |||
| 425 | sys.exit(0) | 425 | sys.exit(0) |
| 426 | 426 | ||
| 427 | def handle_runtask(self, data): | 427 | def handle_runtask(self, data): |
| 428 | fn, task, taskname, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data) | 428 | fn, task, taskname, taskhash, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data) |
| 429 | workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname)) | 429 | workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname)) |
| 430 | 430 | ||
| 431 | pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, self.extraconfigdata, quieterrors, dry_run_exec) | 431 | pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, taskhash, appends, taskdepdata, self.extraconfigdata, quieterrors, dry_run_exec) |
| 432 | 432 | ||
| 433 | self.build_pids[pid] = task | 433 | self.build_pids[pid] = task |
| 434 | self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout) | 434 | self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout) |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 4d5d876797..f2b95a9829 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
| @@ -1224,17 +1224,12 @@ class RunQueue: | |||
| 1224 | bb.utils.nonblockingfd(worker.stdout) | 1224 | bb.utils.nonblockingfd(worker.stdout) |
| 1225 | workerpipe = runQueuePipe(worker.stdout, None, self.cfgData, self, rqexec) | 1225 | workerpipe = runQueuePipe(worker.stdout, None, self.cfgData, self, rqexec) |
| 1226 | 1226 | ||
| 1227 | runqhash = {} | ||
| 1228 | for tid in self.rqdata.runtaskentries: | ||
| 1229 | runqhash[tid] = self.rqdata.runtaskentries[tid].hash | ||
| 1230 | |||
| 1231 | workerdata = { | 1227 | workerdata = { |
| 1232 | "taskdeps" : self.rqdata.dataCaches[mc].task_deps, | 1228 | "taskdeps" : self.rqdata.dataCaches[mc].task_deps, |
| 1233 | "fakerootenv" : self.rqdata.dataCaches[mc].fakerootenv, | 1229 | "fakerootenv" : self.rqdata.dataCaches[mc].fakerootenv, |
| 1234 | "fakerootdirs" : self.rqdata.dataCaches[mc].fakerootdirs, | 1230 | "fakerootdirs" : self.rqdata.dataCaches[mc].fakerootdirs, |
| 1235 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, | 1231 | "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv, |
| 1236 | "sigdata" : bb.parse.siggen.get_taskdata(), | 1232 | "sigdata" : bb.parse.siggen.get_taskdata(), |
| 1237 | "runq_hash" : runqhash, | ||
| 1238 | "logdefaultdebug" : bb.msg.loggerDefaultDebugLevel, | 1233 | "logdefaultdebug" : bb.msg.loggerDefaultDebugLevel, |
| 1239 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, | 1234 | "logdefaultverbose" : bb.msg.loggerDefaultVerbose, |
| 1240 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, | 1235 | "logdefaultverboselogs" : bb.msg.loggerVerboseLogs, |
| @@ -2031,6 +2026,7 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
| 2031 | taskdepdata = self.build_taskdepdata(task) | 2026 | taskdepdata = self.build_taskdepdata(task) |
| 2032 | 2027 | ||
| 2033 | taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] | 2028 | taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] |
| 2029 | taskhash = self.rqdata.get_task_hash(task) | ||
| 2034 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): | 2030 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): |
| 2035 | if not mc in self.rq.fakeworker: | 2031 | if not mc in self.rq.fakeworker: |
| 2036 | try: | 2032 | try: |
| @@ -2040,10 +2036,10 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
| 2040 | self.rq.state = runQueueFailed | 2036 | self.rq.state = runQueueFailed |
| 2041 | self.stats.taskFailed() | 2037 | self.stats.taskFailed() |
| 2042 | return True | 2038 | return True |
| 2043 | self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>") | 2039 | self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, taskhash, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>") |
| 2044 | self.rq.fakeworker[mc].process.stdin.flush() | 2040 | self.rq.fakeworker[mc].process.stdin.flush() |
| 2045 | else: | 2041 | else: |
| 2046 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>") | 2042 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, taskhash, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>") |
| 2047 | self.rq.worker[mc].process.stdin.flush() | 2043 | self.rq.worker[mc].process.stdin.flush() |
| 2048 | 2044 | ||
| 2049 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | 2045 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) |
| @@ -2457,13 +2453,14 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
| 2457 | taskdepdata = self.build_taskdepdata(task) | 2453 | taskdepdata = self.build_taskdepdata(task) |
| 2458 | 2454 | ||
| 2459 | taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] | 2455 | taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] |
| 2456 | taskhash = self.rqdata.get_task_hash(task) | ||
| 2460 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run: | 2457 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run: |
| 2461 | if not mc in self.rq.fakeworker: | 2458 | if not mc in self.rq.fakeworker: |
| 2462 | self.rq.start_fakeworker(self, mc) | 2459 | self.rq.start_fakeworker(self, mc) |
| 2463 | self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") | 2460 | self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, taskhash, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") |
| 2464 | self.rq.fakeworker[mc].process.stdin.flush() | 2461 | self.rq.fakeworker[mc].process.stdin.flush() |
| 2465 | else: | 2462 | else: |
| 2466 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") | 2463 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, taskhash, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") |
| 2467 | self.rq.worker[mc].process.stdin.flush() | 2464 | self.rq.worker[mc].process.stdin.flush() |
| 2468 | 2465 | ||
| 2469 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | 2466 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) |
