summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-07-19 22:59:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:31 +0100
commit21f0c5a50e00ac34975d79fd48f08730d8f19b15 (patch)
treee98372c554452fd702201bc940c1d86317051129 /meta
parented0413babaf10ccf729472f603bbe32d84ba1931 (diff)
downloadopenembedded-core-contrib-21f0c5a50e00ac34975d79fd48f08730d8f19b15.tar.gz
openembedded-core-contrib-21f0c5a50e00ac34975d79fd48f08730d8f19b15.tar.bz2
openembedded-core-contrib-21f0c5a50e00ac34975d79fd48f08730d8f19b15.zip
distutils/setuptools, distutils3/setuptools3: improve reproducibility
- Unify var-DISTUTILS_INSTALL_ARGS in distutils and setuptools - Supply "--root" directory to the "install" command, and use it as a prefix to strip off the purported filename encoded in bytecode files. (It strips build path prefix from .pyc files) [YOCTO #8446] [YOCTO #12084] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/distutils.bbclass8
-rw-r--r--meta/classes/distutils3.bbclass8
-rw-r--r--meta/classes/setuptools.bbclass5
-rw-r--r--meta/classes/setuptools3.bbclass4
4 files changed, 10 insertions, 15 deletions
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index c2f74039cb..3cf1d6b786 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -4,8 +4,10 @@ DISTUTILS_BUILD_ARGS ?= ""
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
--install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
- --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
distutils_do_compile() {
NO_FETCH_BUILD=1 \
@@ -35,7 +37,7 @@ distutils_do_install() {
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
- ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
bbfatal_log "${PYTHON_PN} setup.py install execution failed."
# support filenames with *spaces*
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
index f8aca5e62f..d01d9d78d5 100644
--- a/meta/classes/distutils3.bbclass
+++ b/meta/classes/distutils3.bbclass
@@ -5,8 +5,10 @@ DISTUTILS_BUILD_EXT_ARGS ?= ""
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
--install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
- --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
distutils3_do_configure() {
if [ "${CLEANBROKEN}" != "1" ] ; then
@@ -46,7 +48,7 @@ distutils3_do_install() {
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
- ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
bbfatal_log "${PYTHON_PN} setup.py install execution failed."
# support filenames with *spaces*
diff --git a/meta/classes/setuptools.bbclass b/meta/classes/setuptools.bbclass
index 157ef63b68..a923ea3c4a 100644
--- a/meta/classes/setuptools.bbclass
+++ b/meta/classes/setuptools.bbclass
@@ -1,8 +1,3 @@
inherit distutils
DEPENDS += "python-setuptools-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
- --prefix=${prefix} \
- --install-lib=${PYTHON_SITEPACKAGES_DIR} \
- --install-data=${datadir}"
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass
index de6dd9440c..8ca66ee708 100644
--- a/meta/classes/setuptools3.bbclass
+++ b/meta/classes/setuptools3.bbclass
@@ -2,7 +2,3 @@ inherit distutils3
DEPENDS += "python3-setuptools-native"
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
- --prefix=${prefix} \
- --install-lib=${PYTHON_SITEPACKAGES_DIR} \
- --install-data=${datadir}"