[oe-commits] [openembedded-core] 09/09: reproducibile_build: Fix SDE file generation when unpack reruns

git at git.openembedded.org git at git.openembedded.org
Sun Mar 8 08:21:42 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 5d579fc2fe71637fc6e071aa66542befa39ac8bb
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Mar 7 18:03:40 2020 +0000

    reproducibile_build: Fix SDE file generation when unpack reruns
    
    Currently, if an existing TMPDIR is rebuilt, do_fetch/do_unpack can rerun
    but SDE would remain unchanged. This leads to different results compared
    to a fresh build. An example change which triggered this is:
    http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cb4e69e6346a9fbeebf83a5d5397cacbd41d48b5
    
    Instead, delete any existing SDE and recalculate if we're reunning.
    Also rename and drop the do_ prefix since these are for tasks,
    not functions.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/reproducible_build.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass
index 750eb95..8da40f6 100644
--- a/meta/classes/reproducible_build.bbclass
+++ b/meta/classes/reproducible_build.bbclass
@@ -150,11 +150,12 @@ def fixed_source_date_epoch():
     bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH")
     return 0
 
-python do_create_source_date_epoch_stamp() {
+python create_source_date_epoch_stamp() {
     epochfile = d.getVar('SDE_FILE')
+    # If it exists we need to regenerate as the sources may have changed
     if os.path.isfile(epochfile):
-        bb.debug(1, "Reusing SOURCE_DATE_EPOCH from: %s" % epochfile)
-        return
+        bb.debug(1, "Deleting existing SOURCE_DATE_EPOCH from: %s" % epochfile)
+        os.remove(epochfile)
 
     sourcedir = d.getVar('S')
     source_date_epoch = (
@@ -197,5 +198,5 @@ BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH"
 
 python () {
     if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1':
-        d.appendVarFlag("do_unpack", "postfuncs", " do_create_source_date_epoch_stamp")
+        d.appendVarFlag("do_unpack", "postfuncs", " create_source_date_epoch_stamp")
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list