summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-23 22:44:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 11:21:31 +0100
commitde143e0db64400d252b6500c3f4335091fcce6a1 (patch)
tree93ce62b4ec3ee91812ed2e92876a07b82664e01e
parent53bb93938310243250eab1b0ae34f469bbec6fd6 (diff)
downloadopenembedded-core-contrib-de143e0db64400d252b6500c3f4335091fcce6a1.tar.gz
openembedded-core-contrib-de143e0db64400d252b6500c3f4335091fcce6a1.tar.bz2
openembedded-core-contrib-de143e0db64400d252b6500c3f4335091fcce6a1.zip
bitbake: siggen: Add new unitaskhashes data variable which is cached
We need to preserve unihash task hashes between runs. Use the new SimpleCache class to create such a class within the signature generator which is loaded at init time and saved when builds complete. The default is unpopulated but metadata sig handlers can populate this cache. (Bitbake rev: 1f326f2c29c2664a5daaeeb0c1fd332630efbdba) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/runqueue.py1
-rw-r--r--bitbake/lib/bb/siggen.py20
2 files changed, 19 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 9883a982c2..519561c231 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1516,6 +1516,7 @@ class RunQueue:
self.dm_event_handler_registered = False
if build_done and self.rqexe:
+ bb.parse.siggen.save_unitaskhashes()
self.teardown_workers()
if self.rqexe:
if self.rqexe.stats.failed:
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 0105fa7251..2bb0b68527 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -41,6 +41,7 @@ class SignatureGenerator(object):
self.runtaskdeps = {}
self.file_checksum_values = {}
self.taints = {}
+ self.unitaskhashes = {}
def finalise(self, fn, d, varient):
return
@@ -73,14 +74,23 @@ class SignatureGenerator(object):
return
def get_taskdata(self):
- return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash)
+ return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes)
def set_taskdata(self, data):
- self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash = data
+ self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes = data
def reset(self, data):
self.__init__(data)
+ def get_taskhashes(self):
+ return self.taskhash, self.unitaskhashes
+
+ def set_taskhashes(self, hashes):
+ self.taskhash, self.unitaskhashes = hashes
+
+ def save_unitaskhashes(self):
+ return
+
class SignatureGeneratorBasic(SignatureGenerator):
"""
@@ -107,6 +117,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
else:
self.checksum_cache = None
+ self.unihash_cache = bb.cache.SimpleCache("1")
+ self.unitaskhashes = self.unihash_cache.init_cache(data, "bb_unihashes.dat", {})
+
def init_rundepcheck(self, data):
self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
if self.taskwhitelist:
@@ -244,6 +257,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
bb.fetch2.fetcher_parse_save()
bb.fetch2.fetcher_parse_done()
+ def save_unitaskhashes(self):
+ self.unihash_cache.save(self.unitaskhashes)
+
def dump_sigtask(self, fn, task, stampbase, runtime):
k = fn + "." + task