diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/cache.py | 17 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 99d7395f86..6e152fa0c9 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -43,7 +43,7 @@ except ImportError: | |||
43 | logger.info("Importing cPickle failed. " | 43 | logger.info("Importing cPickle failed. " |
44 | "Falling back to a very slow implementation.") | 44 | "Falling back to a very slow implementation.") |
45 | 45 | ||
46 | __cache_version__ = "140" | 46 | __cache_version__ = "141" |
47 | 47 | ||
48 | def getCacheFile(path, filename): | 48 | def getCacheFile(path, filename): |
49 | return os.path.join(path, filename) | 49 | return os.path.join(path, filename) |
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon): | |||
94 | self.file_depends = metadata.getVar('__depends', False) | 94 | self.file_depends = metadata.getVar('__depends', False) |
95 | self.timestamp = bb.parse.cached_mtime(filename) | 95 | self.timestamp = bb.parse.cached_mtime(filename) |
96 | self.variants = self.listvar('__VARIANTS', metadata) + [''] | 96 | self.variants = self.listvar('__VARIANTS', metadata) + [''] |
97 | self.appends = self.listvar('__BBAPPEND', metadata) | ||
97 | self.nocache = self.getvar('__BB_DONT_CACHE', metadata) | 98 | self.nocache = self.getvar('__BB_DONT_CACHE', metadata) |
98 | 99 | ||
99 | self.skipreason = self.getvar('__SKIPPED', metadata) | 100 | self.skipreason = self.getvar('__SKIPPED', metadata) |
@@ -429,7 +430,7 @@ class Cache(object): | |||
429 | automatically add the information to the cache or to your | 430 | automatically add the information to the cache or to your |
430 | CacheData. Use the add or add_info method to do so after | 431 | CacheData. Use the add or add_info method to do so after |
431 | running this, or use loadData instead.""" | 432 | running this, or use loadData instead.""" |
432 | cached = self.cacheValid(filename) | 433 | cached = self.cacheValid(filename, appends) |
433 | if cached: | 434 | if cached: |
434 | infos = [] | 435 | infos = [] |
435 | # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] | 436 | # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] |
@@ -460,13 +461,13 @@ class Cache(object): | |||
460 | 461 | ||
461 | return cached, skipped, virtuals | 462 | return cached, skipped, virtuals |
462 | 463 | ||
463 | def cacheValid(self, fn): | 464 | def cacheValid(self, fn, appends): |
464 | """ | 465 | """ |
465 | Is the cache valid for fn? | 466 | Is the cache valid for fn? |
466 | Fast version, no timestamps checked. | 467 | Fast version, no timestamps checked. |
467 | """ | 468 | """ |
468 | if fn not in self.checked: | 469 | if fn not in self.checked: |
469 | self.cacheValidUpdate(fn) | 470 | self.cacheValidUpdate(fn, appends) |
470 | 471 | ||
471 | # Is cache enabled? | 472 | # Is cache enabled? |
472 | if not self.has_cache: | 473 | if not self.has_cache: |
@@ -475,7 +476,7 @@ class Cache(object): | |||
475 | return True | 476 | return True |
476 | return False | 477 | return False |
477 | 478 | ||
478 | def cacheValidUpdate(self, fn): | 479 | def cacheValidUpdate(self, fn, appends): |
479 | """ | 480 | """ |
480 | Is the cache valid for fn? | 481 | Is the cache valid for fn? |
481 | Make thorough (slower) checks including timestamps. | 482 | Make thorough (slower) checks including timestamps. |
@@ -524,6 +525,12 @@ class Cache(object): | |||
524 | self.remove(fn) | 525 | self.remove(fn) |
525 | return False | 526 | return False |
526 | 527 | ||
528 | if appends != info_array[0].appends: | ||
529 | logger.debug(2, "Cache: appends for %s changed", fn) | ||
530 | bb.note("%s to %s" % (str(appends), str(info_array[0].appends))) | ||
531 | self.remove(fn) | ||
532 | return False | ||
533 | |||
527 | invalid = False | 534 | invalid = False |
528 | for cls in info_array[0].variants: | 535 | for cls in info_array[0].variants: |
529 | virtualfn = self.realfn2virtual(fn, cls) | 536 | virtualfn = self.realfn2virtual(fn, cls) |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 7976d299c0..ecf20dcf68 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1298,7 +1298,7 @@ class CookerParser(object): | |||
1298 | self.willparse = [] | 1298 | self.willparse = [] |
1299 | for filename in self.filelist: | 1299 | for filename in self.filelist: |
1300 | appends = self.cooker.get_file_appends(filename) | 1300 | appends = self.cooker.get_file_appends(filename) |
1301 | if not self.bb_cache.cacheValid(filename): | 1301 | if not self.bb_cache.cacheValid(filename, appends): |
1302 | self.willparse.append((filename, appends, cooker.caches_array)) | 1302 | self.willparse.append((filename, appends, cooker.caches_array)) |
1303 | else: | 1303 | else: |
1304 | self.fromcache.append((filename, appends)) | 1304 | self.fromcache.append((filename, appends)) |