[issue22724] byte-compile fails for cross-builds

Xavier de Gaye report at bugs.python.org
Fri Jul 1 11:15:21 EDT 2016


Xavier de Gaye added the comment:

Adding -E to PYTHON_FOR_BUILD fixes the x86_64 install because in my Android cross-build setup, the native interpreter is built from the same source tree as the cross-build. However, currently the interpreter used for the cross-build may be any interpreter found in PATH and can import an incorrect importlib.util.MAGIC_NUMBER if PYTHONPATH is not set properly. So this new patch does not use -E and splits PYTHON_FOR_BUILD into two variables, PY_BUILD_ENVIRON that sets the environment variables and PYTHON_FOR_BUILD, the interpreter. PY_BUILD_ENVIRON is not used when running compileall.

Tested by running the test suite on the Android i686 and x86_64 emulators (excluding test_ctypes that segfaults python on x86_64). The tests cannot be run with a cross-build where PYTHON_FOR_BUILD is python 3.5.1 because of issue 27434.

----------
Added file: http://bugs.python.org/file43603/py_build_environ.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22724>
_______________________________________


More information about the Python-bugs-list mailing list