summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cache.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-13 14:13:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-14 11:32:02 +0000
commit6c3c3e11f6f06f6ad9bf8fd2a026e03f76204ba4 (patch)
tree1d282d88490eebf4ba0e31f7d159538161b32b54 /bitbake/lib/bb/cache.py
parent83f8a4002ab2026696973422ee0f5733652d9527 (diff)
downloadpoky-6c3c3e11f6f06f6ad9bf8fd2a026e03f76204ba4.tar.gz
bitbake: cooker/cache/parse: Implement pyinofity based reconfigure
Memory resident bitbake has one current flaw, changes in the base configuration are not noticed by bitbake. The parsing cache is also refreshed on each invocation of bitbake (although the mtime cache is not cleared so its pointless). This change adds in pyinotify support and adds two different watchers, one for the base configuration and one for the parsed recipes. Changes in the latter will trigger a reparse (and an update of the mtime cache). The former will trigger a complete reload of the configuration. Note that this code will also correctly handle creation of new configuration files since the __depends and __base_depends variables already track these for cache correctness purposes. We could be a little more clever about parsing cache invalidation, right now we just invalidate the whole thing and recheck. For now, its better than what we have and doesn't seem to perform that badly though. For education and QA purposes I can document a workflow that illustrates this: $ source oe-init-build-env-memres $ time bitbake bash [base configuration is loaded, recipes are parsed, bash builds] $ time bitbake bash [command returns quickly since all caches are valid] $ touch ../meta/classes/gettext.bbclass $ time bitbake bash [reparse is triggered, time is longer than above] $ echo 'FOO = "1"' >> conf/local.conf $ time bitbake bash [reparse is triggered, but with a base configuration reload too] As far as changes go, I like this one a lot, it makes memory resident bitbake truly usable and may be the tweak we need to make it the default. The new pyinotify dependency is covered in the previous commit. (Bitbake rev: 0557d03c170fba8d7efe82be1b9641d0eb229213) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r--bitbake/lib/bb/cache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 715da07e8d..a1dde96425 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -623,10 +623,13 @@ class Cache(object):
623 def mtime(cachefile): 623 def mtime(cachefile):
624 return bb.parse.cached_mtime_noerror(cachefile) 624 return bb.parse.cached_mtime_noerror(cachefile)
625 625
626 def add_info(self, filename, info_array, cacheData, parsed=None): 626 def add_info(self, filename, info_array, cacheData, parsed=None, watcher=None):
627 if isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped): 627 if isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped):
628 cacheData.add_from_recipeinfo(filename, info_array) 628 cacheData.add_from_recipeinfo(filename, info_array)
629 629
630 if watcher:
631 watcher(info_array[0].file_depends)
632
630 if not self.has_cache: 633 if not self.has_cache:
631 return 634 return
632 635