python3_3.5.6 recipe in thud has the python3.5 wrapper set PYTHONHOME in this line: create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' This causes an error during the python2 check in oe-buildenv-internal as the system will look in buildtools/sysroots/ for the python2 libraries when only python3 libraries are there. steps to reproduce: build an esdk using thud branch on upstream, extract and use command devtool command. error that is seen is: ImportError: No module named site OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3. Please upgrade your python v2
with backport
I think we need to create our own equivalent variable to PYTHONHOME (OEPYTHON3HOME) which we can set in the wrapper which would then not affect any python2. We'd need to patch this into python and it wouldn't be an upstreamable patch but would solve this problem and yet still allow relocation (which is why we need it).
I agree that would be ideal, but how is this breaking relocation? just so I know how this variable is being used during relocation
merge of patch on hold for now.
In Python/pythonrun.c there is: char * Py_GetPythonHome(void) { char *home = default_home; if (home == NULL && !Py_IgnoreEnvironmentFlag) home = Py_GETENV("PYTHONHOME"); return home; } We probably need to patch this to first check OEPYTHON3HOME and then fall back to checking PYTHONHOME, then we use the OEPYTHON3HOME to set the override in our wrapper.
http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&id=4a42d6907ab3fb1e890b82c2ac9427b742ad5a4b