summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorPaulo Neves <paulo@myneves.com>2023-08-22 20:33:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-24 16:47:31 +0100
commit65cd9697f95901c45984e4f7c21c64b0ef4845a0 (patch)
tree5276e6780576cd93bab59e4d5f38478d0aed4f69 /bitbake/lib/bb/siggen.py
parent359a105de609ec174863ad7a2874f5f2d398777c (diff)
downloadpoky-65cd9697f95901c45984e4f7c21c64b0ef4845a0.tar.gz
bitbake: siggen.py: Improve taskhash reproducibility
file checksums are part of the data checksummed to generate the task hash. The list of file checksums was not ordered. In this commit we make sure the task hash checksum takes a list of checksum data that is ordered by unique file name thus guaranteeing reproducibility. (Bitbake rev: 5293a1b36eeb89f57577cb709ec7f293909039a1) Signed-off-by: Paulo Neves <paulo@myneves.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.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 879c136e18..b023b79eca 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -361,7 +361,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
361 for dep in sorted(self.runtaskdeps[tid]): 361 for dep in sorted(self.runtaskdeps[tid]):
362 data += self.get_unihash(dep[1]) 362 data += self.get_unihash(dep[1])
363 363
364 for (f, cs) in self.file_checksum_values[tid]: 364 for (f, cs) in sorted(self.file_checksum_values[tid], key=clean_checksum_file_path):
365 if cs: 365 if cs:
366 if "/./" in f: 366 if "/./" in f:
367 data += "./" + f.split("/./")[1] 367 data += "./" + f.split("/./")[1]
@@ -426,7 +426,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
426 if runtime and tid in self.taskhash: 426 if runtime and tid in self.taskhash:
427 data['runtaskdeps'] = [dep[0] for dep in sorted(self.runtaskdeps[tid])] 427 data['runtaskdeps'] = [dep[0] for dep in sorted(self.runtaskdeps[tid])]
428 data['file_checksum_values'] = [] 428 data['file_checksum_values'] = []
429 for f,cs in self.file_checksum_values[tid]: 429 for f,cs in sorted(self.file_checksum_values[tid], key=clean_checksum_file_path):
430 if "/./" in f: 430 if "/./" in f:
431 data['file_checksum_values'].append(("./" + f.split("/./")[1], cs)) 431 data['file_checksum_values'].append(("./" + f.split("/./")[1], cs))
432 else: 432 else:
@@ -745,6 +745,12 @@ class SignatureGeneratorTestEquivHash(SignatureGeneratorUniHashMixIn, SignatureG
745 self.server = data.getVar('BB_HASHSERVE') 745 self.server = data.getVar('BB_HASHSERVE')
746 self.method = "sstate_output_hash" 746 self.method = "sstate_output_hash"
747 747
748def clean_checksum_file_path(file_checksum_tuple):
749 f, cs = file_checksum_tuple
750 if "/./" in f:
751 return "./" + f.split("/./")[1]
752 return f
753
748def dump_this_task(outfile, d): 754def dump_this_task(outfile, d):
749 import bb.parse 755 import bb.parse
750 mcfn = d.getVar("BB_FILENAME") 756 mcfn = d.getVar("BB_FILENAME")