summaryrefslogtreecommitdiffstats
path: root/lib/bb/siggen.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-02-19 14:22:58 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-05-10 12:27:13 +0300
commit6e6cfb5ae0f9dae866c4a407a6a381d85b2608b9 (patch)
tree8803537eeeb34c7c47ffe488acc3cab8465c0abe /lib/bb/siggen.py
parente8b54b0363cc180d16191bf1d9d476f8ed21fa5d (diff)
downloadopenembedded-core-contrib-6e6cfb5ae0f9dae866c4a407a6a381d85b2608b9.tar.gz
SignatureGenerator: add checksum_cache argument to get_taskhash()
Extend the SignatureGenerator API by adding a new argument to get_taskhash() for defining the file checksum cache to use. If the checksum cache argument is not provided, we use the cache in bb.fetch2, as before. This is a step towards removing checksum cache from bb.fetch2. Unfortunately, extending the API is a bit more involved than just adding a new optional argument because it has a sort of cyclic dependecy: the API is defined in bitbake, the implementation may be modified elsewhere (e.g. oe.sstatesig in oe-core layer) by overriding SignatureGenerator's method(s), which are eventually consumed back at bitbake. In bitbake, we must be prepared to use the old interface because oe-core may override our new shiny API with an old one. Thus, we need to inspect the API in RunQueueData and adjust call arguments accordingly. If the signature generator instance implements the new API, we use a checksum cache instance specific to runque. Print a warning if an implementation of the old API is detected. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'lib/bb/siggen.py')
-rw-r--r--lib/bb/siggen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 9d2c0b6b18..81b42d12f3 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -43,7 +43,7 @@ class SignatureGenerator(object):
def finalise(self, fn, d, varient):
return
- def get_taskhash(self, fn, task, deps, dataCache):
+ def get_taskhash(self, fn, task, deps, dataCache, checksum_cache=None):
return "0"
def stampfile(self, stampbase, file_name, taskname, extrainfo):
@@ -173,7 +173,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
pass
return taint
- def get_taskhash(self, fn, task, deps, dataCache):
+ def get_taskhash(self, fn, task, deps, dataCache, checksum_cache=None):
k = fn + "." + task
data = dataCache.basetaskhash[k]
self.runtaskdeps[k] = []
@@ -190,7 +190,10 @@ class SignatureGeneratorBasic(SignatureGenerator):
self.runtaskdeps[k].append(dep)
if task in dataCache.file_checksums[fn]:
- checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename)
+ if checksum_cache:
+ checksums = checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename)
+ else:
+ checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename)
for (f,cs) in checksums:
self.file_checksum_values[k].append((f,cs))
if cs: