All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mark Hatle" <mark.hatle@kernel.crashing.org>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] reproducible_build: Work with externalsrc
Date: Wed,  8 Sep 2021 21:51:00 -0500	[thread overview]
Message-ID: <20210909025100.119427-3-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <20210909025100.119427-1-mark.hatle@kernel.crashing.org>

From: Mark Hatle <mark.hatle@xilinx.com>

Externalsrc removes do_fetch, do_unpack, and do_patch.  The system normally
discovers the correct reproducible date as a postfuncs on do_unpack, so this
date is never found, so it goes back to the default epoch.

Instead we can move the discovery function to a prefuncs on the epoch
deploy task.  This task will run before do_configure, and since the source
is already available can run anytime safely.

Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 meta/classes/reproducible_build.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass
index a9c117c3b9..ae0723ab21 100644
--- a/meta/classes/reproducible_build.bbclass
+++ b/meta/classes/reproducible_build.bbclass
@@ -128,7 +128,13 @@ BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH"
 python () {
     if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1':
         # Generate the timestamp with create_source_date_epoch_stamp.
-        d.appendVarFlag("do_unpack", "postfuncs", " create_source_date_epoch_stamp")
+        # In most cases this will be a postfuncs of do_unpack.
+        # If we're running in external source, add create_source_date_epoch_stamp
+        # to do_deploy_source_date_epoch instead because there is no do_unpack.
+        if d.getVar('EXTERNALSRC') and bb.data.inherits_class('externalsrc', d):
+            d.appendVarFlag('do_deploy_source_date_epoch', 'prefuncs', ' create_source_date_epoch_stamp')
+        else:
+            d.appendVarFlag("do_unpack", "postfuncs", " create_source_date_epoch_stamp")
         d.appendVar('SSTATETASKS', " do_deploy_source_date_epoch")
         bb.build.addtask('do_deploy_source_date_epoch_setscene', None, None, d)
         bb.build.addtask('do_deploy_source_date_epoch', 'do_configure', 'do_patch', d)
-- 
2.17.1


  parent reply	other threads:[~2021-09-09  2:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  2:50 [OE-core][PATCH 0/2] Fixes for reproducible build and externalsrc Mark Hatle
2021-09-09  2:50 ` [OE-core][PATCH 1/2] reproducible_build: Honor BUILD_REPRODUCIBLE_BINARIES Mark Hatle
2021-09-09  9:16   ` Peter Kjellerstedt
2021-09-09 10:18   ` Richard Purdie
2021-09-10  0:20     ` Douglas
2021-09-09  2:51 ` Mark Hatle [this message]
2021-09-10  0:32   ` [OE-core][PATCH 2/2] reproducible_build: Work with externalsrc Douglas
     [not found]     ` <796dd7e7-6a0d-a585-7765-bb5621db6128@gmail.com>
2021-09-10  1:12       ` Douglas

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=20210909025100.119427-3-mark.hatle@kernel.crashing.org \
    --to=mark.hatle@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.