1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

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>
This commit is contained in:
Dongxiao Xu
2012-02-23 21:47:13 +08:00
committed by Richard Purdie
parent 99d326a818
commit 8e737db4fc
3 changed files with 36 additions and 21 deletions
+3 -1
View File
@@ -849,6 +849,7 @@ class BBCooker:
bb.event.fire(bb.event.ConfigParsed(), data)
bb.parse.init_parser(data)
self.configuration.data = data
self.configuration.data_hash = data.get_hash()
def handleCollections( self, collections ):
"""Handle collections"""
@@ -1494,6 +1495,7 @@ class CookerParser(object):
self.filelist = filelist
self.cooker = cooker
self.cfgdata = cooker.configuration.data
self.cfghash = cooker.configuration.data_hash
# Accounting statistics
self.parsed = 0
@@ -1509,7 +1511,7 @@ class CookerParser(object):
self.num_processes = int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
multiprocessing.cpu_count())
self.bb_cache = bb.cache.Cache(self.cfgdata, cooker.caches_array)
self.bb_cache = bb.cache.Cache(self.cfgdata, self.cfghash, cooker.caches_array)
self.fromcache = []
self.willparse = []
for filename in self.filelist: