public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Joshua Watt" <JPEWhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [OE-core][PATCH] classes/reproducible_build: Skip SDE for non-finalizing virtual recipes
Date: Thu,  2 Apr 2020 13:08:32 -0500	[thread overview]
Message-ID: <20200402180832.12814-1-JPEWhacker@gmail.com> (raw)

Don't capture the source date epoch for recipes that are not being
finalized. This prevents a virtual recipe (e.g. multilib) from
attempting to read the source date epoch file from the non-virtual
recipes workdir.

[YOCTO #13851]

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 meta/classes/reproducible_build.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass
index 8da40f656a..48ec9108a5 100644
--- a/meta/classes/reproducible_build.bbclass
+++ b/meta/classes/reproducible_build.bbclass
@@ -172,6 +172,20 @@ python create_source_date_epoch_stamp() {
 }
 
 def get_source_date_epoch_value(d):
+    onlyfinalize = d.getVar('__ONLYFINALISE')
+    virtual = "%s:%s" % (d.getVar("BBEXTENDCURR") or "", d.getVar("BBEXTENDVARIANT") or "")
+
+    if onlyfinalize == "default":
+        onlyfinalize = ":"
+
+    # Only capture the source date epoch if the current virtual recipe is the
+    # one being finalized. This prevents looking for the SDE file in another
+    # recipes ${WORKDIR}, where it may or may not exist
+    if onlyfinalize:
+        if onlyfinalize != virtual:
+            bb.debug(2, "Skipping SOURCE_DATE_EPOCH: virtual '%s' != finalize '%s'" % (virtual, onlyfinalize))
+            return 0
+
     cached = d.getVar('__CACHED_SOURCE_DATE_EPOCH')
     if cached:
         return cached
-- 
2.17.1


             reply	other threads:[~2020-04-02 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 18:08 Joshua Watt [this message]
2020-04-02 20:15 ` [OE-core][PATCH] classes/reproducible_build: Skip SDE for non-finalizing virtual recipes Richard Purdie
2020-04-02 23:04   ` Joshua Watt
2020-04-02 20:42 ` Richard Purdie
2020-04-02 23:09   ` Joshua Watt
2020-04-03 14:34   ` Joshua Watt

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=20200402180832.12814-1-JPEWhacker@gmail.com \
    --to=jpewhacker@gmail.com \
    --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