mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-09 16:01:54 -09:00
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>
(cherry picked from commit f5da1951ad)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
1e9e1f3561
commit
57120d614e
@@ -28,6 +28,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_sysroot=$(STAGING_DIR) \
|
||||
_python_prefix=/usr \
|
||||
_python_exec_prefix=/usr
|
||||
@@ -43,7 +44,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
|
||||
@@ -52,6 +54,7 @@ HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
|
||||
PKG_PYTHON_SETUPTOOLS_ENV = \
|
||||
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
|
||||
@@ -70,7 +73,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
|
||||
|
||||
Reference in New Issue
Block a user