[OE-core] Is python2 native broken in current eSDK?
Adrian Freihofer
adrian.freihofer at gmail.com
Wed Nov 28 20:53:07 UTC 2018
Having baked an eSDK. Now I'm facing a problem with devtool and python2 native.
The error occurs at least on the thud and on the master branch. Also the host distro seams not relevant. The same happens on Ubuntu 16.04, Ubuntu 18.04 and on Fedora 29 hosts.
For example modifying and building bzip2 ends up with an error message:
devtool build bzip2
NOTE: Starting bitbake server...
ImportError: No module named site
OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3.
Please upgrade your python v2.
The failing lines of code are in the file: layers/poky/scripts/oe-buildenv-internal:
py_v27_check=$()
if [ "$py_v27_check" != "True" ]; then
echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
echo >&2 "Please upgrade your python v2."
fi
The check for python2 fails because of a wierd PYTHONPATH environment variable exported by devtool/bitbake.
If I do something similar like bitbake does, the same error message is printed in another, clean shell:
$ >= (2,7,3)'
True
$ python2 -c 'import sys; print sys.version_info'
sys.version_info(major=2, minor=7, micro=15, releaselevel='final', serial=0)
$ export PYTHONHOME=/home/user/temp/poky_sdk/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/../../usr
$ python2 -c 'import sys; print sys.version_info >= (2,7,3)'
ImportError: No module named site
The processes spawned by devtool look like:
/home/user/temp/poky_sdk/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/python3.5 /home/user/temp/poky_sdk/sysroots/x86_64-pokysdk-linux/usr/bin/devtool build bzip2
bash-c . /home/user/temp/poky_sdk/layers/poky/oe-init-build-env /home/user/temp/poky_sdk > /dev/null && script -e -q -c "bitbake bzip2:do_populate_sysroot bzip2:do_packagedata" /dev/null
The . /home/user/temp/poky_sdk/layers/poky/oe-init-build-env is where the PYTHONHOME variable comes in.
Any ideas? Have similar issues been seen else where?
Thanks,
Adrian
More information about the Openembedded-core
mailing list