diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-29 14:28:08 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-06 11:21:31 +0100 |
| commit | 40eb5b344b4de5310a89e36024b826fc99484747 (patch) | |
| tree | 1310401cf6716caa2d331f37ee5408fc9eb5f2e2 | |
| parent | de143e0db64400d252b6500c3f4335091fcce6a1 (diff) | |
| download | poky-40eb5b344b4de5310a89e36024b826fc99484747.tar.gz | |
bitbake: siggen: Convert to use self.unitaskhashes
Rather than metadata driven sqlite databases for communication, use
bitbake's unitaskhashes variable instead.
(Bitbake rev: a0d941c787cf3ef030d190903279d311bc05d752)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/siggen.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 2bb0b68527..368209807f 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
| @@ -388,12 +388,15 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 388 | # If a unique hash is reported, use it as the stampfile hash. This | 388 | # If a unique hash is reported, use it as the stampfile hash. This |
| 389 | # ensures that if a task won't be re-run if the taskhash changes, | 389 | # ensures that if a task won't be re-run if the taskhash changes, |
| 390 | # but it would result in the same output hash | 390 | # but it would result in the same output hash |
| 391 | unihash = self.unihashes.get(self.__get_task_unihash_key(task)) | 391 | unihash = self.unitaskhashes.get(self.__get_task_unihash_key(task), None) |
| 392 | if unihash is not None: | 392 | if unihash is not None: |
| 393 | return unihash | 393 | return unihash |
| 394 | 394 | ||
| 395 | return super().get_stampfile_hash(task) | 395 | return super().get_stampfile_hash(task) |
| 396 | 396 | ||
| 397 | def set_unihash(self, task, unihash): | ||
| 398 | self.unitaskhashes[self.__get_task_unihash_key(task)] = unihash | ||
| 399 | |||
| 397 | def get_unihash(self, task): | 400 | def get_unihash(self, task): |
| 398 | import urllib | 401 | import urllib |
| 399 | import json | 402 | import json |
| @@ -404,7 +407,7 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 404 | 407 | ||
| 405 | # TODO: This cache can grow unbounded. It probably only needs to keep | 408 | # TODO: This cache can grow unbounded. It probably only needs to keep |
| 406 | # for each task | 409 | # for each task |
| 407 | unihash = self.unihashes.get(key) | 410 | unihash = self.unitaskhashes.get(key, None) |
| 408 | if unihash is not None: | 411 | if unihash is not None: |
| 409 | return unihash | 412 | return unihash |
| 410 | 413 | ||
| @@ -446,7 +449,7 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 446 | except (KeyError, json.JSONDecodeError) as e: | 449 | except (KeyError, json.JSONDecodeError) as e: |
| 447 | bb.warn('Poorly formatted response from %s: %s' % (self.server, str(e))) | 450 | bb.warn('Poorly formatted response from %s: %s' % (self.server, str(e))) |
| 448 | 451 | ||
| 449 | self.unihashes[key] = unihash | 452 | self.unitaskhashes[key] = unihash |
| 450 | return unihash | 453 | return unihash |
| 451 | 454 | ||
| 452 | def report_unihash(self, path, task, d): | 455 | def report_unihash(self, path, task, d): |
| @@ -464,7 +467,7 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 464 | key = fn + '.do_' + task + ':' + taskhash | 467 | key = fn + '.do_' + task + ':' + taskhash |
| 465 | 468 | ||
| 466 | # Sanity checks | 469 | # Sanity checks |
| 467 | cache_unihash = self.unihashes.get(key) | 470 | cache_unihash = self.unitaskhashes.get(key, None) |
| 468 | if cache_unihash is None: | 471 | if cache_unihash is None: |
| 469 | bb.fatal('%s not in unihash cache. Please report this error' % key) | 472 | bb.fatal('%s not in unihash cache. Please report this error' % key) |
| 470 | 473 | ||
| @@ -515,6 +518,7 @@ class SignatureGeneratorUniHashMixIn(object): | |||
| 515 | 518 | ||
| 516 | if new_unihash != unihash: | 519 | if new_unihash != unihash: |
| 517 | bb.debug(1, 'Task %s unihash changed %s -> %s by server %s' % (taskhash, unihash, new_unihash, self.server)) | 520 | bb.debug(1, 'Task %s unihash changed %s -> %s by server %s' % (taskhash, unihash, new_unihash, self.server)) |
| 521 | bb.event.fire(bb.runqueue.taskUniHashUpdate(fn + ':do_' + task, new_unihash), d) | ||
| 518 | else: | 522 | else: |
| 519 | bb.debug(1, 'Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server)) | 523 | bb.debug(1, 'Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server)) |
| 520 | except urllib.error.URLError as e: | 524 | except urllib.error.URLError as e: |
