From: "Richard Purdie" <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] sstatesig: Log timestamps for hashequiv in reprodubile builds for do_package
Date: Tue, 27 Oct 2020 16:10:11 +0000 [thread overview]
Message-ID: <20201027161011.139938-1-richard.purdie@linuxfoundation.org> (raw)
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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 4b8f264012c..64fb84ec924 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -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))))
--
2.25.1
next reply other threads:[~2020-10-27 16:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 16:10 Richard Purdie [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-27 15:54 [PATCH] sstatesig: Log timestamps for hashequiv in reprodubile builds for do_package Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201027161011.139938-1-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox