aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cache.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-22 11:28:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-22 11:40:52 +0100
commit4be4a15491530bd6dc018033ad3d4b2562ab6e23 (patch)
treea4d032ebe357ddef6ca6f2d57499ee07b64d0f15 /lib/bb/cache.py
parent5eb36278ac9975de1945f6da8161187320d90ba7 (diff)
downloadbitbake-contrib-4be4a15491530bd6dc018033ad3d4b2562ab6e23.tar.gz
cache: Add better cache loading sanity checks
We've seen cache corruption where the pairs come out in a different order to the way we saved them for unknown reasons. Add better sanity checking to give a more user friendly error rather than a crash/traceback. Also allows the system to reparse and recover. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cache.py')
-rw-r--r--lib/bb/cache.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index cce12d12e..439565f5a 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -328,6 +328,13 @@ class Cache(object):
value = pickled.load()
except Exception:
break
+ if not isinstance(key, str):
+ bb.warn("%s from extras cache is not a string?" % key)
+ break
+ if not isinstance(value, RecipeInfoCommon):
+ bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value)
+ break
+
if key in self.depends_cache:
self.depends_cache[key].append(value)
else: