summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Neves <paulo@myneves.com>2025-03-08 00:27:20 +0100
committerSteve Sakoman <steve@sakoman.com>2025-03-19 07:13:17 -0700
commit8bfb7dabb7ebb692e740413379763c979cd3a7a6 (patch)
treeb868f64577b973483252fb56dd8ba0a8a6ab5f5e
parentdcbf2ff5dc783568ab036bd144e4e1f924823e6a (diff)
downloadpoky-8bfb7dabb7ebb692e740413379763c979cd3a7a6.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: da5f41996687e18b78d9c9845e621d832115aa1e) Signed-off-by: Paulo Neves <paulo@myneves.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-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 0a9ce0ede3..828729d8bb 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -331,7 +331,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
331 for dep in self.runtaskdeps[tid]: 331 for dep in self.runtaskdeps[tid]:
332 data += self.get_unihash(dep) 332 data += self.get_unihash(dep)
333 333
334 for (f, cs) in self.file_checksum_values[tid]: 334 for (f, cs) in sorted(self.file_checksum_values[tid], key=clean_checksum_file_path):
335 if cs: 335 if cs:
336 if "/./" in f: 336 if "/./" in f:
337 data += "./" + f.split("/./")[1] 337 data += "./" + f.split("/./")[1]
@@ -393,7 +393,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
393 if runtime and tid in self.taskhash: 393 if runtime and tid in self.taskhash:
394 data['runtaskdeps'] = self.runtaskdeps[tid] 394 data['runtaskdeps'] = self.runtaskdeps[tid]
395 data['file_checksum_values'] = [] 395 data['file_checksum_values'] = []
396 for f,cs in self.file_checksum_values[tid]: 396 for f,cs in sorted(self.file_checksum_values[tid], key=clean_checksum_file_path):
397 if "/./" in f: 397 if "/./" in f:
398 data['file_checksum_values'].append(("./" + f.split("/./")[1], cs)) 398 data['file_checksum_values'].append(("./" + f.split("/./")[1], cs))
399 else: 399 else:
@@ -720,6 +720,12 @@ class SignatureGeneratorTestMulticonfigDepends(SignatureGeneratorBasicHash):
720 name = "TestMulticonfigDepends" 720 name = "TestMulticonfigDepends"
721 supports_multiconfig_datacaches = True 721 supports_multiconfig_datacaches = True
722 722
723def clean_checksum_file_path(file_checksum_tuple):
724 f, cs = file_checksum_tuple
725 if "/./" in f:
726 return "./" + f.split("/./")[1]
727 return f
728
723def dump_this_task(outfile, d): 729def dump_this_task(outfile, d):
724 import bb.parse 730 import bb.parse
725 fn = d.getVar("BB_FILENAME") 731 fn = d.getVar("BB_FILENAME")