summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py37
1 files changed, 32 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b9c1399efe..b697cee536 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -164,6 +164,12 @@ class RunQueue:
164 taskname = self.runq_task[task] 164 taskname = self.runq_task[task]
165 return "%s, %s" % (fn, taskname) 165 return "%s, %s" % (fn, taskname)
166 166
167 def get_task_id(self, fnid, taskname):
168 for listid in range(len(self.runq_fnid)):
169 if self.runq_fnid[listid] == fnid and self.runq_task[listid] == taskname:
170 return listid
171 return None
172
167 def circular_depchains_handler(self, tasks): 173 def circular_depchains_handler(self, tasks):
168 """ 174 """
169 Some tasks aren't buildable, likely due to circular dependency issues. 175 Some tasks aren't buildable, likely due to circular dependency issues.
@@ -398,8 +404,12 @@ class RunQueue:
398 return [] 404 return []
399 if task in recursive_tdepends: 405 if task in recursive_tdepends:
400 return recursive_tdepends[task] 406 return recursive_tdepends[task]
401 rectdepends = [task] 407
402 nextdeps = [task] 408 fnid = taskData.tasks_fnid[task]
409 taskids = taskData.gettask_ids(fnid)
410
411 rectdepends = taskids
412 nextdeps = taskids
403 while len(nextdeps) != 0: 413 while len(nextdeps) != 0:
404 newdeps = [] 414 newdeps = []
405 for nextdep in nextdeps: 415 for nextdep in nextdeps:
@@ -776,7 +786,7 @@ class RunQueue:
776 bb.fatal("check_stamps fatal internal error") 786 bb.fatal("check_stamps fatal internal error")
777 return current 787 return current
778 788
779 def check_stamp(self, task): 789 def check_stamp_task(self, task):
780 790
781 if self.stamppolicy == "perfile": 791 if self.stamppolicy == "perfile":
782 fulldeptree = False 792 fulldeptree = False
@@ -791,10 +801,12 @@ class RunQueue:
791 stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname) 801 stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname)
792 # If the stamp is missing its not current 802 # If the stamp is missing its not current
793 if not os.access(stampfile, os.F_OK): 803 if not os.access(stampfile, os.F_OK):
804 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s not available\n" % stampfile)
794 return False 805 return False
795 # If its a 'nostamp' task, it's not current 806 # If its a 'nostamp' task, it's not current
796 taskdep = self.dataCache.task_deps[fn] 807 taskdep = self.dataCache.task_deps[fn]
797 if 'nostamp' in taskdep and task in taskdep['nostamp']: 808 if 'nostamp' in taskdep and task in taskdep['nostamp']:
809 bb.msg.debug(2, bb.msg.domain.RunQueue, "%s.%s is nostamp\n" % (fn, taskname))
798 return False 810 return False
799 811
800 iscurrent = True 812 iscurrent = True
@@ -808,8 +820,10 @@ class RunQueue:
808 try: 820 try:
809 t2 = os.stat(stampfile2)[stat.ST_MTIME] 821 t2 = os.stat(stampfile2)[stat.ST_MTIME]
810 if t1 < t2: 822 if t1 < t2:
823 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s < %s" % (stampfile,stampfile2))
811 iscurrent = False 824 iscurrent = False
812 except: 825 except:
826 bb.msg.debug(2, bb.msg.domain.RunQueue, "Exception reading %s for %s" % (stampfile2 ,stampfile))
813 iscurrent = False 827 iscurrent = False
814 828
815 return iscurrent 829 return iscurrent
@@ -907,7 +921,7 @@ class RunQueue:
907 fn = self.taskData.fn_index[self.runq_fnid[task]] 921 fn = self.taskData.fn_index[self.runq_fnid[task]]
908 922
909 taskname = self.runq_task[task] 923 taskname = self.runq_task[task]
910 if self.check_stamp(task): 924 if self.check_stamp_task(task):
911 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task))) 925 bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task)))
912 self.runq_running[task] = 1 926 self.runq_running[task] = 1
913 self.task_complete(task) 927 self.task_complete(task)
@@ -916,6 +930,8 @@ class RunQueue:
916 continue 930 continue
917 931
918 bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task))) 932 bb.msg.note(1, bb.msg.domain.RunQueue, "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.active_builds + 1, len(self.runq_fnid), task, self.get_user_idstring(task)))
933 sys.stdout.flush()
934 sys.stderr.flush()
919 try: 935 try:
920 pid = os.fork() 936 pid = os.fork()
921 except OSError, e: 937 except OSError, e:
@@ -930,7 +946,8 @@ class RunQueue:
930 newsi = os.open('/dev/null', os.O_RDWR) 946 newsi = os.open('/dev/null', os.O_RDWR)
931 os.dup2(newsi, sys.stdin.fileno()) 947 os.dup2(newsi, sys.stdin.fileno())
932 self.cooker.configuration.cmd = taskname[3:] 948 self.cooker.configuration.cmd = taskname[3:]
933 try: 949 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data)
950 try:
934 self.cooker.tryBuild(fn) 951 self.cooker.tryBuild(fn)
935 except bb.build.EventException: 952 except bb.build.EventException:
936 bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed") 953 bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed")
@@ -1023,3 +1040,13 @@ class RunQueue:
1023 self.runq_weight[task], 1040 self.runq_weight[task],
1024 self.runq_depends[task], 1041 self.runq_depends[task],
1025 self.runq_revdeps[task])) 1042 self.runq_revdeps[task]))
1043
1044
1045def check_stamp_fn(fn, taskname, d):
1046 rq = bb.data.getVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", d)
1047 fnid = rq.taskData.getfn_id(fn)
1048 taskid = rq.get_task_id(fnid, taskname)
1049 if taskid is not None:
1050 return rq.check_stamp_task(taskid)
1051 return None
1052