improve reproducibility of several packages
cover improve reproducibility of several packages
The patches in this patch set are independent and can be applied in any order/subset. They all allow building binary reproducible packages if built on
the same host. This is accomplished mostly by removing various
buil dhost information leaks or useless timestams.
Juro Bystricky (5):
python3-dev: improve reproducibility
gcc-runtime: improve reproducibility
attr-doc: improve reproducibility
sed-ptest: improve reproducibility
openssl-ptest: improve reproducibility
meta/recipes-connectivity/openssl/openssl10.inc | 6 ++++++ meta/recipes-devtools/gcc/gcc-runtime.inc | 12 ++++++++++++ meta/recipes-devtools/python/python3_3.5.3.bb | 5 +++++ meta/recipes-extended/sed/sed_4.2.2.bb | 6 ++++++ meta/recipes-support/attr/ea-acl.inc | 2 +- 5 files changed, 30 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/5 python3-dev: improve reproducibility
Remove remaining build host references from packaged files.
[#YOCTO 11472]
--- meta/recipes-devtools/python/python3_3.5.3.bb | 5 +++++ 1 file changed, 5 insertions(+)
meta/recipes-devtools/python/python3_3.5.3.bb +5 -0
@@ -186,6 +186,11 @@ py_package_preprocess () { install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile # Remove references to buildmachine paths in target Makefile and _sysconfigdata sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + -e 's:${RECIPE_SYSROOT}::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile \ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
Signature · 1 line
2.7.4
PATCH 2/5 gcc-runtime: improve reproducibility
In reply to Juro BystrickyRemove various build host references from packages:
libstdc++
libstdc++-staticdev
gcc-runtime-dbg
The references are removoved by correctly setting various compiler -fdebug-prefix-map settings. There are two main issues:
The default DEBUG_PREFIX_MAP variable references WORKDIR, however, gcc sources are in a shared folder (work-shared)/ Additionally, DWARF info seems to store symlink names but gcc seems to resolve symlink names referenced in -fdebug-prefix-map.
--- meta/recipes-devtools/gcc/gcc-runtime.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+)
meta/recipes-devtools/gcc/gcc-runtime.inc +12 -0
@@ -34,6 +34,18 @@ RUNTIMETARGET_remove_libc-musl = "libmpx" # libmudflap # libgfortran needs separate recipe due to libquadmath dependency +SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" +SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" + +DEBUG_PREFIX_MAP_class-target = " \ + -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \ + -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \ + -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \ + -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \ + -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \ + -fdebug-prefix-map=${B}=${SLIB_NEW} \ + " + do_configure () { export CXX="${CXX} -nostdinc++ -nostdlib++" for d in libgcc ${RUNTIMETARGET}; do
Signature · 1 line
2.7.4
PATCH 3/5 attr-doc: improve reproducibility
In reply to Juro BystrickyUse gzip compression without timestamps in the metadata. (Use gzip -n).
--- meta/recipes-support/attr/ea-acl.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/attr/ea-acl.inc +1 -1
@@ -17,7 +17,7 @@ EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('US EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}" do_install () { - oe_runmake install install-lib install-dev DIST_ROOT="${D}" + oe_runmake install install-lib install-dev DIST_ROOT="${D}" ZIP="gzip -n" } do_install_append_class-native () {
Signature · 1 line
2.7.4
PATCH 4/5 sed-ptest: improve reproducibility
In reply to Juro BystrickyRemove build host references
--- meta/recipes-extended/sed/sed_4.2.2.bb | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-extended/sed/sed_4.2.2.bb +6 -0
@@ -42,6 +42,12 @@ do_compile_ptest() { do_install_ptest() { oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} + sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile } RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
Signature · 1 line
2.7.4
PATCH 5/5 openssl-ptest: improve reproducibility
In reply to Juro BystrickyRemove buildhost references from Makefile and Configure.
--- meta/recipes-connectivity/openssl/openssl10.inc | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-connectivity/openssl/openssl10.inc +6 -0
@@ -261,6 +261,12 @@ do_install_ptest () { for d in ssltest_old v3ext x509aux; do rm -rf ${D}${libdir}/${BPN}/ptest/test/$d done + + # Remove build host references + sed -i \ + -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure } do_install_append_class-native() {
Signature · 1 line
2.7.4