summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-29 17:28:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-30 13:04:39 +0000
commitcc840dfc9dbfdcdd286c9b0cb306dddbcc3250ec (patch)
tree26e9c59a675cd696f9734c68429f63de3b37553c /meta
parentb0f2ad4f6b3d36ccda713b4c15d3d337b0665e8f (diff)
downloadpoky-cc840dfc9dbfdcdd286c9b0cb306dddbcc3250ec.tar.gz
sstatesig: Log timestamps for hashequiv in reprodubile builds for do_package
Currently if a task generates the same output with different timestamps, hasequiv won't detect it but reproducibile builds will fail tests due to the different timestamps. Add do_package timestamps to the hash when reproducibile builds are enabled to avoid this. (From OE-Core rev: 11e8200ccec765ff6a4263e06512e5751eca261a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/sstatesig.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 4b8f264012..64fb84ec92 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -484,6 +484,9 @@ def OEOuthashBasic(path, sigfile, task, d):
484 include_owners = os.environ.get('PSEUDO_DISABLED') == '0' 484 include_owners = os.environ.get('PSEUDO_DISABLED') == '0'
485 if "package_write_" in task or task == "package_qa": 485 if "package_write_" in task or task == "package_qa":
486 include_owners = False 486 include_owners = False
487 include_timestamps = False
488 if task == "package":
489 include_timestamps = d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1'
487 extra_content = d.getVar('HASHEQUIV_HASH_VERSION') 490 extra_content = d.getVar('HASHEQUIV_HASH_VERSION')
488 491
489 try: 492 try:
@@ -558,6 +561,9 @@ def OEOuthashBasic(path, sigfile, task, d):
558 bb.warn("KeyError in %s" % path) 561 bb.warn("KeyError in %s" % path)
559 raise 562 raise
560 563
564 if include_timestamps:
565 update_hash(" %10d" % s.st_mtime)
566
561 update_hash(" ") 567 update_hash(" ")
562 if stat.S_ISBLK(s.st_mode) or stat.S_ISCHR(s.st_mode): 568 if stat.S_ISBLK(s.st_mode) or stat.S_ISCHR(s.st_mode):
563 update_hash("%9s" % ("%d.%d" % (os.major(s.st_rdev), os.minor(s.st_rdev)))) 569 update_hash("%9s" % ("%d.%d" % (os.major(s.st_rdev), os.minor(s.st_rdev))))