public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [OE-core][PATCH] classes/reproducible_build: Skip SDE for non-finalizing virtual recipes
@ 2020-04-02 18:08 Joshua Watt
  2020-04-02 20:15 ` Richard Purdie
  2020-04-02 20:42 ` Richard Purdie
  0 siblings, 2 replies; 6+ messages in thread
From: Joshua Watt @ 2020-04-02 18:08 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Watt

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-03 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 18:08 [OE-core][PATCH] classes/reproducible_build: Skip SDE for non-finalizing virtual recipes Joshua Watt
2020-04-02 20:15 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox