diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-07-19 22:59:04 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-26 13:16:40 +0100 |
commit | 896b36074641ad5120ca29888d1e71199aa1b1e0 (patch) | |
tree | d8f3d7710fda7431fe16a22b4c8a2e79b3fa78b4 | |
parent | 5b6fbaf7272215dd58b7c74f678cc49642eb0219 (diff) | |
download | poky-896b36074641ad5120ca29888d1e71199aa1b1e0.tar.gz |
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]
(From OE-Core rev: 21f0c5a50e00ac34975d79fd48f08730d8f19b15)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/distutils.bbclass | 8 | ||||
-rw-r--r-- | meta/classes/distutils3.bbclass | 8 | ||||
-rw-r--r-- | meta/classes/setuptools.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/setuptools3.bbclass | 4 |
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 ?= "" | |||
4 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" | 4 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" |
5 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ | 5 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ |
6 | --install-data=${STAGING_DATADIR}" | 6 | --install-data=${STAGING_DATADIR}" |
7 | DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ | 7 | DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ |
8 | --install-data=${D}/${datadir}" | 8 | --prefix=${prefix} \ |
9 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
10 | --install-data=${datadir}" | ||
9 | 11 | ||
10 | distutils_do_compile() { | 12 | distutils_do_compile() { |
11 | NO_FETCH_BUILD=1 \ | 13 | NO_FETCH_BUILD=1 \ |
@@ -35,7 +37,7 @@ distutils_do_install() { | |||
35 | STAGING_INCDIR=${STAGING_INCDIR} \ | 37 | STAGING_INCDIR=${STAGING_INCDIR} \ |
36 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 38 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
37 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ | 39 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ |
38 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ | 40 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \ |
39 | bbfatal_log "${PYTHON_PN} setup.py install execution failed." | 41 | bbfatal_log "${PYTHON_PN} setup.py install execution failed." |
40 | 42 | ||
41 | # support filenames with *spaces* | 43 | # 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 ?= "" | |||
5 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" | 5 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" |
6 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ | 6 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ |
7 | --install-data=${STAGING_DATADIR}" | 7 | --install-data=${STAGING_DATADIR}" |
8 | DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ | 8 | DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ |
9 | --install-data=${D}/${datadir}" | 9 | --prefix=${prefix} \ |
10 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
11 | --install-data=${datadir}" | ||
10 | 12 | ||
11 | distutils3_do_configure() { | 13 | distutils3_do_configure() { |
12 | if [ "${CLEANBROKEN}" != "1" ] ; then | 14 | if [ "${CLEANBROKEN}" != "1" ] ; then |
@@ -46,7 +48,7 @@ distutils3_do_install() { | |||
46 | STAGING_INCDIR=${STAGING_INCDIR} \ | 48 | STAGING_INCDIR=${STAGING_INCDIR} \ |
47 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 49 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
48 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ | 50 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ |
49 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ | 51 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \ |
50 | bbfatal_log "${PYTHON_PN} setup.py install execution failed." | 52 | bbfatal_log "${PYTHON_PN} setup.py install execution failed." |
51 | 53 | ||
52 | # support filenames with *spaces* | 54 | # 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 @@ | |||
1 | inherit distutils | 1 | inherit distutils |
2 | 2 | ||
3 | DEPENDS += "python-setuptools-native" | 3 | DEPENDS += "python-setuptools-native" |
4 | |||
5 | DISTUTILS_INSTALL_ARGS = "--root=${D} \ | ||
6 | --prefix=${prefix} \ | ||
7 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
8 | --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 | |||
2 | 2 | ||
3 | DEPENDS += "python3-setuptools-native" | 3 | DEPENDS += "python3-setuptools-native" |
4 | 4 | ||
5 | DISTUTILS_INSTALL_ARGS = "--root=${D} \ | ||
6 | --prefix=${prefix} \ | ||
7 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
8 | --install-data=${datadir}" | ||