All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runqueue.py: Fix a stamp comparision bug
@ 2012-07-25 19:15 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-07-25 19:15 UTC (permalink / raw)
  To: bitbake-devel

We check the stamp cache before comparing t2 and t3 which means that we can miss
a level in the stamp file chains. The result of this is that a stamp can be accepted
as valid when in fact it isn't. Some weird behaviour alerted me to this in a local
build.

This patch also fixes to only uses the cache in recurse mode, there was a corner
case where stamps not in recurse mode could get added to the cache which could cause
an issue potentially.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 0a8c723..306ae79 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -835,9 +835,6 @@ class RunQueue:
         t1 = get_timestamp(stampfile)
         for dep in self.rqdata.runq_depends[task]:
             if iscurrent:
-                if dep in cache:
-                    iscurrent = cache[dep]
-                    continue
                 fn2 = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[dep]]
                 taskname2 = self.rqdata.runq_task[dep]
                 stampfile2 = bb.build.stampfile(taskname2, self.rqdata.dataCache, fn2)
@@ -854,9 +851,15 @@ class RunQueue:
                         logger.debug(2, 'Stampfile %s < %s', stampfile, stampfile2)
                         iscurrent = False
                     if recurse and iscurrent:
-                        iscurrent = self.check_stamp_task(dep, recurse=True, cache=cache)
-                        cache[dep] = iscurrent
-        cache[task] = iscurrent
+                        if dep in cache:
+                            iscurrent = cache[dep]
+                            if not iscurrent:
+                                logger.debug(2, 'Stampfile for dependency %s:%s invalid (cached)' % (fn2, taskname2))
+                        else:
+                            iscurrent = self.check_stamp_task(dep, recurse=True, cache=cache)
+                            cache[dep] = iscurrent
+        if recurse:
+            cache[task] = iscurrent
         return iscurrent
 
     def execute_runqueue(self):





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-25 19:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25 19:15 [PATCH] runqueue.py: Fix a stamp comparision bug Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.