Skip to contentSkip to conversation

Fix the python cffi issue

PATCH New Thomas Petazzoni 2 participants 18 messages Jul 12, 2017 – Jul 13, 2017

lore
Share & tools
lore
#0 lore raw

cover Fix the python cffi issue

Hello,

This patch series fixes the long-standing build errors reported by the autobuilders on the following packages:

- python-cryptography
- python-pynacl
- python-smbus-cffi

Those errors were caused by the host Python interpreter picking up a target library because $(TARGET_DIR)/usr/lib/python<version>/site-packages/ is part of the PYTHON_PATH when the host Python interpreter is used to build/install Python modules for the target. This is bogus, because it lets the host Python interpreter import target libraries, which obviously is incorrect.

Therefore, to solve this issue, PATCH 8/8 removes $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/ from PYTHONPATH.

However, doing this uncovered issues in other Python packages:

- A few Python packages (python-pyasn, python-pyro and python-u-msgpack) started to fail building. Switching them from distutils to setuptools fixed the issue, and since setuptools is preferred to setuptools, it's anyway a good change. Patches 1/8, 2/8 and 3/8 are fixing this.

- A few Python packages had missing dependencies on host Python modules, because the corresponding target Python module was installed, and picked up by the host Python interpreter due to our bogus PYTHONPATH value. Patches 4/8, 5/8, 6/8 and 7/8 are fixing this.

Note that we are not doing the change for Python 3 as part of this series because:

- The python-cffi issue does not occur with Python 3.x.

- python3.mk defines PYTHON3_PATH as $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/:$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/. Both directories are not good to pass in PYTHONPATH, but at least the
first one is needed to allow the host Python interpreter to find
the sysconfigdata module, that is needed to cross-compile native
Python modules. So the same solution as python.mk cannot be
applied.

This patch series has been tested with a defconfig that has a large number of Python packages enabled:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.05-834-gb595627.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_ALSAAUDIO=y
BR2_PACKAGE_PYTHON_ARROW=y
BR2_PACKAGE_PYTHON_ATTRS=y
BR2_PACKAGE_PYTHON_AUTOBAHN=y
BR2_PACKAGE_PYTHON_BITSTRING=y
BR2_PACKAGE_PYTHON_BOTTLE=y
BR2_PACKAGE_PYTHON_CAN=y
BR2_PACKAGE_PYTHON_CBOR=y
BR2_PACKAGE_PYTHON_CHARDET=y
BR2_PACKAGE_PYTHON_CHEETAH=y
BR2_PACKAGE_PYTHON_CHERRYPY=y
BR2_PACKAGE_PYTHON_CONFIGOBJ=y
BR2_PACKAGE_PYTHON_CONFIGSHELL_FB=y
BR2_PACKAGE_PYTHON_CRC16=y
BR2_PACKAGE_PYTHON_CRCMOD=y
BR2_PACKAGE_PYTHON_CSSSELECT=y
BR2_PACKAGE_PYTHON_CSSUTILS=y
BR2_PACKAGE_PYTHON_DAEMON=y
BR2_PACKAGE_PYTHON_DIALOG=y
BR2_PACKAGE_PYTHON_DICTTOXML=y
BR2_PACKAGE_PYTHON_DJANGO=y
BR2_PACKAGE_PYTHON_DOCOPT=y
BR2_PACKAGE_PYTHON_DPKT=y
BR2_PACKAGE_PYTHON_ECDSA=y
BR2_PACKAGE_PYTHON_ENUM=y
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
BR2_PACKAGE_PYTHON_FLUP=y
BR2_PACKAGE_PYTHON_GOBJECT=y
BR2_PACKAGE_PYTHON_GUNICORN=y
BR2_PACKAGE_PYTHON_HTML5LIB=y
BR2_PACKAGE_PYTHON_HTTPLIB2=y
BR2_PACKAGE_PYTHON_HUMANIZE=y
BR2_PACKAGE_PYTHON_ID3=y
BR2_PACKAGE_PYTHON_INIPARSE=y
BR2_PACKAGE_PYTHON_IOWAIT=y
BR2_PACKAGE_PYTHON_IPADDR=y
BR2_PACKAGE_PYTHON_IPY=y
BR2_PACKAGE_PYTHON_IPYTHON=y
BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR=y
BR2_PACKAGE_PYTHON_KEYRING=y
BR2_PACKAGE_PYTHON_LIBCONFIG=y
BR2_PACKAGE_PYTHON_LMDB=y
BR2_PACKAGE_PYTHON_LXML=y
BR2_PACKAGE_PYTHON_MAD=y
BR2_PACKAGE_PYTHON_MARKDOWN=y
BR2_PACKAGE_PYTHON_MELD3=y
BR2_PACKAGE_PYTHON_MISTUNE=y
BR2_PACKAGE_PYTHON_MSGPACK=y
BR2_PACKAGE_PYTHON_MUTAGEN=y
BR2_PACKAGE_PYTHON_MWSCRAPE=y
BR2_PACKAGE_PYTHON_NETADDR=y
BR2_PACKAGE_PYTHON_NETIFACES=y
BR2_PACKAGE_PYTHON_NFC=y
BR2_PACKAGE_PYTHON_NUMPY=y
BR2_PACKAGE_PYTHON_PAHO_MQTT=y
BR2_PACKAGE_PYTHON_PAM=y
BR2_PACKAGE_PYTHON_PARAMIKO=y
BR2_PACKAGE_PYTHON_PILLOW=y
BR2_PACKAGE_PYTHON_POSIX_IPC=y
BR2_PACKAGE_PYTHON_PSUTIL=y
BR2_PACKAGE_PYTHON_PUDB=y
BR2_PACKAGE_PYTHON_PYCLI=y
BR2_PACKAGE_PYTHON_PYCPARSER=y
BR2_PACKAGE_PYTHON_PYELFTOOLS=y
BR2_PACKAGE_PYTHON_PYFTPDLIB=y
BR2_PACKAGE_PYTHON_PYGAME=y
BR2_PACKAGE_PYTHON_PYGAME_IMAGE=y
BR2_PACKAGE_PYTHON_PYGAME_EXAMPLES=y
BR2_PACKAGE_PYTHON_PYGAME_FONT=y
BR2_PACKAGE_PYTHON_PYGAME_MIXER=y
BR2_PACKAGE_PYTHON_PYINOTIFY=y
BR2_PACKAGE_PYTHON_PYLIBFTDI=y
BR2_PACKAGE_PYTHON_PYMYSQL=y
BR2_PACKAGE_PYTHON_PYPARTED=y
BR2_PACKAGE_PYTHON_PYPCAP=y
BR2_PACKAGE_PYTHON_PYQRCODE=y
BR2_PACKAGE_PYTHON_PYRATEMP=y
BR2_PACKAGE_PYTHON_PYRO=y
BR2_PACKAGE_PYTHON_PYROUTE2=y
BR2_PACKAGE_PYTHON_PYSENDFILE=y
BR2_PACKAGE_PYTHON_PYSMB=y
BR2_PACKAGE_PYTHON_PYSNMP_APPS=y
BR2_PACKAGE_PYTHON_PYSNMP_MIBS=y
BR2_PACKAGE_PYTHON_PYSOCKS=y
BR2_PACKAGE_PYTHON_PYTABLEWRITER=y
BR2_PACKAGE_PYTHON_PYTRIE=y
BR2_PACKAGE_PYTHON_PYUSB=y
BR2_PACKAGE_PYTHON_PYXB=y
BR2_PACKAGE_PYTHON_PYZMQ=y
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
BR2_PACKAGE_PYTHON_RPI_GPIO=y
BR2_PACKAGE_PYTHON_RTSLIB_FB=y
BR2_PACKAGE_PYTHON_SDNOTIFY=y
BR2_PACKAGE_PYTHON_SERIAL=y
BR2_PACKAGE_PYTHON_SETPROCTITLE=y
BR2_PACKAGE_PYTHON_SH=y
BR2_PACKAGE_PYTHON_SHUTILWHICH=y
BR2_PACKAGE_PYTHON_SIMPLEJSON=y
BR2_PACKAGE_PYTHON_SMBUS_CFFI=y
BR2_PACKAGE_PYTHON_SOCKETIO=y
BR2_PACKAGE_PYTHON_SORTEDCONTAINERS=y
BR2_PACKAGE_PYTHON_SPIDEV=y
BR2_PACKAGE_PYTHON_THRIFT=y
BR2_PACKAGE_PYTHON_TOMAKO=y
BR2_PACKAGE_PYTHON_TREQ=y
BR2_PACKAGE_PYTHON_U_MSGPACK=y
BR2_PACKAGE_PYTHON_UBJSON=y
BR2_PACKAGE_PYTHON_UJSON=y
BR2_PACKAGE_PYTHON_URLLIB3=y
BR2_PACKAGE_PYTHON_VERSIONTOOLS=y
BR2_PACKAGE_PYTHON_WATCHDOG=y
BR2_PACKAGE_PYTHON_WEB2PY=y
BR2_PACKAGE_PYTHON_WEBPY=y
BR2_PACKAGE_PYTHON_WHOOSH=y
BR2_PACKAGE_PYTHON_WS4PY=y
BR2_PACKAGE_PYTHON_WSACCEL=y
BR2_PACKAGE_PYTHON_XLUTILS=y
# BR2_TARGET_ROOTFS_TAR is not set

