aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yegor Yefremov <yegorslists@googlemail.com>2017-04-06 20:46:08 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-04-08 15:45:41 +0200
commitf5da1951ad1e81cc8641f2c90e96fe36d08ec6f9 (patch)
treeb730deb5a8cd0ee5f6ef4cf2000c49633f782b5f
parent2be9ba9f58280ebe0094ef715ab14c31a22c9204 (diff)
downloadbuildroot-f5da1951ad1e81cc8641f2c90e96fe36d08ec6f9.tar.gz
buildroot-f5da1951ad1e81cc8641f2c90e96fe36d08ec6f9.tar.bz2
pkg-python: ignore user site-packages directory
According to PEP 370 Python will also search for the packages in the user site-packages directory. This can affect build reproducibility. The solution is to use PYTHONNOUSERSITE=1 for all Python packages, i.e. both host and target variants. Fixes bug #9791. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/pkg-python.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index fb124e1dd3..2418f5dfa4 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -32,6 +32,7 @@ PKG_PYTHON_DISTUTILS_ENV = \
LDFLAGS="$(TARGET_LDFLAGS)" \
LDSHARED="$(TARGET_CROSS)gcc -shared" \
PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \
+ PYTHONNOUSERSITE=1 \
_PYTHON_SYSCONFIGDATA_NAME="$(PKG_PYTHON_SYSCONFIGDATA_NAME)" \
_python_sysroot=$(STAGING_DIR) \
_python_prefix=/usr \
@@ -48,7 +49,8 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
# Host distutils-based packages
HOST_PKG_PYTHON_DISTUTILS_ENV = \
- PATH=$(BR_PATH)
+ PATH=$(BR_PATH) \
+ PYTHONNOUSERSITE=1
HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
--prefix=$(HOST_DIR)/usr
@@ -58,6 +60,7 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
_PYTHON_SYSCONFIGDATA_NAME="$(PKG_PYTHON_SYSCONFIGDATA_NAME)" \
PATH=$(BR_PATH) \
PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \
+ PYTHONNOUSERSITE=1 \
_python_sysroot=$(STAGING_DIR) \
_python_prefix=/usr \
_python_exec_prefix=/usr
@@ -76,7 +79,8 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
# Host setuptools-based packages
HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
- PATH=$(BR_PATH)
+ PATH=$(BR_PATH) \
+ PYTHONNOUSERSITE=1
HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
--prefix=$(HOST_DIR)/usr