* [Buildroot] [PATCH] pkg-python: ignore user site-packages directory
@ 2017-04-06 18:46 yegorslists at googlemail.com
2017-04-07 10:17 ` Yegor Yefremov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: yegorslists at googlemail.com @ 2017-04-06 18:46 UTC (permalink / raw)
To: buildroot
From: Yegor Yefremov <yegorslists@googlemail.com>
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.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
package/pkg-python.mk | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index fb124e1dd..2418f5dfa 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
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-python: ignore user site-packages directory
2017-04-06 18:46 [Buildroot] [PATCH] pkg-python: ignore user site-packages directory yegorslists at googlemail.com
@ 2017-04-07 10:17 ` Yegor Yefremov
2017-04-08 15:00 ` Thomas Petazzoni
2017-04-24 19:18 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov @ 2017-04-07 10:17 UTC (permalink / raw)
To: buildroot
On Thu, Apr 6, 2017 at 8:46 PM, <yegorslists@googlemail.com> wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> 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.
I've built a rather basic BR configuration with Python 2.7 and
experienced no problems.
@Anton: could you test the patch and let us know, whether it fixes your issue?
Yegor
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> package/pkg-python.mk | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index fb124e1dd..2418f5dfa 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
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-python: ignore user site-packages directory
2017-04-06 18:46 [Buildroot] [PATCH] pkg-python: ignore user site-packages directory yegorslists at googlemail.com
2017-04-07 10:17 ` Yegor Yefremov
@ 2017-04-08 15:00 ` Thomas Petazzoni
2017-04-24 19:18 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-04-08 15:00 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 6 Apr 2017 20:46:08 +0200, yegorslists at googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> 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.
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> package/pkg-python.mk | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-python: ignore user site-packages directory
2017-04-06 18:46 [Buildroot] [PATCH] pkg-python: ignore user site-packages directory yegorslists at googlemail.com
2017-04-07 10:17 ` Yegor Yefremov
2017-04-08 15:00 ` Thomas Petazzoni
@ 2017-04-24 19:18 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2017-04-24 19:18 UTC (permalink / raw)
To: buildroot
>>>>> "yegorslists" == yegorslists <yegorslists@googlemail.com> writes:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 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.
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Committed to 2017.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-24 19:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 18:46 [Buildroot] [PATCH] pkg-python: ignore user site-packages directory yegorslists at googlemail.com
2017-04-07 10:17 ` Yegor Yefremov
2017-04-08 15:00 ` Thomas Petazzoni
2017-04-24 19:18 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox