runqueue: dry-run real tasks when BB_SETSCENE_ENFORCE is set
cover runqueue: dry-run real tasks when BB_SETSCENE_ENFORCE is set
The following changes since commit a2768ecae7846d72a1bdb7cbbc5e8d242af854f6:
bitbake-user-manual: Added new "Line Joining" section. (2016-12-08 16:35:56 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/setscene-enforce-dryrun
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/setscene-enforce-dryrun
Paul Eggleton (1):
runqueue: dry-run real tasks when BB_SETSCENE_ENFORCE is set
bin/bitbake-worker | 6 ++++-- lib/bb/runqueue.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.5.5
PATCH 1/1 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].
--- bin/bitbake-worker | 6 ++++-- lib/bb/runqueue.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
bin/bitbake-worker +4 -2
@@ -152,8 +152,10 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append except TypeError: umask = taskdep['umask'][taskname] + dry_run = cfg.dry_run or workerdata['dry_run_exec'] + # We can't use the fakeroot environment in a dry run as it possibly hasn't been built - if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not cfg.dry_run: + if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run: envvars = (workerdata["fakerootenv"][fn] or "").split() for key, value in (var.split('=') for var in envvars): envbackup[key] = os.environ.get(key)
@@ -260,7 +262,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append logger.critical(traceback.format_exc()) os._exit(1) try: - if cfg.dry_run: + if dry_run: return 0 return bb.build.exec_task(fn, taskname, the_data, cfg.profile) except:
lib/bb/runqueue.py +4 -2
@@ -266,6 +266,7 @@ class RunQueueData: self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split() self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData) self.setscenewhitelist_checked = False + self.setscene_enforce = cfgData.getVar('BB_SETSCENE_ENFORCE') or False self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter() self.reset()
@@ -1033,6 +1034,7 @@ class RunQueue: "buildname" : self.cfgData.getVar("BUILDNAME"), "date" : self.cfgData.getVar("DATE"), "time" : self.cfgData.getVar("TIME"), + "dry_run_exec" : bool(self.rqdata.setscene_enforce), } worker.stdin.write(b"<cookerconfig>" + pickle.dumps(self.cooker.configuration) + b"</cookerconfig>")
@@ -1789,7 +1791,7 @@ class RunQueueExecuteTasks(RunQueueExecute): bb.event.fire(startevent, self.cfgData) self.runq_running.add(task) self.stats.taskActive() - if not self.cooker.configuration.dry_run: + if not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): bb.build.make_stamp(taskname, self.rqdata.dataCaches[mc], taskfn) self.task_complete(task) return True
@@ -1800,7 +1802,7 @@ class RunQueueExecuteTasks(RunQueueExecute): taskdepdata = self.build_taskdepdata(task) taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] - if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run: + if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): if not self.rq.fakeworker: try: self.rq.start_fakeworker(self)
Signature · 1 line
2.5.5