Patchwork [bitbake-devel,RFC,WIP] runqueue: Don't fail without match found

login
register
mail settings
Submitter Martin Jansa
Date Dec. 30, 2013, 4:25 p.m.
Message ID <1388420713-15293-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/63907/
State New
Headers show

Comments

Martin Jansa - Dec. 30, 2013, 4:25 p.m.
* WIP, because I haven't checked the reasons why this happens
  I'm using this now only to see which recipes/tasks are failing
  like this

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 lib/bb/runqueue.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 4577236..413b95e 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1224,10 +1224,14 @@  class RunQueue:
             if match is None:
                 bb.fatal("Can't find a task we're supposed to have written out? (hash: %s)?" % h)
             matches = {k : v for k, v in matches.iteritems() if h not in k}
-            latestmatch = sorted(matches.keys(), key=lambda f: matches[f])[-1]
-            prevh = __find_md5__.search(latestmatch).group(0)
-            output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
-            bb.plain("\nTask %s:%s couldn't be used from the cache because:\n  We need hash %s, closest matching task was %s\n  " % (pn, taskname, h, prevh) + '\n  '.join(output))
+            sortedmatches=sorted(matches.keys(), key=lambda f: matches[f])
+            if sortedmatches:
+                latestmatch = sorted(matches.keys(), key=lambda f: matches[f])[-1]
+                prevh = __find_md5__.search(latestmatch).group(0)
+                output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
+                bb.plain("\nTask %s:%s couldn't be used from the cache because:\n  We need hash %s, closest matching task was %s\n  " % (pn, taskname, h, prevh) + '\n  '.join(output))
+            else:
+                bb.plain("\nTask %s:%s couldn't find any matches for hash %s" % (pn, taskname, h))