diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-22 11:28:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-26 08:10:35 +0100 |
commit | 5d41200113c32d61c2495aae72525e3f7a84715b (patch) | |
tree | 81b7c12223abdd327f3363ca4f5e199ce005e132 | |
parent | 40d45cf7a651bf60f684e3aab32195593ba1172b (diff) | |
download | poky-5d41200113c32d61c2495aae72525e3f7a84715b.tar.gz |
bitbake: 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.
(Bitbake rev: 4be4a15491530bd6dc018033ad3d4b2562ab6e23)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cache.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index cce12d12e9..439565f5a6 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -328,6 +328,13 @@ class Cache(object): | |||
328 | value = pickled.load() | 328 | value = pickled.load() |
329 | except Exception: | 329 | except Exception: |
330 | break | 330 | break |
331 | if not isinstance(key, str): | ||
332 | bb.warn("%s from extras cache is not a string?" % key) | ||
333 | break | ||
334 | if not isinstance(value, RecipeInfoCommon): | ||
335 | bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value) | ||
336 | break | ||
337 | |||
331 | if key in self.depends_cache: | 338 | if key in self.depends_cache: |
332 | self.depends_cache[key].append(value) | 339 | self.depends_cache[key].append(value) |
333 | else: | 340 | else: |