summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2011-06-28 17:05:19 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-28 13:44:38 +0100
commit671e580111c3f37f3c7835956db17e0425f9f937 (patch)
tree042cdc41190ccbe14e5be5e616bb57d375283f23 /bitbake/lib/bb/runqueue.py
parenta1f79a7896b6411669b3ccada6204d2695e80fc5 (diff)
downloadpoky-671e580111c3f37f3c7835956db17e0425f9f937.tar.gz
bitbake: Add task specific stamp file support
This patch, based on proof of concept code from Richard adds code to bitbake to allow individual tasks to optionally specify their stamp file using the stamp-base flag. This takes the same form as the STAMP variable but can be specified on a per task basis. Code is also added to runqueue to ensure that if two tasks share the same stamp file, only one will be executed at once. A significant usecase for this code is to share source code (${S}) between recipes where separate build directories (${B}) are used. (Bitbake rev: 41bef02bef8379590ba012319aebe05068a8081e) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b801877e16..e1d32b7661 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -105,6 +105,11 @@ class RunQueueScheduler(object):
105 if self.rq.runq_running[taskid] == 1: 105 if self.rq.runq_running[taskid] == 1:
106 continue 106 continue
107 if self.rq.runq_buildable[taskid] == 1: 107 if self.rq.runq_buildable[taskid] == 1:
108 fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[taskid]]
109 taskname = self.rqdata.runq_task[taskid]
110 stamp = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
111 if stamp in self.rq.build_stamps.values():
112 continue
108 return taskid 113 return taskid
109 114
110 def next(self): 115 def next(self):
@@ -1009,6 +1014,7 @@ class RunQueueExecute:
1009 self.runq_complete = [] 1014 self.runq_complete = []
1010 self.build_pids = {} 1015 self.build_pids = {}
1011 self.build_pipes = {} 1016 self.build_pipes = {}
1017 self.build_stamps = {}
1012 self.failed_fnids = [] 1018 self.failed_fnids = []
1013 1019
1014 def runqueue_process_waitpid(self): 1020 def runqueue_process_waitpid(self):
@@ -1023,6 +1029,9 @@ class RunQueueExecute:
1023 del self.build_pids[result[0]] 1029 del self.build_pids[result[0]]
1024 self.build_pipes[result[0]].close() 1030 self.build_pipes[result[0]].close()
1025 del self.build_pipes[result[0]] 1031 del self.build_pipes[result[0]]
1032 # self.build_stamps[result[0]] may not exist when use shared work directory.
1033 if result[0] in self.build_stamps.keys():
1034 del self.build_stamps[result[0]]
1026 if result[1] != 0: 1035 if result[1] != 0:
1027 self.task_fail(task, result[1]>>8) 1036 self.task_fail(task, result[1]>>8)
1028 else: 1037 else:
@@ -1330,6 +1339,7 @@ class RunQueueExecuteTasks(RunQueueExecute):
1330 1339
1331 self.build_pids[pid] = task 1340 self.build_pids[pid] = task
1332 self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData) 1341 self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData)
1342 self.build_stamps[pid] = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
1333 self.runq_running[task] = 1 1343 self.runq_running[task] = 1
1334 self.stats.taskActive() 1344 self.stats.taskActive()
1335 if self.stats.active < self.number_tasks: 1345 if self.stats.active < self.number_tasks: