[issue45314] Using target python while cross-building

Frans report at bugs.python.org
Wed Sep 29 05:28:40 EDT 2021


Frans <frans at fransdb.nl> added the comment:

Update:

I came to realize that the command 'python' is without './', so it will search using PATH for python. Which - on my system Opensuse TW - does not exist, since there we have 'python3'. So, I made a softlink python->python3. 

Alas, I noticed that when I made the softlink python to python3 before starting configure, configure stops and complains that python3.9 is not found. Sure, TW has python3.8. But why check for previous/current versions, when making a new python binary?

Ok, made the link after configure was done, which ended in:
----------------------------------
i586-cross-linux-gcc     -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.9 -lcrypt -ldl  -lpthread -lm   -lm 
_PYTHON_PROJECT_BASE=/mnt/lfs/sources-base/Python-3.9.7 _PYTHON_HOST_PLATFORM=linux-i586 PYTHONPATH=./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_i386-linux-gnu python -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
fi
Could not import runpy module
Traceback (most recent call last):
  File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/runpy.py", line 14, in <module>
    import importlib.machinery # importlib first so we can test #15386 via -m
  File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/importlib/__init__.py", line 57, in <module>
    import types
  File "/mnt/lfs/sources-base/Python-3.9.7/./Lib/types.py", line 296, in <module>
    GenericAlias = type(list[int])
TypeError: 'type' object is not subscriptable
generate-posix-vars failed
make: *** [Makefile:619: pybuilddir.txt] Error 1
-------------------------------------

Complete native compile functions as expected.
Maybe the reason that TW is still using 3.8? Shall try that next.

----------
type:  -> compile error

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45314>
_______________________________________


More information about the Python-bugs-list mailing list