Best regards,

Thomas

Thomas Petazzoni (8):
python-pyasn: switch to setuptools instead of distutils
python-pyro: switch to setuptools instead of distutils
python-u-msgpack: switch to setuptools instead of distutils
python-versiontools: add host variant python-json-schema-validator: needs versiontools on the host
python-incremental: add host variant
python-treq: needs host-python-incremental
python: remove target Python packages from PYTHONPATH

 package/python-incremental/python-incremental.mk                     | 1 +
 package/python-json-schema-validator/Config.in                       | 1 -
 package/python-json-schema-validator/python-json-schema-validator.mk | 2 +-
 package/python-pyasn/python-pyasn.mk                                 | 2 +-
 package/python-pyro/python-pyro.mk                                   | 2 +-
 package/python-treq/python-treq.mk                                   | 1 +
 package/python-u-msgpack/python-u-msgpack.mk                         | 2 +-
 package/python-versiontools/python-versiontools.mk                   | 1 +
 package/python/python.mk                                             | 2 +-
 9 files changed, 8 insertions(+), 6 deletions(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/8 python-pyasn: switch to setuptools instead of distutils

python-pyasn can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

---
 package/python-pyasn/python-pyasn.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pyasn/python-pyasn.mk +1 -1
index 255341f..f34520f 100644
@@ -9,6 +9,6 @@ PYTHON_PYASN_SOURCE = pyasn1-$(PYTHON_PYASN_VERSION).tar.gz
 PYTHON_PYASN_SITE = https://pypi.python.org/packages/source/p/pyasn1
 PYTHON_PYASN_LICENSE = BSD-2-Clause
 PYTHON_PYASN_LICENSE_FILES = LICENSE.txt
-PYTHON_PYASN_SETUP_TYPE = distutils
+PYTHON_PYASN_SETUP_TYPE = setuptools
 
 $(eval $(python-package))
Signature · 1 line
2.9.4
#2 lore raw

PATCH 1/8 python-pyasn: switch to setuptools instead of distutils

Quoted 35 lines · Thomas Petazzoni

python-pyasn can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

Quoted 7 lines

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

Quoted 19 lines
---
 package/python-pyasn/python-pyasn.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pyasn/python-pyasn.mk +1 -2
index 255341f..f34520f 100644
@@ -9,6 +9,6 @@ PYTHON_PYASN_SOURCE = pyasn1-$(PYTHON_PYASN_VERSION).tar.gz
 PYTHON_PYASN_SITE = https://pypi.python.org/packages/source/p/pyasn1
 PYTHON_PYASN_LICENSE = BSD-2-Clause
 PYTHON_PYASN_LICENSE_FILES = LICENSE.txt
-PYTHON_PYASN_SETUP_TYPE = distutils
+PYTHON_PYASN_SETUP_TYPE = setuptools
 
 $(eval $(python-package))
--

2.9.4

#3 lore raw

PATCH 2/8 python-pyro: switch to setuptools instead of distutils

In reply to Thomas Petazzoni

python-pyro can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

---
 package/python-pyro/python-pyro.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pyro/python-pyro.mk +1 -1
index bf916ba..06b4f45 100644
@@ -9,6 +9,6 @@ PYTHON_PYRO_SOURCE = Pyro-$(PYTHON_PYRO_VERSION).tar.gz
 PYTHON_PYRO_SITE = https://pypi.python.org/packages/61/68/0978adae315261b87acd216517c2c7f00780396e4d1426c5412458c6a28f
 PYTHON_PYRO_LICENSE = MIT
 PYTHON_PYRO_LICENSE_FILES = LICENSE
-PYTHON_PYRO_SETUP_TYPE = distutils
+PYTHON_PYRO_SETUP_TYPE = setuptools
 
 $(eval $(python-package))
Signature · 1 line
2.9.4
#4 lore raw

PATCH 2/8 python-pyro: switch to setuptools instead of distutils

Quoted 35 lines · Thomas Petazzoni

python-pyro can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

Quoted 7 lines

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

Quoted 19 lines
---
 package/python-pyro/python-pyro.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pyro/python-pyro.mk +1 -2
index bf916ba..06b4f45 100644
@@ -9,6 +9,6 @@ PYTHON_PYRO_SOURCE = Pyro-$(PYTHON_PYRO_VERSION).tar.gz
 PYTHON_PYRO_SITE = https://pypi.python.org/packages/61/68/0978adae315261b87acd216517c2c7f00780396e4d1426c5412458c6a28f
 PYTHON_PYRO_LICENSE = MIT
 PYTHON_PYRO_LICENSE_FILES = LICENSE
-PYTHON_PYRO_SETUP_TYPE = distutils
+PYTHON_PYRO_SETUP_TYPE = setuptools
 
 $(eval $(python-package))
--

2.9.4

#5 lore raw

PATCH 3/8 python-u-msgpack: switch to setuptools instead of distutils

In reply to Thomas Petazzoni

python-u-msgpack can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

---
 package/python-u-msgpack/python-u-msgpack.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-u-msgpack/python-u-msgpack.mk +1 -1
index a88beeb..89240c3 100644
@@ -7,7 +7,7 @@
 PYTHON_U_MSGPACK_VERSION = 2.2
 PYTHON_U_MSGPACK_SOURCE = u-msgpack-python-$(PYTHON_U_MSGPACK_VERSION).tar.gz
 PYTHON_U_MSGPACK_SITE = https://pypi.python.org/packages/66/5b/36fe0fcf290bd39f6ef6c1f5924cf0a9a76b0dc94575975ad7d318619cf9
-PYTHON_U_MSGPACK_SETUP_TYPE = distutils
+PYTHON_U_MSGPACK_SETUP_TYPE = setuptools
 PYTHON_U_MSGPACK_LICENSE = MIT
 PYTHON_U_MSGPACK_LICENSE_FILES = LICENSE
 
Signature · 1 line
2.9.4
#6 lore raw

PATCH 3/8 python-u-msgpack: switch to setuptools instead of distutils

Quoted 35 lines · Thomas Petazzoni

python-u-msgpack can use setuptools instead of distutils, and using setuptools is generally preferred.

In addition, using setuptools allows to make sure the package will continue to build when we will adjust the PYTHONPATH variable to no longer point to target Python modules. Without such a change to setuptools, the build would fail with:

=====================================================================
running install
Checking .pth file support in /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ /home/test/buildroot/output/host/bin/python -E -c pass
TEST FAILED: /home/test/buildroot/output/target/usr/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/test/buildroot/output/target/usr/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

'/home/test/buildroot/output/target/usr/lib/python2.7/sysconfigdata/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

Quoted 7 lines

* You can set up the installation directory to support ".pth" files by using one of the approaches described here:

https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
=====================================================================

Quoted 20 lines
---
 package/python-u-msgpack/python-u-msgpack.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-u-msgpack/python-u-msgpack.mk +1 -2
index a88beeb..89240c3 100644
@@ -7,7 +7,7 @@
 PYTHON_U_MSGPACK_VERSION = 2.2
 PYTHON_U_MSGPACK_SOURCE = u-msgpack-python-$(PYTHON_U_MSGPACK_VERSION).tar.gz
 PYTHON_U_MSGPACK_SITE = https://pypi.python.org/packages/66/5b/36fe0fcf290bd39f6ef6c1f5924cf0a9a76b0dc94575975ad7d318619cf9
-PYTHON_U_MSGPACK_SETUP_TYPE = distutils
+PYTHON_U_MSGPACK_SETUP_TYPE = setuptools
 PYTHON_U_MSGPACK_LICENSE = MIT
 PYTHON_U_MSGPACK_LICENSE_FILES = LICENSE
 
--

2.9.4

#7 lore raw

PATCH 4/8 python-versiontools: add host variant

In reply to Thomas Petazzoni

It will be needed by python-json-schema-validator.

---
 package/python-versiontools/python-versiontools.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-versiontools/python-versiontools.mk +1 -0
index 2170730..fbf1040 100644
@@ -11,3 +11,4 @@ PYTHON_VERSIONTOOLS_SETUP_TYPE = setuptools
 PYTHON_VERSIONTOOLS_LICENSE = LGPL-3.0
 
 $(eval $(python-package))
+$(eval $(host-python-package))
Signature · 1 line
2.9.4
#8 lore raw

PATCH 4/8 python-versiontools: add host variant

Quoted 3 lines · Thomas Petazzoni

It will be needed by python-json-schema-validator.

Quoted 16 lines
---
 package/python-versiontools/python-versiontools.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-versiontools/python-versiontools.mk +1 -1
index 2170730..fbf1040 100644
@@ -11,3 +11,4 @@ PYTHON_VERSIONTOOLS_SETUP_TYPE = setuptools
 PYTHON_VERSIONTOOLS_LICENSE = LGPL-3.0
 
 $(eval $(python-package))
+$(eval $(host-python-package))
--

2.9.4

#9 lore raw

PATCH 5/8 python-json-schema-validator: needs versiontools on the host

In reply to Thomas Petazzoni

python-json-schema-validator does not need versiontools on the target, but only on the host, as it's listed in setup_requires in setup.py.

This was not noticed so far because host Python interpreter is started with a PYTHONPATH that contains a directory with target Python packages, so versiontools was found there. But as we are about to fix PYTHONPATH to no longer include such a directory, python-json-schema-validator would fail due to versiontools being missed on the host.

---
 package/python-json-schema-validator/Config.in                       | 1 -
 package/python-json-schema-validator/python-json-schema-validator.mk | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
package/python-json-schema-validator/Config.in +0 -1
index dbc5328..e50e8ee 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR
 	bool "python-json-schema-validator"
-	select BR2_PACKAGE_PYTHON_VERSIONTOOLS
 	help
 	  JSON Schema Validator
 
package/python-json-schema-validator/python-json-schema-validator.mk +1 -1
index 6accbd6..c0a335c 100644
@@ -9,6 +9,6 @@ PYTHON_JSON_SCHEMA_VALIDATOR_SOURCE = json-schema-validator-$(PYTHON_JSON_SCHEMA
 PYTHON_JSON_SCHEMA_VALIDATOR_SITE = https://pypi.python.org/packages/70/46/ba39cb7efad1898cfc89bf3588b8612f24d128f1c25b761994f524a59cef
 PYTHON_JSON_SCHEMA_VALIDATOR_LICENSE = LGPL-3.0
 PYTHON_JSON_SCHEMA_VALIDATOR_SETUP_TYPE = setuptools
-PYTHON_JSON_SCHEMA_VALIDATOR_DEPENDENCIES = python-versiontools
+PYTHON_JSON_SCHEMA_VALIDATOR_DEPENDENCIES = host-python-versiontools
 
 $(eval $(python-package))
Signature · 1 line
2.9.4
#10 lore raw

PATCH 5/8 python-json-schema-validator: needs versiontools on the host

Quoted 11 lines · Thomas Petazzoni

python-json-schema-validator does not need versiontools on the target, but only on the host, as it's listed in setup_requires in setup.py.

This was not noticed so far because host Python interpreter is started with a PYTHONPATH that contains a directory with target Python packages, so versiontools was found there. But as we are about to fix PYTHONPATH to no longer include such a directory, python-json-schema-validator would fail due to versiontools being missed on the host.

Quoted 31 lines
---
 package/python-json-schema-validator/Config.in                       | 1 -
 package/python-json-schema-validator/python-json-schema-validator.mk | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
package/python-json-schema-validator/Config.in +0 -1
index dbc5328..e50e8ee 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR
        bool "python-json-schema-validator"
-       select BR2_PACKAGE_PYTHON_VERSIONTOOLS
        help
          JSON Schema Validator
 
package/python-json-schema-validator/python-json-schema-validator.mk +1 -2
index 6accbd6..c0a335c 100644
@@ -9,6 +9,6 @@ PYTHON_JSON_SCHEMA_VALIDATOR_SOURCE = json-schema-validator-$(PYTHON_JSON_SCHEMA
 PYTHON_JSON_SCHEMA_VALIDATOR_SITE = https://pypi.python.org/packages/70/46/ba39cb7efad1898cfc89bf3588b8612f24d128f1c25b761994f524a59cef
 PYTHON_JSON_SCHEMA_VALIDATOR_LICENSE = LGPL-3.0
 PYTHON_JSON_SCHEMA_VALIDATOR_SETUP_TYPE = setuptools
-PYTHON_JSON_SCHEMA_VALIDATOR_DEPENDENCIES = python-versiontools
+PYTHON_JSON_SCHEMA_VALIDATOR_DEPENDENCIES = host-python-versiontools
 
 $(eval $(python-package))
--

2.9.4

#11 lore raw

PATCH 6/8 python-incremental: add host variant

In reply to Thomas Petazzoni

A host variant of the python-incremental package will be needed for the python-treq package.

---
 package/python-incremental/python-incremental.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-incremental/python-incremental.mk +1 -0
index 64eda68..fc1975f 100644
@@ -12,3 +12,4 @@ PYTHON_INCREMENTAL_LICENSE = MIT
 PYTHON_INCREMENTAL_LICENSE_FILES = LICENSE
 
 $(eval $(python-package))
+$(eval $(host-python-package))
Signature · 1 line
2.9.4
#12 lore raw

PATCH 6/8 python-incremental: add host variant

Quoted 4 lines · Thomas Petazzoni

A host variant of the python-incremental package will be needed for the python-treq package.

Quoted 16 lines
---
 package/python-incremental/python-incremental.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-incremental/python-incremental.mk +1 -1
index 64eda68..fc1975f 100644
@@ -12,3 +12,4 @@ PYTHON_INCREMENTAL_LICENSE = MIT
 PYTHON_INCREMENTAL_LICENSE_FILES = LICENSE
 
 $(eval $(python-package))
+$(eval $(host-python-package))
--

2.9.4

#13 lore raw

PATCH 7/8 python-treq: needs host-python-incremental

In reply to Thomas Petazzoni

The python-treq package lists the incremental Python module as part of its setup_requires variable in setup.py, so it must be added as a host dependency of the python-treq package to avoid build failures.

So far, this issue wasn't visible because python-treq selects python-twisted, which itself selects the target python-incremental package. Because python-incremental was before python-treq in the alphabetic ordering, it was always built before python-treq. And due to the fact that PYTHONPATH currently contains the directory with target Python modules, the host Python interpreter was happily using the target python-incremental while running on the host. But as we are going to clean up PYTHONPATH, this will no longer be the case, and hence python-treq needs to be fixed.

---
 package/python-treq/python-treq.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-treq/python-treq.mk +1 -0
index aa8c191..051b8ff 100644
@@ -10,5 +10,6 @@ PYTHON_TREQ_SITE = https://pypi.python.org/packages/26/4b/303880fb5bab1111654df2
 PYTHON_TREQ_LICENSE = MIT
 PYTHON_TREQ_LICENSE_FILES = LICENSE
 PYTHON_TREQ_SETUP_TYPE = setuptools
+PYTHON_TREQ_DEPENDENCIES = host-python-incremental
 
 $(eval $(python-package))
Signature · 1 line
2.9.4
#14 lore raw

PATCH 7/8 python-treq: needs host-python-incremental

Quoted 14 lines · Thomas Petazzoni

The python-treq package lists the incremental Python module as part of its setup_requires variable in setup.py, so it must be added as a host dependency of the python-treq package to avoid build failures.

So far, this issue wasn't visible because python-treq selects python-twisted, which itself selects the target python-incremental package. Because python-incremental was before python-treq in the alphabetic ordering, it was always built before python-treq. And due to the fact that PYTHONPATH currently contains the directory with target Python modules, the host Python interpreter was happily using the target python-incremental while running on the host. But as we are going to clean up PYTHONPATH, this will no longer be the case, and hence python-treq needs to be fixed.

Quoted 1 line
Quoted 18 lines
---
 package/python-treq/python-treq.mk | 1 +
 1 file changed, 1 insertion(+)
package/python-treq/python-treq.mk +1 -1
index aa8c191..051b8ff 100644
@@ -10,5 +10,6 @@ PYTHON_TREQ_SITE = https://pypi.python.org/packages/26/4b/303880fb5bab1111654df2
 PYTHON_TREQ_LICENSE = MIT
 PYTHON_TREQ_LICENSE_FILES = LICENSE
 PYTHON_TREQ_SETUP_TYPE = setuptools
+PYTHON_TREQ_DEPENDENCIES = host-python-incremental
 
 $(eval $(python-package))
--

2.9.4

#15 lore raw

PATCH 8/8 python: remove target Python packages from PYTHONPATH

In reply to Thomas Petazzoni

We currently have $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/ inside the PYTHON_PATH variable, which gets used to define PYTHONPATH, passed to the host Python interpreter when building/installing target packages.

However, this is terribly wrong, as it causes the host interpreter to potentially import target Python packages. This is wrong for several reasons:

- Some Python packages might need some Python modules to be installed on the host (described in setup_requires in setup.py), but their installation currently works because by luck the corresponding Python module is installed for the target. Some of those cases were happening for real, and fixed by previous patches.

- Some Python packages include some native code, therefore built for a specific CPU architecture. When you point the host Python interpreter to native libraries built for the target, you get nice build failures, such as the one affecting the python-cffi related packages.

Making this change allows to fix the python-cffi related build failures:

http://autobuild.buildroot.net/results/a9af84f2d845ee25e2b7d8b92aef485112b46060/
(python-cryptography)

http://autobuild.buildroot.net/results/b017c4f6b4d45c0afbf06a80dbd3f2ebe5d49d20/
(python-pynacl)

http://autobuild.buildroot.net/results/25144ea191ad46d851b31d3a2f0ef939f215494b/
(python-smbus-cffi)

This change has been verified with the following defconfig that enables a lot of Python packages:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.05-834-gb595627.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_ALSAAUDIO=y
BR2_PACKAGE_PYTHON_ARROW=y
BR2_PACKAGE_PYTHON_ATTRS=y
BR2_PACKAGE_PYTHON_AUTOBAHN=y
BR2_PACKAGE_PYTHON_BITSTRING=y
BR2_PACKAGE_PYTHON_BOTTLE=y
BR2_PACKAGE_PYTHON_CAN=y
BR2_PACKAGE_PYTHON_CBOR=y
BR2_PACKAGE_PYTHON_CHARDET=y
BR2_PACKAGE_PYTHON_CHEETAH=y
BR2_PACKAGE_PYTHON_CHERRYPY=y
BR2_PACKAGE_PYTHON_CONFIGOBJ=y
BR2_PACKAGE_PYTHON_CONFIGSHELL_FB=y
BR2_PACKAGE_PYTHON_CRC16=y
BR2_PACKAGE_PYTHON_CRCMOD=y
BR2_PACKAGE_PYTHON_CSSSELECT=y
BR2_PACKAGE_PYTHON_CSSUTILS=y
BR2_PACKAGE_PYTHON_DAEMON=y
BR2_PACKAGE_PYTHON_DIALOG=y
BR2_PACKAGE_PYTHON_DICTTOXML=y
BR2_PACKAGE_PYTHON_DJANGO=y
BR2_PACKAGE_PYTHON_DOCOPT=y
BR2_PACKAGE_PYTHON_DPKT=y
BR2_PACKAGE_PYTHON_ECDSA=y
BR2_PACKAGE_PYTHON_ENUM=y
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
BR2_PACKAGE_PYTHON_FLUP=y
BR2_PACKAGE_PYTHON_GOBJECT=y
BR2_PACKAGE_PYTHON_GUNICORN=y
BR2_PACKAGE_PYTHON_HTML5LIB=y
BR2_PACKAGE_PYTHON_HTTPLIB2=y
BR2_PACKAGE_PYTHON_HUMANIZE=y
BR2_PACKAGE_PYTHON_ID3=y
BR2_PACKAGE_PYTHON_INIPARSE=y
BR2_PACKAGE_PYTHON_IOWAIT=y
BR2_PACKAGE_PYTHON_IPADDR=y
BR2_PACKAGE_PYTHON_IPY=y
BR2_PACKAGE_PYTHON_IPYTHON=y
BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR=y
BR2_PACKAGE_PYTHON_KEYRING=y
BR2_PACKAGE_PYTHON_LIBCONFIG=y
BR2_PACKAGE_PYTHON_LMDB=y
BR2_PACKAGE_PYTHON_LXML=y
BR2_PACKAGE_PYTHON_MAD=y
BR2_PACKAGE_PYTHON_MARKDOWN=y
BR2_PACKAGE_PYTHON_MELD3=y
BR2_PACKAGE_PYTHON_MISTUNE=y
BR2_PACKAGE_PYTHON_MSGPACK=y
BR2_PACKAGE_PYTHON_MUTAGEN=y
BR2_PACKAGE_PYTHON_MWSCRAPE=y
BR2_PACKAGE_PYTHON_NETADDR=y
BR2_PACKAGE_PYTHON_NETIFACES=y
BR2_PACKAGE_PYTHON_NFC=y
BR2_PACKAGE_PYTHON_NUMPY=y
BR2_PACKAGE_PYTHON_PAHO_MQTT=y
BR2_PACKAGE_PYTHON_PAM=y
BR2_PACKAGE_PYTHON_PARAMIKO=y
BR2_PACKAGE_PYTHON_PILLOW=y
BR2_PACKAGE_PYTHON_POSIX_IPC=y
BR2_PACKAGE_PYTHON_PSUTIL=y
BR2_PACKAGE_PYTHON_PUDB=y
BR2_PACKAGE_PYTHON_PYCLI=y
BR2_PACKAGE_PYTHON_PYCPARSER=y
BR2_PACKAGE_PYTHON_PYELFTOOLS=y
BR2_PACKAGE_PYTHON_PYFTPDLIB=y
BR2_PACKAGE_PYTHON_PYGAME=y
BR2_PACKAGE_PYTHON_PYGAME_IMAGE=y
BR2_PACKAGE_PYTHON_PYGAME_EXAMPLES=y
BR2_PACKAGE_PYTHON_PYGAME_FONT=y
BR2_PACKAGE_PYTHON_PYGAME_MIXER=y
BR2_PACKAGE_PYTHON_PYINOTIFY=y
BR2_PACKAGE_PYTHON_PYLIBFTDI=y
BR2_PACKAGE_PYTHON_PYMYSQL=y
BR2_PACKAGE_PYTHON_PYPARTED=y
BR2_PACKAGE_PYTHON_PYPCAP=y
BR2_PACKAGE_PYTHON_PYQRCODE=y
BR2_PACKAGE_PYTHON_PYRATEMP=y
BR2_PACKAGE_PYTHON_PYRO=y
BR2_PACKAGE_PYTHON_PYROUTE2=y
BR2_PACKAGE_PYTHON_PYSENDFILE=y
BR2_PACKAGE_PYTHON_PYSMB=y
BR2_PACKAGE_PYTHON_PYSNMP_APPS=y
BR2_PACKAGE_PYTHON_PYSNMP_MIBS=y
BR2_PACKAGE_PYTHON_PYSOCKS=y
BR2_PACKAGE_PYTHON_PYTABLEWRITER=y
BR2_PACKAGE_PYTHON_PYTRIE=y
BR2_PACKAGE_PYTHON_PYUSB=y
BR2_PACKAGE_PYTHON_PYXB=y
BR2_PACKAGE_PYTHON_PYZMQ=y
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
BR2_PACKAGE_PYTHON_RPI_GPIO=y
BR2_PACKAGE_PYTHON_RTSLIB_FB=y
BR2_PACKAGE_PYTHON_SDNOTIFY=y
BR2_PACKAGE_PYTHON_SERIAL=y
BR2_PACKAGE_PYTHON_SETPROCTITLE=y
BR2_PACKAGE_PYTHON_SH=y
BR2_PACKAGE_PYTHON_SHUTILWHICH=y
BR2_PACKAGE_PYTHON_SIMPLEJSON=y
BR2_PACKAGE_PYTHON_SMBUS_CFFI=y
BR2_PACKAGE_PYTHON_SOCKETIO=y
BR2_PACKAGE_PYTHON_SORTEDCONTAINERS=y
BR2_PACKAGE_PYTHON_SPIDEV=y
BR2_PACKAGE_PYTHON_THRIFT=y
BR2_PACKAGE_PYTHON_TOMAKO=y
BR2_PACKAGE_PYTHON_TREQ=y
BR2_PACKAGE_PYTHON_U_MSGPACK=y
BR2_PACKAGE_PYTHON_UBJSON=y
BR2_PACKAGE_PYTHON_UJSON=y
BR2_PACKAGE_PYTHON_URLLIB3=y
BR2_PACKAGE_PYTHON_VERSIONTOOLS=y
BR2_PACKAGE_PYTHON_WATCHDOG=y
BR2_PACKAGE_PYTHON_WEB2PY=y
BR2_PACKAGE_PYTHON_WEBPY=y
BR2_PACKAGE_PYTHON_WHOOSH=y
BR2_PACKAGE_PYTHON_WS4PY=y
BR2_PACKAGE_PYTHON_WSACCEL=y
BR2_PACKAGE_PYTHON_XLUTILS=y

---
 package/python/python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python/python.mk +1 -1
index 30c55b7..cf1ddfb 100644
@@ -235,7 +235,7 @@ HOST_PYTHON_POST_INSTALL_HOOKS += HOST_PYTHON_INSTALL_PYTHON_SYMLINK
 endif
 
 # Provided to other packages
-PYTHON_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/sysconfigdata/:$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/
+PYTHON_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/sysconfigdata/
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.9.4
#16 lore raw

PATCH 8/8 python: remove target Python packages from PYTHONPATH

Quoted 169 lines · Thomas Petazzoni

We currently have $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/ inside the PYTHON_PATH variable, which gets used to define PYTHONPATH, passed to the host Python interpreter when building/installing target packages.

However, this is terribly wrong, as it causes the host interpreter to potentially import target Python packages. This is wrong for several reasons:

- Some Python packages might need some Python modules to be installed on the host (described in setup_requires in setup.py), but their installation currently works because by luck the corresponding Python module is installed for the target. Some of those cases were happening for real, and fixed by previous patches.

- Some Python packages include some native code, therefore built for a specific CPU architecture. When you point the host Python interpreter to native libraries built for the target, you get nice build failures, such as the one affecting the python-cffi related packages.

Making this change allows to fix the python-cffi related build failures:

http://autobuild.buildroot.net/results/a9af84f2d845ee25e2b7d8b92aef485112b46060/
(python-cryptography)

http://autobuild.buildroot.net/results/b017c4f6b4d45c0afbf06a80dbd3f2ebe5d49d20/
(python-pynacl)

http://autobuild.buildroot.net/results/25144ea191ad46d851b31d3a2f0ef939f215494b/
(python-smbus-cffi)

This change has been verified with the following defconfig that enables a lot of Python packages:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.05-834-gb595627.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_ALSAAUDIO=y
BR2_PACKAGE_PYTHON_ARROW=y
BR2_PACKAGE_PYTHON_ATTRS=y
BR2_PACKAGE_PYTHON_AUTOBAHN=y
BR2_PACKAGE_PYTHON_BITSTRING=y
BR2_PACKAGE_PYTHON_BOTTLE=y
BR2_PACKAGE_PYTHON_CAN=y
BR2_PACKAGE_PYTHON_CBOR=y
BR2_PACKAGE_PYTHON_CHARDET=y
BR2_PACKAGE_PYTHON_CHEETAH=y
BR2_PACKAGE_PYTHON_CHERRYPY=y
BR2_PACKAGE_PYTHON_CONFIGOBJ=y
BR2_PACKAGE_PYTHON_CONFIGSHELL_FB=y
BR2_PACKAGE_PYTHON_CRC16=y
BR2_PACKAGE_PYTHON_CRCMOD=y
BR2_PACKAGE_PYTHON_CSSSELECT=y
BR2_PACKAGE_PYTHON_CSSUTILS=y
BR2_PACKAGE_PYTHON_DAEMON=y
BR2_PACKAGE_PYTHON_DIALOG=y
BR2_PACKAGE_PYTHON_DICTTOXML=y
BR2_PACKAGE_PYTHON_DJANGO=y
BR2_PACKAGE_PYTHON_DOCOPT=y
BR2_PACKAGE_PYTHON_DPKT=y
BR2_PACKAGE_PYTHON_ECDSA=y
BR2_PACKAGE_PYTHON_ENUM=y
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
BR2_PACKAGE_PYTHON_FLUP=y
BR2_PACKAGE_PYTHON_GOBJECT=y
BR2_PACKAGE_PYTHON_GUNICORN=y
BR2_PACKAGE_PYTHON_HTML5LIB=y
BR2_PACKAGE_PYTHON_HTTPLIB2=y
BR2_PACKAGE_PYTHON_HUMANIZE=y
BR2_PACKAGE_PYTHON_ID3=y
BR2_PACKAGE_PYTHON_INIPARSE=y
BR2_PACKAGE_PYTHON_IOWAIT=y
BR2_PACKAGE_PYTHON_IPADDR=y
BR2_PACKAGE_PYTHON_IPY=y
BR2_PACKAGE_PYTHON_IPYTHON=y
BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR=y
BR2_PACKAGE_PYTHON_KEYRING=y
BR2_PACKAGE_PYTHON_LIBCONFIG=y
BR2_PACKAGE_PYTHON_LMDB=y
BR2_PACKAGE_PYTHON_LXML=y
BR2_PACKAGE_PYTHON_MAD=y
BR2_PACKAGE_PYTHON_MARKDOWN=y
BR2_PACKAGE_PYTHON_MELD3=y
BR2_PACKAGE_PYTHON_MISTUNE=y
BR2_PACKAGE_PYTHON_MSGPACK=y
BR2_PACKAGE_PYTHON_MUTAGEN=y
BR2_PACKAGE_PYTHON_MWSCRAPE=y
BR2_PACKAGE_PYTHON_NETADDR=y
BR2_PACKAGE_PYTHON_NETIFACES=y
BR2_PACKAGE_PYTHON_NFC=y
BR2_PACKAGE_PYTHON_NUMPY=y
BR2_PACKAGE_PYTHON_PAHO_MQTT=y
BR2_PACKAGE_PYTHON_PAM=y
BR2_PACKAGE_PYTHON_PARAMIKO=y
BR2_PACKAGE_PYTHON_PILLOW=y
BR2_PACKAGE_PYTHON_POSIX_IPC=y
BR2_PACKAGE_PYTHON_PSUTIL=y
BR2_PACKAGE_PYTHON_PUDB=y
BR2_PACKAGE_PYTHON_PYCLI=y
BR2_PACKAGE_PYTHON_PYCPARSER=y
BR2_PACKAGE_PYTHON_PYELFTOOLS=y
BR2_PACKAGE_PYTHON_PYFTPDLIB=y
BR2_PACKAGE_PYTHON_PYGAME=y
BR2_PACKAGE_PYTHON_PYGAME_IMAGE=y
BR2_PACKAGE_PYTHON_PYGAME_EXAMPLES=y
BR2_PACKAGE_PYTHON_PYGAME_FONT=y
BR2_PACKAGE_PYTHON_PYGAME_MIXER=y
BR2_PACKAGE_PYTHON_PYINOTIFY=y
BR2_PACKAGE_PYTHON_PYLIBFTDI=y
BR2_PACKAGE_PYTHON_PYMYSQL=y
BR2_PACKAGE_PYTHON_PYPARTED=y
BR2_PACKAGE_PYTHON_PYPCAP=y
BR2_PACKAGE_PYTHON_PYQRCODE=y
BR2_PACKAGE_PYTHON_PYRATEMP=y
BR2_PACKAGE_PYTHON_PYRO=y
BR2_PACKAGE_PYTHON_PYROUTE2=y
BR2_PACKAGE_PYTHON_PYSENDFILE=y
BR2_PACKAGE_PYTHON_PYSMB=y
BR2_PACKAGE_PYTHON_PYSNMP_APPS=y
BR2_PACKAGE_PYTHON_PYSNMP_MIBS=y
BR2_PACKAGE_PYTHON_PYSOCKS=y
BR2_PACKAGE_PYTHON_PYTABLEWRITER=y
BR2_PACKAGE_PYTHON_PYTRIE=y
BR2_PACKAGE_PYTHON_PYUSB=y
BR2_PACKAGE_PYTHON_PYXB=y
BR2_PACKAGE_PYTHON_PYZMQ=y
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
BR2_PACKAGE_PYTHON_RPI_GPIO=y
BR2_PACKAGE_PYTHON_RTSLIB_FB=y
BR2_PACKAGE_PYTHON_SDNOTIFY=y
BR2_PACKAGE_PYTHON_SERIAL=y
BR2_PACKAGE_PYTHON_SETPROCTITLE=y
BR2_PACKAGE_PYTHON_SH=y
BR2_PACKAGE_PYTHON_SHUTILWHICH=y
BR2_PACKAGE_PYTHON_SIMPLEJSON=y
BR2_PACKAGE_PYTHON_SMBUS_CFFI=y
BR2_PACKAGE_PYTHON_SOCKETIO=y
BR2_PACKAGE_PYTHON_SORTEDCONTAINERS=y
BR2_PACKAGE_PYTHON_SPIDEV=y
BR2_PACKAGE_PYTHON_THRIFT=y
BR2_PACKAGE_PYTHON_TOMAKO=y
BR2_PACKAGE_PYTHON_TREQ=y
BR2_PACKAGE_PYTHON_U_MSGPACK=y
BR2_PACKAGE_PYTHON_UBJSON=y
BR2_PACKAGE_PYTHON_UJSON=y
BR2_PACKAGE_PYTHON_URLLIB3=y
BR2_PACKAGE_PYTHON_VERSIONTOOLS=y
BR2_PACKAGE_PYTHON_WATCHDOG=y
BR2_PACKAGE_PYTHON_WEB2PY=y
BR2_PACKAGE_PYTHON_WEBPY=y
BR2_PACKAGE_PYTHON_WHOOSH=y
BR2_PACKAGE_PYTHON_WS4PY=y
BR2_PACKAGE_PYTHON_WSACCEL=y
BR2_PACKAGE_PYTHON_XLUTILS=y

Quoted 1 line
Quoted 20 lines
---
 package/python/python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python/python.mk +1 -2
index 30c55b7..cf1ddfb 100644
@@ -235,7 +235,7 @@ HOST_PYTHON_POST_INSTALL_HOOKS += HOST_PYTHON_INSTALL_PYTHON_SYMLINK
 endif
 
 # Provided to other packages
-PYTHON_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/sysconfigdata/:$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/
+PYTHON_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/sysconfigdata/
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
--

2.9.4

#17 lore raw

cover Fix the python cffi issue

In reply to Thomas Petazzoni

Hello,

Quoted 9 lines · Thomas Petazzoni

Thomas Petazzoni (8):
python-pyasn: switch to setuptools instead of distutils
python-pyro: switch to setuptools instead of distutils
python-u-msgpack: switch to setuptools instead of distutils
python-versiontools: add host variant python-json-schema-validator: needs versiontools on the host
python-incremental: add host variant
python-treq: needs host-python-incremental
python: remove target Python packages from PYTHONPATH

Following Yegor's review, and tests (reported on IRC), I've applied this series. I wanted to apply it quickly to get rid of the noisy autobuilder failures on python-cryptography, and see if it doesn't introduce problems in other Python packages.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com