diff options
author | Schmidt, Adriaan <adriaan.schmidt@siemens.com> | 2022-04-12 09:42:57 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-14 09:48:33 +0100 |
commit | 33b929192e78b09dfb1ea84c76db2eae4ce444a1 (patch) | |
tree | fe773ddf94a1e0418f9d108bde2c042c3ddbc178 /bitbake/lib/bb/siggen.py | |
parent | 73fa855f6af5ef9c3a78656aa56f09d213601be2 (diff) | |
download | poky-33b929192e78b09dfb1ea84c76db2eae4ce444a1.tar.gz |
bitbake: bitbake-diffsigs: make finding of changed signatures more robust
In `runtaskhashes`, the keys contain the absolute paths to the recipe. When
working with shared sstate caches (where these absolute paths can be different)
we see that compare_sigfiles does not identifiy a changed hash of a dependent
task as "changed", but instead as "removed"&"added", preventing the function
from recursing and continuing the comparison.
By calling `clean_basepaths` before comparing the `runtaskhashes` dicts, we
avoid this.
(Bitbake rev: 7358378b90b68111779e6ae72948e5e7a3de00a9)
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 1612b4efa1..130b38d8a7 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -991,8 +991,8 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False): | |||
991 | 991 | ||
992 | 992 | ||
993 | if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: | 993 | if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: |
994 | a = a_data['runtaskhashes'] | 994 | a = clean_basepaths(a_data['runtaskhashes']) |
995 | b = b_data['runtaskhashes'] | 995 | b = clean_basepaths(b_data['runtaskhashes']) |
996 | changed, added, removed = dict_diff(a, b) | 996 | changed, added, removed = dict_diff(a, b) |
997 | if added: | 997 | if added: |
998 | for dep in sorted(added): | 998 | for dep in sorted(added): |
@@ -1003,7 +1003,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False): | |||
1003 | #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep)) | 1003 | #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep)) |
1004 | bdep_found = True | 1004 | bdep_found = True |
1005 | if not bdep_found: | 1005 | if not bdep_found: |
1006 | output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep])) | 1006 | output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (dep, b[dep])) |
1007 | if removed: | 1007 | if removed: |
1008 | for dep in sorted(removed): | 1008 | for dep in sorted(removed): |
1009 | adep_found = False | 1009 | adep_found = False |
@@ -1013,11 +1013,11 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False): | |||
1013 | #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep)) | 1013 | #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep)) |
1014 | adep_found = True | 1014 | adep_found = True |
1015 | if not adep_found: | 1015 | if not adep_found: |
1016 | output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep])) | 1016 | output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (dep, a[dep])) |
1017 | if changed: | 1017 | if changed: |
1018 | for dep in sorted(changed): | 1018 | for dep in sorted(changed): |
1019 | if not collapsed: | 1019 | if not collapsed: |
1020 | output.append(color_format("{color_title}Hash for task dependency %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep])) | 1020 | output.append(color_format("{color_title}Hash for task dependency %s changed{color_default} from %s to %s") % (dep, a[dep], b[dep])) |
1021 | if callable(recursecb): | 1021 | if callable(recursecb): |
1022 | recout = recursecb(dep, a[dep], b[dep]) | 1022 | recout = recursecb(dep, a[dep], b[dep]) |
1023 | if recout: | 1023 | if recout: |