summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-16 07:09:13 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-20 15:22:50 +0000
commitfe7e75075e2d55a45ad2b81c9e493068a156d1dc (patch)
treed5dddcd32bb50c0cc70fa40120a0acf2f63d859f /bitbake/bin
parent764a7801361c6f57ff366be641b1410e7b36f56b (diff)
downloadpoky-fe7e75075e2d55a45ad2b81c9e493068a156d1dc.tar.gz
bitbake: runqueue: dry-run real tasks when BB_SETSCENE_ENFORCE is set
For the purposes BB_SETSCENE_ENFORCE is designed for (in OE, it is used by the installation process for the extensible SDK), we don't actually need the whitelisted real tasks to execute - we just need to have them in the dependency tree so that we get all of the setscene tasks they depend on to run. Therefore we can actually dry-run those real tasks i.e. they won't be run (and thus we won't waste a significant amount of time doing so) and won't be stamped as having run either. We do already have a dry-run mode in BitBake (activated by the -n or --dry-run command line option), but it dry-runs the setscene tasks as well which we don't want here. Note that this has no effect on the checking we are doing with BB_SETSCENE_ENFORCE to ensure that only whitelisted real tasks are scheduled to run - that's handled separately. Fixes [YOCTO #10369]. (Bitbake rev: 58f084291beb3a87d8d9fdb36dfe7eff911fa36b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake-worker12
1 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 4dbd681172..5010bada79 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
139def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, extraconfigdata, quieterrors=False): 139def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, 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
@@ -152,8 +152,10 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append
152 except TypeError: 152 except TypeError:
153 umask = taskdep['umask'][taskname] 153 umask = taskdep['umask'][taskname]
154 154
155 dry_run = cfg.dry_run or dry_run_exec
156
155 # We can't use the fakeroot environment in a dry run as it possibly hasn't been built 157 # We can't use the fakeroot environment in a dry run as it possibly hasn't been built
156 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not cfg.dry_run: 158 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run:
157 envvars = (workerdata["fakerootenv"][fn] or "").split() 159 envvars = (workerdata["fakerootenv"][fn] or "").split()
158 for key, value in (var.split('=') for var in envvars): 160 for key, value in (var.split('=') for var in envvars):
159 envbackup[key] = os.environ.get(key) 161 envbackup[key] = os.environ.get(key)
@@ -263,7 +265,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append
263 logger.critical(traceback.format_exc()) 265 logger.critical(traceback.format_exc())
264 os._exit(1) 266 os._exit(1)
265 try: 267 try:
266 if cfg.dry_run: 268 if dry_run:
267 return 0 269 return 0
268 return bb.build.exec_task(fn, taskname, the_data, cfg.profile) 270 return bb.build.exec_task(fn, taskname, the_data, cfg.profile)
269 except: 271 except:
@@ -421,10 +423,10 @@ class BitbakeWorker(object):
421 sys.exit(0) 423 sys.exit(0)
422 424
423 def handle_runtask(self, data): 425 def handle_runtask(self, data):
424 fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data) 426 fn, task, taskname, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data)
425 workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname)) 427 workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
426 428
427 pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, self.extraconfigdata, quieterrors) 429 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)
428 430
429 self.build_pids[pid] = task 431 self.build_pids[pid] = task
430 self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout) 432 self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)