summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-21 14:34:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-22 13:07:07 +0000
commitd43175e747d6982cf3ca1a463eafc960b67966e2 (patch)
treeaf37c43430e090430d5190028d8792692befcc3f
parent17a92c4c9801396ce6aa82f7c1532b49b18dbad4 (diff)
downloadpoky-d43175e747d6982cf3ca1a463eafc960b67966e2.tar.gz
bitbake/runqueue.py: Add BB_SETSCENE_VERIFY_FUNCTION hook
The OE metadata has cases where it needs to prevent some setscene functions from running. An example of this is where we know a task is going to run do_configure (which would clean out do_populate_sysroot) and hence we don't want do_populate_sysroot_setscene to run. This change adds in a hook so that the metadata can allow any such policy decision to filter back up to bitbake. It removes the existing code which attempted to do this in a generic way but failed. (Bitbake rev: 2f6d987d9957a5d713ce119c24c2e87540611f53) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/runqueue.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index d82ce36348..1ed729d578 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -767,6 +767,7 @@ class RunQueue:
767 767
768 self.stamppolicy = bb.data.getVar("BB_STAMP_POLICY", cfgData, True) or "perfile" 768 self.stamppolicy = bb.data.getVar("BB_STAMP_POLICY", cfgData, True) or "perfile"
769 self.hashvalidate = bb.data.getVar("BB_HASHCHECK_FUNCTION", cfgData, True) or None 769 self.hashvalidate = bb.data.getVar("BB_HASHCHECK_FUNCTION", cfgData, True) or None
770 self.setsceneverify = bb.data.getVar("BB_SETSCENE_VERIFY_FUNCTION", cfgData, True) or None
770 771
771 self.state = runQueuePrepare 772 self.state = runQueuePrepare
772 773
@@ -1217,23 +1218,20 @@ class RunQueueExecuteTasks(RunQueueExecute):
1217 if found: 1218 if found:
1218 self.rq.scenequeue_covered.add(task) 1219 self.rq.scenequeue_covered.add(task)
1219 1220
1220 # Detect when the real task needs to be run anyway by looking to see 1221 logger.debug(1, 'Skip list (pre setsceneverify) %s', sorted(self.rq.scenequeue_covered))
1221 # if any of its dependencies within the same package are scheduled 1222
1222 # to be run. 1223 # Allow the metadata to elect for setscene tasks to run anyway
1223 covered_remove = set() 1224 covered_remove = set()
1224 for task in self.rq.scenequeue_covered: 1225 if self.rq.setsceneverify:
1225 task_fnid = self.rqdata.runq_fnid[task] 1226 call = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d)"
1226 for dep in self.rqdata.runq_depends[task]: 1227 locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : self.rqdata.runq_task, "fnids" : self.rqdata.runq_fnid, "fns" : self.rqdata.taskData.fn_index, "d" : self.cooker.configuration.data }
1227 if self.rqdata.runq_fnid[dep] == task_fnid: 1228 covered_remove = bb.utils.better_eval(call, locs)
1228 if dep not in self.rq.scenequeue_covered:
1229 covered_remove.add(task)
1230 break
1231 1229
1232 for task in covered_remove: 1230 for task in covered_remove:
1233 fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] 1231 fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
1234 taskname = self.rqdata.runq_task[task] + '_setscene' 1232 taskname = self.rqdata.runq_task[task] + '_setscene'
1235 bb.build.del_stamp(taskname, self.rqdata.dataCache, fn) 1233 bb.build.del_stamp(taskname, self.rqdata.dataCache, fn)
1236 logger.debug(1, 'Not skipping task %s because it will have to be run anyway', task) 1234 logger.debug(1, 'Not skipping task %s due to setsceneverify', task)
1237 self.rq.scenequeue_covered.remove(task) 1235 self.rq.scenequeue_covered.remove(task)
1238 1236
1239 logger.debug(1, 'Full skip list %s', self.rq.scenequeue_covered) 1237 logger.debug(1, 'Full skip list %s', self.rq.scenequeue_covered)