aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-28 00:03:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-01 11:00:53 +0000
commit0a09b0fa03d1afc08037964dc63a18ef7cff9c78 (patch)
tree92d41dad1cfd2ff5e847ec1177d86cde0119bc2c
parentd517b1ef13ca7ab2fb4d761d3bd3b9fb7c591514 (diff)
downloadbitbake-contrib-0a09b0fa03d1afc08037964dc63a18ef7cff9c78.tar.gz
siggen: Test extra cross/native hashserv method
Hack the hashserv to allow extra data to be injected into the hashserv method. This allows OE-Core to handle cases where there are multiple sstate objects for the same taskhash, e.g. native/cross objects based upon BUILD_ARCH or the host distro (when uninative isn't used). This has been tested and proven to be very effective. We will likely rework the code to improve how this is handled but for now this improves automated builds until we can get to that refactoring and more invasive changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/siggen.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index f982bf22b..ded1da020 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -391,12 +391,16 @@ class SignatureGeneratorBasicHash(SignatureGeneratorBasic):
bb.build.write_taint(task, d, fn)
class SignatureGeneratorUniHashMixIn(object):
+ def __init__(self, data):
+ self.extramethod = {}
+ super().__init__(data)
+
def get_taskdata(self):
- return (self.server, self.method) + super().get_taskdata()
+ return (self.server, self.method, self.extramethod) + super().get_taskdata()
def set_taskdata(self, data):
- self.server, self.method = data[:2]
- super().set_taskdata(data[2:])
+ self.server, self.method, self.extramethod = data[:3]
+ super().set_taskdata(data[3:])
def client(self):
if getattr(self, '_client', None) is None:
@@ -453,7 +457,10 @@ class SignatureGeneratorUniHashMixIn(object):
unihash = taskhash
try:
- data = self.client().get_unihash(self.method, self.taskhash[tid])
+ method = self.method
+ if tid in self.extramethod:
+ method = method + self.extramethod[tid]
+ data = self.client().get_unihash(method, self.taskhash[tid])
if data:
unihash = data
# A unique hash equal to the taskhash is not very interesting,
@@ -522,7 +529,11 @@ class SignatureGeneratorUniHashMixIn(object):
extra_data['task'] = task
extra_data['outhash_siginfo'] = sigfile.read().decode('utf-8')
- data = self.client().report_unihash(taskhash, self.method, outhash, unihash, extra_data)
+ method = self.method
+ if tid in self.extramethod:
+ method = method + self.extramethod[tid]
+
+ data = self.client().report_unihash(taskhash, method, outhash, unihash, extra_data)
new_unihash = data['unihash']
if new_unihash != unihash:
@@ -549,7 +560,11 @@ class SignatureGeneratorUniHashMixIn(object):
def report_unihash_equiv(self, tid, taskhash, wanted_unihash, current_unihash, datacaches):
try:
extra_data = {}
- data = self.client().report_unihash_equiv(taskhash, self.method, wanted_unihash, extra_data)
+ method = self.method
+ if tid in self.extramethod:
+ method = method + self.extramethod[tid]
+
+ data = self.client().report_unihash_equiv(taskhash, method, wanted_unihash, extra_data)
bb.note('Reported task %s as unihash %s to %s (%s)' % (tid, wanted_unihash, self.server, str(data)))
if data is None: