summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py8
-rw-r--r--bitbake/lib/bb/siggen.py49
-rw-r--r--bitbake/lib/bb/tests/runqueue.py2
3 files changed, 4 insertions, 55 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index cc36b84781..7451e5c56b 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1245,9 +1245,8 @@ class RunQueueData:
1245 return len(self.runtaskentries) 1245 return len(self.runtaskentries)
1246 1246
1247 def prepare_task_hash(self, tid): 1247 def prepare_task_hash(self, tid):
1248 dc = bb.parse.siggen.get_data_caches(self.dataCaches, mc_from_tid(tid)) 1248 bb.parse.siggen.prep_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1249 bb.parse.siggen.prep_taskhash(tid, self.runtaskentries[tid].depends, dc) 1249 self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1250 self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, self.runtaskentries[tid].depends, dc)
1251 self.runtaskentries[tid].unihash = bb.parse.siggen.get_unihash(tid) 1250 self.runtaskentries[tid].unihash = bb.parse.siggen.get_unihash(tid)
1252 1251
1253 def dump_data(self): 1252 def dump_data(self):
@@ -2434,8 +2433,7 @@ class RunQueueExecute:
2434 if self.rqdata.runtaskentries[p].depends and not self.rqdata.runtaskentries[tid].depends.isdisjoint(total): 2433 if self.rqdata.runtaskentries[p].depends and not self.rqdata.runtaskentries[tid].depends.isdisjoint(total):
2435 continue 2434 continue
2436 orighash = self.rqdata.runtaskentries[tid].hash 2435 orighash = self.rqdata.runtaskentries[tid].hash
2437 dc = bb.parse.siggen.get_data_caches(self.rqdata.dataCaches, mc_from_tid(tid)) 2436 newhash = bb.parse.siggen.get_taskhash(tid, self.rqdata.runtaskentries[tid].depends, self.rqdata.dataCaches)
2438 newhash = bb.parse.siggen.get_taskhash(tid, self.rqdata.runtaskentries[tid].depends, dc)
2439 origuni = self.rqdata.runtaskentries[tid].unihash 2437 origuni = self.rqdata.runtaskentries[tid].unihash
2440 newuni = bb.parse.siggen.get_unihash(tid) 2438 newuni = bb.parse.siggen.get_unihash(tid)
2441 # FIXME, need to check it can come from sstate at all for determinism? 2439 # FIXME, need to check it can come from sstate at all for determinism?
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 3731cd6b69..be56b3a31c 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -53,11 +53,6 @@ class SignatureGenerator(object):
53 """ 53 """
54 name = "noop" 54 name = "noop"
55 55
56 # If the derived class supports multiconfig datacaches, set this to True
57 # The default is False for backward compatibility with derived signature
58 # generators that do not understand multiconfig caches
59 supports_multiconfig_datacaches = False
60
61 def __init__(self, data): 56 def __init__(self, data):
62 self.basehash = {} 57 self.basehash = {}
63 self.taskhash = {} 58 self.taskhash = {}
@@ -128,38 +123,6 @@ class SignatureGenerator(object):
128 def set_setscene_tasks(self, setscene_tasks): 123 def set_setscene_tasks(self, setscene_tasks):
129 return 124 return
130 125
131 @classmethod
132 def get_data_caches(cls, dataCaches, mc):
133 """
134 This function returns the datacaches that should be passed to signature
135 generator functions. If the signature generator supports multiconfig
136 caches, the entire dictionary of data caches is sent, otherwise a
137 special proxy is sent that support both index access to all
138 multiconfigs, and also direct access for the default multiconfig.
139
140 The proxy class allows code in this class itself to always use
141 multiconfig aware code (to ease maintenance), but derived classes that
142 are unaware of multiconfig data caches can still access the default
143 multiconfig as expected.
144
145 Do not override this function in derived classes; it will be removed in
146 the future when support for multiconfig data caches is mandatory
147 """
148 class DataCacheProxy(object):
149 def __init__(self):
150 pass
151
152 def __getitem__(self, key):
153 return dataCaches[key]
154
155 def __getattr__(self, name):
156 return getattr(dataCaches[mc], name)
157
158 if cls.supports_multiconfig_datacaches:
159 return dataCaches
160
161 return DataCacheProxy()
162
163 def exit(self): 126 def exit(self):
164 return 127 return
165 128
@@ -298,11 +261,6 @@ class SignatureGeneratorBasic(SignatureGenerator):
298 for dep in sorted(deps, key=clean_basepath): 261 for dep in sorted(deps, key=clean_basepath):
299 (depmc, _, _, depmcfn) = bb.runqueue.split_tid_mcfn(dep) 262 (depmc, _, _, depmcfn) = bb.runqueue.split_tid_mcfn(dep)
300 depname = dataCaches[depmc].pkg_fn[depmcfn] 263 depname = dataCaches[depmc].pkg_fn[depmcfn]
301 if not self.supports_multiconfig_datacaches and mc != depmc:
302 # If the signature generator doesn't understand multiconfig
303 # data caches, any dependency not in the same multiconfig must
304 # be skipped for backward compatibility
305 continue
306 if not self.rundep_check(fn, recipename, task, dep, depname, dataCaches): 264 if not self.rundep_check(fn, recipename, task, dep, depname, dataCaches):
307 continue 265 continue
308 if dep not in self.taskhash: 266 if dep not in self.taskhash:
@@ -726,13 +684,6 @@ class SignatureGeneratorTestEquivHash(SignatureGeneratorUniHashMixIn, SignatureG
726 self.server = data.getVar('BB_HASHSERVE') 684 self.server = data.getVar('BB_HASHSERVE')
727 self.method = "sstate_output_hash" 685 self.method = "sstate_output_hash"
728 686
729#
730# Dummy class used for bitbake-selftest
731#
732class SignatureGeneratorTestMulticonfigDepends(SignatureGeneratorBasicHash):
733 name = "TestMulticonfigDepends"
734 supports_multiconfig_datacaches = True
735
736def dump_this_task(outfile, d): 687def dump_this_task(outfile, d):
737 import bb.parse 688 import bb.parse
738 fn = d.getVar("BB_FILENAME") 689 fn = d.getVar("BB_FILENAME")
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py
index 061a5a1f80..cc87e8d6a8 100644
--- a/bitbake/lib/bb/tests/runqueue.py
+++ b/bitbake/lib/bb/tests/runqueue.py
@@ -288,7 +288,7 @@ class RunQueueTests(unittest.TestCase):
288 with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: 288 with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir:
289 extraenv = { 289 extraenv = {
290 "BBMULTICONFIG" : "mc-1 mc_2", 290 "BBMULTICONFIG" : "mc-1 mc_2",
291 "BB_SIGNATURE_HANDLER" : "TestMulticonfigDepends", 291 "BB_SIGNATURE_HANDLER" : "basichash",
292 "EXTRA_BBFILES": "${COREBASE}/recipes/fails-mc/*.bb", 292 "EXTRA_BBFILES": "${COREBASE}/recipes/fails-mc/*.bb",
293 } 293 }
294 tasks = self.run_bitbakecmd(["bitbake", "mc:mc-1:f1"], tempdir, "", extraenv=extraenv, cleanup=True) 294 tasks = self.run_bitbakecmd(["bitbake", "mc:mc-1:f1"], tempdir, "", extraenv=extraenv, cleanup=True)