diff mbox series

[blacksail,39/60] oe/reproducible: exclude __CACHED_SOURCE_DATE_EPOCH from task hash

Message ID 3158a0a97193cbc21272c07f3f95648920baf05c.1793867929.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [blacksail,01/60] gstreamer1.0-plugins-bad: use gtk+3 dependency name | expand

Commit Message

Yoann Congal Nov. 5, 2026, 8:42 a.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

epochfile_read() memoizes its result into __CACHED_SOURCE_DATE_EPOCH
via d.setVar(), so its runtime value leaks into the basehash of any
task that calls it, causing a "metadata is not deterministic" error
once SDE_FILE is populated.

Exclude it, since it is not meaningful build metadata, using the
bb.parse.vardepsexclude decorator on the function itself.

AI-Generated: Uses Kiro with Claude Sonnet 5
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
(cherry picked from commit aeaa8ba9d58d58b2f022e79abaf68a0849c66f2e)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/lib/oe/reproducible.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py
index a80376010a5..d8e1dc825fc 100644
--- a/meta/lib/oe/reproducible.py
+++ b/meta/lib/oe/reproducible.py
@@ -156,6 +156,9 @@  def get_source_date_epoch(d, sourcedir):
         fixed_source_date_epoch(d)       # Last resort
     )
 
+# epochfile_read() memoizes into __CACHED_SOURCE_DATE_EPOCH via d.setVar(), so
+# its runtime value must not leak into any task's hash.
+@bb.parse.vardepsexclude("__CACHED_SOURCE_DATE_EPOCH")
 def epochfile_read(epochfile, d):
     cached, efile = d.getVar('__CACHED_SOURCE_DATE_EPOCH') or (None, None)
     if cached and efile == epochfile: