summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-29 17:28:46 +0000
committerSteve Sakoman <steve@sakoman.com>2020-11-02 05:19:32 -1000
commitcda769ed7c120edd7db0ff77e34fa1aa611a3082 (patch)
treef9563f6f619991dc3f3f29c5c2cc78da7f4126d5 /meta/lib
parent419d45ad6a72c6e296e27f9ae36ddf2a45671bfe (diff)
downloadopenembedded-core-contrib-cda769ed7c120edd7db0ff77e34fa1aa611a3082.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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 11e8200ccec765ff6a4263e06512e5751eca261a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib')
-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 d24e3738ae..d5a6200562 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -477,6 +477,9 @@ def OEOuthashBasic(path, sigfile, task, d):
h = hashlib.sha256()
prev_dir = os.getcwd()
include_owners = os.environ.get('PSEUDO_DISABLED') == '0'
+ include_timestamps = False
+ if task == "package":
+ include_timestamps = d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1'
extra_content = d.getVar('HASHEQUIV_HASH_VERSION')
try:
@@ -551,6 +554,9 @@ def OEOuthashBasic(path, sigfile, task, d):
bb.warn("KeyError in %s" % path)
raise
+ if include_timestamps:
+ update_hash(" %10d" % s.st_mtime)
+
update_hash(" ")
if stat.S_ISBLK(s.st_mode) or stat.S_ISCHR(s.st_mode):
update_hash("%9s" % ("%d.%d" % (os.major(s.st_rdev), os.minor(s.st_rdev))))