python / cpython

The Python programming language
https://www.python.org
Other
63.16k stars 30.24k forks source link

sparc linux build fails with "could not import runpy module" #61418

Closed 9acaf75c-5289-4c8e-b826-7c9487fd3079 closed 11 years ago

9acaf75c-5289-4c8e-b826-7c9487fd3079 commented 11 years ago
BPO 17216
Nosy @ned-deily
Files
  • config.log: config
  • config.log: configure
  • build-log.txt: make 2>&1
  • tee build-log.txt

    Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['build', 'invalid'] title = 'sparc linux build fails with "could not import runpy module"' updated_at = user = 'https://bugs.python.org/uservornameusernachname' ``` bugs.python.org fields: ```python activity = actor = 'ned.deily' assignee = 'none' closed = True closed_date = closer = 'ned.deily' components = ['Build'] creation = creator = 'uservorname.usernachname' dependencies = [] files = ['29089', '29099', '29100'] hgrepos = [] issue_num = 17216 keywords = [] message_count = 7.0 messages = ['182232', '182242', '182269', '182274', '182284', '182324', '194230'] nosy_count = 2.0 nosy_names = ['ned.deily', 'uservorname.usernachname'] pr_nums = [] priority = 'normal' resolution = 'not a bug' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue17216' versions = ['Python 3.3'] ```

    9acaf75c-5289-4c8e-b826-7c9487fd3079 commented 11 years ago

    Greetings,

    make fails at: ar rc libpython3.3m.a Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/capsule.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o ar rc libpython3.3m.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Python/thread.o Python/frozen.o ar rc libpython3.3m.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o ar rc libpython3.3m.a Modules/_threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/operator.o Modules/_collectionsmodule.o Modules/itertoolsmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/zipimport.o Modules/faulthandler.o Modules/symtablemodule.o Modules/xxsubtype.o ranlib libpython3.3m.a gcc -pthread -Xlinker -export-dynamic -o python Modules/python.o libpython3.3m.a -lpthread -ldl -lutil -lm ./python -E -S -m sysconfig --generate-posix-vars Could not find platform dependent libraries \<exec_prefix> Consider setting $PYTHONHOME to \<prefix>[:\<exec_prefix>] Could not import runpy module make: *** [Lib/_sysconfigdata.py] Error 1

    What is wrong here? Do you need any other information?

    best regards

    ned-deily commented 11 years ago

    For some reason in your build, the first bootstrap use of the compiler (to generate the sysconfig data) is failing because the runpy module can't be found. Python should be able to find it in the source directory; the "Could not find platform dependent libraries \<exec_prefix>" is normal at this point and can be ignored. I see from your config.log that you do have a lot of configure options set, including some invalid ones (configure:16344: WARNING: unrecognized options: --enable-clocale, --enable-debug). I suggest you try rebuilding from a freshly untarred source directory with as simple a ./configure as possible and as few environment variables set as possible and see what happens when you run make, something like:

    ./configure && make

    If that fails similarly, please include that whole output from configure through make and the config.log output.

    9acaf75c-5289-4c8e-b826-7c9487fd3079 commented 11 years ago

    Thanks for your hint. I did: ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --bindir=/usr --sysconfdir=/etc --sbindir=/usr/sbin/ & make 2>&1 | tee build-log.txt

    and get:

    gcc -pthread -fPIC -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Include -I. -I/c/backup/fes-a120d19nas/Python-3.3.0/Include -I/c/backup/fes-a120d19nas/Python-3.3.0 -c /c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.c -o build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.o gcc -pthread -shared build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-padre-3.3/_hashlib.cpython-33m.so make: *** [sharedmods] Error 138

    I also tried to compile with ./configure --build=sparc-linux but it results in getting the same make error.

    Maybe it have to do something with uname --m padre ? When compiling other programs I have to set build=sparc-linux But as you can see its using here linux-padre. Also gcc is using sparc-unkown-linux

    If you need any other information let me know it.

    9acaf75c-5289-4c8e-b826-7c9487fd3079 commented 11 years ago

    I also tried to compile with

    ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --bindir=/usr --sysconfdir=/etc --sbindir=/usr/sbin/ --build=sparc-linux --libdir=/usr/lib --includedir=/usr/include --datarootdir=/usr/share --localedir=/usr/local --host=sparc-linux which results in the same error. Strange is that i set libdir but it seems that is using /usr/local/lib instead of /usr/lib

    Attached you will find the output of make ( make 2>&1 | tee build-log.txt )

    ned-deily commented 11 years ago

    I'm glad you got a little further. Now it seems the build is failing when trying to build the _ssl and _hashlib extension modules.

    building '_ssl' extension gcc -pthread -fPIC -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Include -I. -I/c/backup/fes-a120d19nas/Python-3.3.0/Include -I/c/backup/fes-a120d19nas/Python-3.3.0 -c /c/backup/fes-a120d19nas/Python-3.3.0/Modules/_ssl.c -o build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_ssl.o gcc -pthread -shared build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-padre-3.3/_ssl.cpython-33m.so WARNING: renaming "_ssl" since importing it failed: build/lib.linux-padre-3.3/_ssl.cpython-33m.so: undefined symbol: time, version key building '_hashlib' extension gcc -pthread -fPIC -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Include -I. -I/c/backup/fes-a120d19nas/Python-3.3.0/Include -I/c/backup/fes-a120d19nas/Python-3.3.0 -c /c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.c -o build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.o gcc -pthread -shared build/temp.linux-padre-3.3/c/backup/fes-a120d19nas/Python-3.3.0/Modules/_hashopenssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-padre-3.3/_hashlib.cpython-33m.so make: [sharedmods] Error 138

    Both of these modules are dependent on libssl and libcrypto, both normally supplied by openssl. In the main setup.py file which is used to build the interpreter's extension modules, there are tests for the presence of these libs and their corresponding include files (setup.py line 759). There are a list of locations that are searched including the standard system locations and /usr/local/ssl and /usr/contrib/ssl. Apparently, setup.py is finding both includes and libs in one of those directories because otherwise it would skip attempting to build _ssl altogether. But for some reason the link step fails with the undefined symbol message. And then it seems that the _hashlib step fails altogether. I have no personal experience with sparc linux installs, much less with the ReadyNAS (and I doubt anyone else here does either), so I can only speculate that the most likely cause of this failure is a broken openssl installation. I'd check the above locations as well as under /usr/lib and /usr/include. If you are using a package manager to install openssl, make sure it is a dev version with headers, like libssl-dev. Good luck!

    9acaf75c-5289-4c8e-b826-7c9487fd3079 commented 11 years ago

    Thanks for your hints.

    I got installed openssl-1.0.1d and ssl in fes-a120d19nas:/backup/fes-a120d19nas/Python-3.3.0# whereis openssl openssl: /usr/bin/openssl /usr/include/openssl fes-a120d19nas:/backup/fes-a120d19nas/Python-3.3.0# whereis ssl ssl: /etc/ssl /usr/lib/ssl

    I compiled openssl-1.0.1d and gnutls-3.1.7 by my self. Package manager doesn't work at this machine. But anyway because I compiled this libaries all header files should be avaibel.

    I also recognized that setup.py line 759 searches in /usr/local/lib instead of /usr/lib.

    So I changed the setup lines regarding 759 to :

         # Detect SSL support for the socket module (via _ssl)
            search_for_ssl_incs_in = [
                                  '/usr/ssl/include',
                                  '/usr/contrib/ssl/include/'
                                 ]
            ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                                 search_for_ssl_incs_in
                                 )
            if ssl_incs is not None:
                krb5_h = find_file('krb5.h', inc_dirs,
                                   ['/usr/kerberos/include'])
                if krb5_h:
                    ssl_incs += krb5_h
            ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
                                         ['/usr/lib/ssl',
                                          '/usr/contrib/ssl/lib/'
                                         ] )
    and executed again make. 

    Which now results in

    fes-a120d19nas:/backup/fes-a120d19nas/Python-3.3.0# make case $MAKEFLAGS in *s*) quiet=-q; esac; \ CC='sparc-linux-gcc -pthread' LDSHARED='sparc-linux-gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' \ ./python -E ./setup.py $quiet build running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers make: *** [sharedmods] Error 139

    So now I'm compiling Tcl from source, and hope this will have some positive effects.

    ned-deily commented 11 years ago

    Since there has been no further activity on this issue and it seems to be isolated to a particular user build, I'm going to close this. Feel free to reopen with more documentation if you believe there is a problem with Python itself.