summaryrefslogtreecommitdiffstats
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-02 16:43:01 +0000
commit5f349cc227ec010aaf52b7d5311935102c2cc6d9 (patch)
tree9f526733eca8b453385f7fabb8f57c36466ecc62
parentc9692bdff049970df87bc9eb97beb5322ecf6880 (diff)
downloadpoky-5f349cc227ec010aaf52b7d5311935102c2cc6d9.tar.gz
bitbake: 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. (Bitbake rev: 0a09b0fa03d1afc08037964dc63a18ef7cff9c78) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/siggen.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index f982bf22bc..ded1da020f 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -391,12 +391,16 @@ class SignatureGeneratorBasicHash(SignatureGeneratorBasic):
391 bb.build.write_taint(task, d, fn) 391 bb.build.write_taint(task, d, fn)
392 392
393class SignatureGeneratorUniHashMixIn(object): 393class SignatureGeneratorUniHashMixIn(object):
394 def __init__(self, data):
395 self.extramethod = {}
396 super().__init__(data)
397
394 def get_taskdata(self): 398 def get_taskdata(self):
395 return (self.server, self.method) + super().get_taskdata() 399 return (self.server, self.method, self.extramethod) + super().get_taskdata()
396 400
397 def set_taskdata(self, data): 401 def set_taskdata(self, data):
398 self.server, self.method = data[:2] 402 self.server, self.method, self.extramethod = data[:3]
399 super().set_taskdata(data[2:]) 403 super().set_taskdata(data[3:])
400 404
401 def client(self): 405 def client(self):
402 if getattr(self, '_client', None) is None: 406 if getattr(self, '_client', None) is None:
@@ -453,7 +457,10 @@ class SignatureGeneratorUniHashMixIn(object):
453 unihash = taskhash 457 unihash = taskhash
454 458
455 try: 459 try:
456 data = self.client().get_unihash(self.method, self.taskhash[tid]) 460 method = self.method
461 if tid in self.extramethod:
462 method = method + self.extramethod[tid]
463 data = self.client().get_unihash(method, self.taskhash[tid])
457 if data: 464 if data:
458 unihash = data 465 unihash = data
459 # A unique hash equal to the taskhash is not very interesting, 466 # A unique hash equal to the taskhash is not very interesting,
@@ -522,7 +529,11 @@ class SignatureGeneratorUniHashMixIn(object):
522 extra_data['task'] = task 529 extra_data['task'] = task
523 extra_data['outhash_siginfo'] = sigfile.read().decode('utf-8') 530 extra_data['outhash_siginfo'] = sigfile.read().decode('utf-8')
524 531
525 data = self.client().report_unihash(taskhash, self.method, outhash, unihash, extra_data) 532 method = self.method
533 if tid in self.extramethod:
534 method = method + self.extramethod[tid]
535
536 data = self.client().report_unihash(taskhash, method, outhash, unihash, extra_data)
526 new_unihash = data['unihash'] 537 new_unihash = data['unihash']
527 538
528 if new_unihash != unihash: 539 if new_unihash != unihash:
@@ -549,7 +560,11 @@ class SignatureGeneratorUniHashMixIn(object):
549 def report_unihash_equiv(self, tid, taskhash, wanted_unihash, current_unihash, datacaches): 560 def report_unihash_equiv(self, tid, taskhash, wanted_unihash, current_unihash, datacaches):
550 try: 561 try:
551 extra_data = {} 562 extra_data = {}
552 data = self.client().report_unihash_equiv(taskhash, self.method, wanted_unihash, extra_data) 563 method = self.method
564 if tid in self.extramethod:
565 method = method + self.extramethod[tid]
566
567 data = self.client().report_unihash_equiv(taskhash, method, wanted_unihash, extra_data)
553 bb.note('Reported task %s as unihash %s to %s (%s)' % (tid, wanted_unihash, self.server, str(data))) 568 bb.note('Reported task %s as unihash %s to %s (%s)' % (tid, wanted_unihash, self.server, str(data)))
554 569
555 if data is None: 570 if data is None: