1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

cache.py: Ensure additional .bbappend files are accounted for

Currently if a user adds a new .bbappend file to the system, the cache still
thinks the cached data is valid. This code fixes that to ensure additions and
changed in append application order are accounted for.

[YOCTO #1091]

(Bitbake rev: 54fe91fe96aaae47c40077c5f441c79da71da777)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-07-06 17:54:49 +01:00
parent d4132fa128
commit 159aee22dc
2 changed files with 13 additions and 6 deletions
+12 -5
View File
@@ -43,7 +43,7 @@ except ImportError:
logger.info("Importing cPickle failed. " logger.info("Importing cPickle failed. "
"Falling back to a very slow implementation.") "Falling back to a very slow implementation.")
__cache_version__ = "140" __cache_version__ = "141"
def getCacheFile(path, filename): def getCacheFile(path, filename):
return os.path.join(path, filename) return os.path.join(path, filename)
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.file_depends = metadata.getVar('__depends', False) self.file_depends = metadata.getVar('__depends', False)
self.timestamp = bb.parse.cached_mtime(filename) self.timestamp = bb.parse.cached_mtime(filename)
self.variants = self.listvar('__VARIANTS', metadata) + [''] self.variants = self.listvar('__VARIANTS', metadata) + ['']
self.appends = self.listvar('__BBAPPEND', metadata)
self.nocache = self.getvar('__BB_DONT_CACHE', metadata) self.nocache = self.getvar('__BB_DONT_CACHE', metadata)
self.skipreason = self.getvar('__SKIPPED', metadata) self.skipreason = self.getvar('__SKIPPED', metadata)
@@ -429,7 +430,7 @@ class Cache(object):
automatically add the information to the cache or to your automatically add the information to the cache or to your
CacheData. Use the add or add_info method to do so after CacheData. Use the add or add_info method to do so after
running this, or use loadData instead.""" running this, or use loadData instead."""
cached = self.cacheValid(filename) cached = self.cacheValid(filename, appends)
if cached: if cached:
infos = [] infos = []
# info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo]
@@ -460,13 +461,13 @@ class Cache(object):
return cached, skipped, virtuals return cached, skipped, virtuals
def cacheValid(self, fn): def cacheValid(self, fn, appends):
""" """
Is the cache valid for fn? Is the cache valid for fn?
Fast version, no timestamps checked. Fast version, no timestamps checked.
""" """
if fn not in self.checked: if fn not in self.checked:
self.cacheValidUpdate(fn) self.cacheValidUpdate(fn, appends)
# Is cache enabled? # Is cache enabled?
if not self.has_cache: if not self.has_cache:
@@ -475,7 +476,7 @@ class Cache(object):
return True return True
return False return False
def cacheValidUpdate(self, fn): def cacheValidUpdate(self, fn, appends):
""" """
Is the cache valid for fn? Is the cache valid for fn?
Make thorough (slower) checks including timestamps. Make thorough (slower) checks including timestamps.
@@ -524,6 +525,12 @@ class Cache(object):
self.remove(fn) self.remove(fn)
return False return False
if appends != info_array[0].appends:
logger.debug(2, "Cache: appends for %s changed", fn)
bb.note("%s to %s" % (str(appends), str(info_array[0].appends)))
self.remove(fn)
return False
invalid = False invalid = False
for cls in info_array[0].variants: for cls in info_array[0].variants:
virtualfn = self.realfn2virtual(fn, cls) virtualfn = self.realfn2virtual(fn, cls)
+1 -1
View File
@@ -1298,7 +1298,7 @@ class CookerParser(object):
self.willparse = [] self.willparse = []
for filename in self.filelist: for filename in self.filelist:
appends = self.cooker.get_file_appends(filename) appends = self.cooker.get_file_appends(filename)
if not self.bb_cache.cacheValid(filename): if not self.bb_cache.cacheValid(filename, appends):
self.willparse.append((filename, appends, cooker.caches_array)) self.willparse.append((filename, appends, cooker.caches_array))
else: else:
self.fromcache.append((filename, appends)) self.fromcache.append((filename, appends))