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)
downloadpoky-de143e0db64400d252b6500c3f4335091fcce6a1.tar.gz
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:
1516 self.dm_event_handler_registered = False 1516 self.dm_event_handler_registered = False
1517 1517
1518 if build_done and self.rqexe: 1518 if build_done and self.rqexe:
1519 bb.parse.siggen.save_unitaskhashes()
1519 self.teardown_workers() 1520 self.teardown_workers()
1520 if self.rqexe: 1521 if self.rqexe:
1521 if self.rqexe.stats.failed: 1522 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):
41 self.runtaskdeps = {} 41 self.runtaskdeps = {}
42 self.file_checksum_values = {} 42 self.file_checksum_values = {}
43 self.taints = {} 43 self.taints = {}
44 self.unitaskhashes = {}
44 45
45 def finalise(self, fn, d, varient): 46 def finalise(self, fn, d, varient):
46 return 47 return
@@ -73,14 +74,23 @@ class SignatureGenerator(object):
73 return 74 return
74 75
75 def get_taskdata(self): 76 def get_taskdata(self):
76 return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash) 77 return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes)
77 78
78 def set_taskdata(self, data): 79 def set_taskdata(self, data):
79 self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash = data 80 self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash, self.unitaskhashes = data
80 81
81 def reset(self, data): 82 def reset(self, data):
82 self.__init__(data) 83 self.__init__(data)
83 84
85 def get_taskhashes(self):
86 return self.taskhash, self.unitaskhashes
87
88 def set_taskhashes(self, hashes):
89 self.taskhash, self.unitaskhashes = hashes
90
91 def save_unitaskhashes(self):
92 return
93
84 94
85class SignatureGeneratorBasic(SignatureGenerator): 95class SignatureGeneratorBasic(SignatureGenerator):
86 """ 96 """
@@ -107,6 +117,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
107 else: 117 else:
108 self.checksum_cache = None 118 self.checksum_cache = None
109 119
120 self.unihash_cache = bb.cache.SimpleCache("1")
121 self.unitaskhashes = self.unihash_cache.init_cache(data, "bb_unihashes.dat", {})
122
110 def init_rundepcheck(self, data): 123 def init_rundepcheck(self, data):
111 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None 124 self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
112 if self.taskwhitelist: 125 if self.taskwhitelist:
@@ -244,6 +257,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
244 bb.fetch2.fetcher_parse_save() 257 bb.fetch2.fetcher_parse_save()
245 bb.fetch2.fetcher_parse_done() 258 bb.fetch2.fetcher_parse_done()
246 259
260 def save_unitaskhashes(self):
261 self.unihash_cache.save(self.unitaskhashes)
262
247 def dump_sigtask(self, fn, task, stampbase, runtime): 263 def dump_sigtask(self, fn, task, stampbase, runtime):
248 264
249 k = fn + "." + task 265 k = fn + "." + task