]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: cache: Add better cache loading sanity checks
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Jul 2016 10:28:23 +0000 (11:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Jul 2016 07:10:35 +0000 (08:10 +0100)
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>
bitbake/lib/bb/cache.py

index cce12d12e9eae05809b831a5a27942f9302f1dc7..439565f5a6eb16a0aea2d2fdccae77ed8264d7c7 100644 (file)
@@ -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: