Patchwork python-native: disable user site support

login
register
mail settings
Submitter Yasir Khan
Date Aug. 13, 2014, 5:59 a.m.
Message ID <1407909584-48528-1-git-send-email-yasir_khan@mentor.com>
Download mbox | patch
Permalink /patch/78037/
State Accepted
Commit 77369679efb68ef89141fff914ccac93c836853e
Headers show

Comments

Yasir Khan - Aug. 13, 2014, 5:59 a.m.
From: Yasir-Khan <yasir_khan@mentor.com>

The user site-packages gets inserted into sys.path ahead of the
system site directories, so a site package installed there will
be used in preference to what's in our sysroot, causing less
deterministic builds, and potential build breakage, depending
on what the user has installed there. Disable it for our native
python, so they don't affect our builds.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Yasir-Khan <yasir_khan@mentor.com>
---
 .../recipes-devtools/python/python-native_2.7.3.bb |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb
index 827654d..e55f5fe 100644
--- a/meta/recipes-devtools/python/python-native_2.7.3.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -58,4 +58,8 @@  do_install() {
 	# (these often end up too long for the #! parser in the kernel as the
 	# buffer is 128 bytes long).
 	ln -s python-native/python ${D}${bindir}/nativepython
+	
+	# We don't want modules in ~/.local being used in preference to those
+	# installed in the native sysroot, so disable user site support.
+	sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
 }