From 9bfc553546313cf2322a9e3824fec388b20e80d5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 9 May 2008 13:12:47 +0000 Subject: runqueue.py: Add bb.runqueue.check_stamp_fn() for use by packaged-staging, also improve check_stamp_task debug output --- ChangeLog | 1 + lib/bb/runqueue.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae4e935b4..eb701d570 100644 --- a/ChangeLog +++ b/ChangeLog @@ -133,6 +133,7 @@ Changes in Bitbake 1.9.x: leads to builds being non-deterministic. - Flush stdout/stderr before forking to fix duplicate console output - Make sure recrdeps tasks include all inter-task dependencies of a given fn + - Add bb.runqueue.check_stamp_fn() for use by packaged-staging Changes in Bitbake 1.8.0: - Release 1.7.x as a stable series diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 58f067942..4130b5064 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -183,6 +183,12 @@ class RunQueue: taskname = self.runq_task[task] return "%s, %s" % (fn, taskname) + def get_task_id(self, fnid, taskname): + for listid in range(len(self.runq_fnid)): + if self.runq_fnid[listid] == fnid and self.runq_task[listid] == taskname: + return listid + return None + def circular_depchains_handler(self, tasks): """ Some tasks aren't buildable, likely due to circular dependency issues. @@ -800,7 +806,7 @@ class RunQueue: bb.fatal("check_stamps fatal internal error") return current - def check_stamp(self, task): + def check_stamp_task(self, task): if self.stamppolicy == "perfile": fulldeptree = False @@ -815,10 +821,12 @@ class RunQueue: stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname) # If the stamp is missing its not current if not os.access(stampfile, os.F_OK): + bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s not available\n" % stampfile) return False # If its a 'nostamp' task, it's not current taskdep = self.dataCache.task_deps[fn] if 'nostamp' in taskdep and task in taskdep['nostamp']: + bb.msg.debug(2, bb.msg.domain.RunQueue, "%s.%s is nostamp\n" % (fn, taskname)) return False iscurrent = True @@ -832,8 +840,10 @@ class RunQueue: try: t2 = os.stat(stampfile2)[stat.ST_MTIME] if t1 < t2: + bb.msg.debug(2, bb.msg.domain.RunQueue, "Stampfile %s < %s" % (stampfile,stampfile2)) iscurrent = False except: + bb.msg.debug(2, bb.msg.domain.RunQueue, "Exception reading %s for %s" % (stampfile2 ,stampfile)) iscurrent = False return iscurrent @@ -952,7 +962,7 @@ class RunQueue: fn = self.taskData.fn_index[self.runq_fnid[task]] taskname = self.runq_task[task] - if self.check_stamp(task): + if self.check_stamp_task(task): bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task))) self.runq_running[task] = 1 self.runq_buildable[task] = 1 @@ -976,7 +986,8 @@ class RunQueue: newsi = os.open('/dev/null', os.O_RDWR) os.dup2(newsi, sys.stdin.fileno()) self.cooker.configuration.cmd = taskname[3:] - try: + bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data) + try: self.cooker.tryBuild(fn) except bb.build.EventException: bb.msg.error(bb.msg.domain.Build, "Build of " + fn + " " + taskname + " failed") @@ -1137,3 +1148,10 @@ class runQueueTaskCompleted(runQueueEvent): runQueueEvent.__init__(self, task, stats, rq, d) self.message = "Task %s completed (%s)" % (task, self.taskstring) +def check_stamp_fn(fn, taskname, d): + rq = bb.data.getVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", d) + fnid = rq.taskData.getfn_id(fn) + taskid = rq.get_task_id(fnid, taskname) + if taskid is not None: + return rq.check_stamp_task(taskid) + return None -- cgit 1.2.3-korg