[OE-core] [PATCH 1/1] python-xcbgen_1.12: improve reproducibility

Juro Bystricky juro.bystricky at intel.com
Fri Apr 6 19:57:21 UTC 2018


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 <juro.bystricky at intel.com>
---
 meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
index 25a8373..02a42af 100644
--- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
@@ -20,6 +20,11 @@ SRC_URI[sha256sum] = "5922aba4c664ab7899a29d92ea91a87aa4c1fc7eb5ee550325c3216c48
 
 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 SOURCE_DATE_EPOCH.
+# 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
 CACHED_CONFIGUREVARS += "PYTHON=python3 am_cv_python_pythondir=${libdir}/xcb-proto"
-- 
2.7.4




More information about the Openembedded-core mailing list