summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/siggen.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 89b70fb6a4..8f24535528 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -704,8 +704,12 @@ class SignatureGeneratorUniHashMixIn(object):
704 query_tids.append(tid) 704 query_tids.append(tid)
705 705
706 if query_tids: 706 if query_tids:
707 with self.client() as client: 707 unihashes = []
708 unihashes = client.get_unihash_batch((self._get_method(tid), self.taskhash[tid]) for tid in query_tids) 708 try:
709 with self.client() as client:
710 unihashes = client.get_unihash_batch((self._get_method(tid), self.taskhash[tid]) for tid in query_tids)
711 except (ConnectionError, FileNotFoundError) as e:
712 bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e)))
709 713
710 for idx, tid in enumerate(query_tids): 714 for idx, tid in enumerate(query_tids):
711 # In the absence of being able to discover a unique hash from the 715 # In the absence of being able to discover a unique hash from the
@@ -722,9 +726,9 @@ class SignatureGeneratorUniHashMixIn(object):
722 # to the server, there is a better chance that they will agree on 726 # to the server, there is a better chance that they will agree on
723 # the unique hash. 727 # the unique hash.
724 taskhash = self.taskhash[tid] 728 taskhash = self.taskhash[tid]
725 unihash = unihashes[idx]
726 729
727 if unihash: 730 if unihashes and unihashes[idx]:
731 unihash = unihashes[idx]
728 # A unique hash equal to the taskhash is not very interesting, 732 # A unique hash equal to the taskhash is not very interesting,
729 # so it is reported it at debug level 2. If they differ, that 733 # so it is reported it at debug level 2. If they differ, that
730 # is much more interesting, so it is reported at debug level 1 734 # is much more interesting, so it is reported at debug level 1
@@ -733,7 +737,6 @@ class SignatureGeneratorUniHashMixIn(object):
733 hashequiv_logger.debug2('No reported unihash for %s:%s from %s' % (tid, taskhash, self.server)) 737 hashequiv_logger.debug2('No reported unihash for %s:%s from %s' % (tid, taskhash, self.server))
734 unihash = taskhash 738 unihash = taskhash
735 739
736
737 self.set_unihash(tid, unihash) 740 self.set_unihash(tid, unihash)
738 self.unihash[tid] = unihash 741 self.unihash[tid] = unihash
739 result[tid] = unihash 742 result[tid] = unihash
@@ -814,7 +817,7 @@ class SignatureGeneratorUniHashMixIn(object):
814 d.setVar('BB_UNIHASH', new_unihash) 817 d.setVar('BB_UNIHASH', new_unihash)
815 else: 818 else:
816 hashequiv_logger.debug('Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server)) 819 hashequiv_logger.debug('Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server))
817 except ConnectionError as e: 820 except (ConnectionError, FileNotFoundError) as e:
818 bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) 821 bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e)))
819 finally: 822 finally:
820 if sigfile: 823 if sigfile:
@@ -856,7 +859,7 @@ class SignatureGeneratorUniHashMixIn(object):
856 # TODO: What to do here? 859 # TODO: What to do here?
857 hashequiv_logger.verbose('Task %s unihash reported as unwanted hash %s' % (tid, finalunihash)) 860 hashequiv_logger.verbose('Task %s unihash reported as unwanted hash %s' % (tid, finalunihash))
858 861
859 except ConnectionError as e: 862 except (ConnectionError, FileNotFoundError) as e:
860 bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) 863 bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e)))
861 864
862 return False 865 return False