diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-02-23 21:47:13 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-23 22:52:15 +0000 |
commit | 8e737db4fc2ab90850c2fe91733011dc4e0a24df (patch) | |
tree | 5e4c649a13f7a3fcfab6373b7305407b71d56881 /bitbake/lib/bb/cooker.py | |
parent | 99d326a818a49faf457c707ceeec6163bf8c8e16 (diff) | |
download | poky-8e737db4fc2ab90850c2fe91733011dc4e0a24df.tar.gz |
cache: Use configuration's hash value to validate cache
Previously we use the file time stamp to judge if a cache is valid.
Here this commit introduce a new method, which calculates the total
hash value for a certain configuration's key/value paris, and tag
it into cache filename, for example, bb_cache.dat.xxxyyyzzz.
This mechanism also ensures the cache's correctness if user
dynamically setting variables from some frontend GUI, like HOB.
(Bitbake rev: 1c1df03a6c4717bfd5faab144c4f8bbfcbae0b57)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index bf25a8320e..b0b58a6fdb 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -849,6 +849,7 @@ class BBCooker: | |||
849 | bb.event.fire(bb.event.ConfigParsed(), data) | 849 | bb.event.fire(bb.event.ConfigParsed(), data) |
850 | bb.parse.init_parser(data) | 850 | bb.parse.init_parser(data) |
851 | self.configuration.data = data | 851 | self.configuration.data = data |
852 | self.configuration.data_hash = data.get_hash() | ||
852 | 853 | ||
853 | def handleCollections( self, collections ): | 854 | def handleCollections( self, collections ): |
854 | """Handle collections""" | 855 | """Handle collections""" |
@@ -1494,6 +1495,7 @@ class CookerParser(object): | |||
1494 | self.filelist = filelist | 1495 | self.filelist = filelist |
1495 | self.cooker = cooker | 1496 | self.cooker = cooker |
1496 | self.cfgdata = cooker.configuration.data | 1497 | self.cfgdata = cooker.configuration.data |
1498 | self.cfghash = cooker.configuration.data_hash | ||
1497 | 1499 | ||
1498 | # Accounting statistics | 1500 | # Accounting statistics |
1499 | self.parsed = 0 | 1501 | self.parsed = 0 |
@@ -1509,7 +1511,7 @@ class CookerParser(object): | |||
1509 | self.num_processes = int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or | 1511 | self.num_processes = int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or |
1510 | multiprocessing.cpu_count()) | 1512 | multiprocessing.cpu_count()) |
1511 | 1513 | ||
1512 | self.bb_cache = bb.cache.Cache(self.cfgdata, cooker.caches_array) | 1514 | self.bb_cache = bb.cache.Cache(self.cfgdata, self.cfghash, cooker.caches_array) |
1513 | self.fromcache = [] | 1515 | self.fromcache = [] |
1514 | self.willparse = [] | 1516 | self.willparse = [] |
1515 | for filename in self.filelist: | 1517 | for filename in self.filelist: |