In order to remove timestamps from all .pyc files we need to recompile
them with python3-native, as we cannot rely on the host python being
able to do that. Both python-native and python3-native derive the timestamp
from SOURCE_DATE_EPOCH if present.
However, building python3-native can be computationally expensive, so
we resort to python3-native only when building reproducible packages:
(BUILD_REPRODUCIBLE_BINARIES = '1'), otherwise we use the host python3.

[YOCTO #12543]

Signed-off-by: Juro Bystricky <>
 meta/recipes-graphics/xorg-proto/ | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-graphics/xorg-proto/ 
index 25a8373..02a42af 100644
--- a/meta/recipes-graphics/xorg-proto/
+++ b/meta/recipes-graphics/xorg-proto/
@@ -20,6 +20,11 @@ SRC_URI[sha256sum] = 
 inherit autotools pkgconfig
+# We prefer using host Python, but for reproducible builds we need to resort to
+# python3-native in order to have timestamps in compiled modules based on 
+# We cannot assume host Python supports SOURCE_DATE_EPOCH.
+inherit ${@oe.utils.ifelse(d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1', 
'python3native', '')}
 # Force the use of Python 3 and a specific library path so we don't need to
 # depend on python3-native

Openembedded-core mailing list

Reply via email to