]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstatesig: Log timestamps for hashequiv in reprodubile builds for do_package
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Jan 2020 17:28:46 +0000 (17:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Oct 2020 12:37:53 +0000 (12:37 +0000)
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>
meta/lib/oe/sstatesig.py

index 4b8f264012c33b7b92cf24f7eda0e2e91617fb33..64fb84ec9248c46b880167512d49135e74e57653 100644 (file)
@@ -484,6 +484,9 @@ def OEOuthashBasic(path, sigfile, task, d):
     include_owners = os.environ.get('PSEUDO_DISABLED') == '0'
     if "package_write_" in task or task == "package_qa":
         include_owners = False
+    include_timestamps = False
+    if task == "package":
+        include_timestamps = d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1'
     extra_content = d.getVar('HASHEQUIV_HASH_VERSION')
 
     try:
@@ -558,6 +561,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))))