cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

Unable to import libffi.so.6 (sage-8.4/9999) #525

Closed strogdon closed 5 years ago

strogdon commented 5 years ago

This is in Prefix where dev-libs/libffi-3.3_rc0 and virtual/libffi-3.3_rc0 are installed. The failure:

[parallel ] /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/doc/en/reference/parallel/sage/parallel/map_reduce.rst:11: WARNING: autodoc: failed to import module u'sage.parallel.map_reduce'; the following exception was raised:
[parallel ] Traceback (most recent call last):
[parallel ]   File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/ext/sage_autodoc.py", line 567, in import_object
[parallel ]     __import__(self.modname)
[parallel ]   File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/parallel/map_reduce.py", line 517, in <module>
[parallel ]     import ctypes
[parallel ]   File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/ctypes/__init__.py", line 7, in <module>
[parallel ]     from _ctypes import Union, Structure, Array
[parallel ] ImportError: libffi.so.6: cannot open shared object file: No such file or directory
[parallel ] The inventory files are in build_doc/inventory/en/reference/parallel.
Error building the documentation.
Traceback (most recent call last):
  File "sage_setup/docbuild/__main__.py", line 2, in <module>
    main()
  File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 1715, in main
    builder()
  File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 334, in _wrapper
    getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 529, in _wrapper
    build_many(build_ref_doc, L)
  File "/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/__init__.py", line 283, in build_many
    ret = x.get(99999)
  File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/multiprocessing/pool.py", line 572, in get
    raise self._value
OSError: /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/doc/en/reference/parallel/sage/parallel/map_reduce.rst:11: WARNING: autodoc: failed to import module u'sage.parallel.map_reduce'; the following exception was raised:

Now libffi-3.3_rc0 does install libffi.so.7. emerge @preserved-rebuild is up to date. Is there something that's hardcoded to require libffi.so.6 or perhaps a Prefix bug?

strogdon commented 5 years ago

There is https://bugs.gentoo.org/667508, so maybe we should avoid libffi-3.3_rc0. It apparently has API issues. But I don't know if that would explain the failure.

kiwifb commented 5 years ago

usr/lib64/python2.7/lib-dynload/_ctypes.so from python comes to mind especially with that failure.

strogdon commented 5 years ago

I was looking for the _ctypes.so but couldn't find it.

ldd -r ~/usr/lib/python2.7/lib-dynload/_ctypes.so 
        linux-vdso.so.1 (0x00007ffdfe500000)
        libffi.so.6 => not found
        libdl.so.2 => /storage/strogdon/gentoo-rap/lib64/libdl.so.2 (0x00007f990708d000)
        libpython2.7.so.1.0 => /storage/strogdon/gentoo-rap/usr/lib64/libpython2.7.so.1.0 (0x00007f9906c45000)
        libpthread.so.0 => /storage/strogdon/gentoo-rap/lib64/libpthread.so.0 (0x00007f9906a25000)
        libc.so.6 => /storage/strogdon/gentoo-rap/lib64/libc.so.6 (0x00007f990665d000)
        /storage/strogdon/gentoo-rap/lib64/ld-linux-x86-64.so.2 (0x00007f99074b7000)
        libutil.so.1 => /storage/strogdon/gentoo-rap/lib64/libutil.so.1 (0x00007f990645a000)
        libm.so.6 => /storage/strogdon/gentoo-rap/lib64/libm.so.6 (0x00007f99060c2000)
undefined symbol: ffi_prep_closure_loc  (/storage/strogdon/gentoo-rap/usr/lib/python2.7/lib-dynload/_ctypes.so)
undefined symbol: ffi_prep_cif  (/storage/strogdon/gentoo-rap/usr/lib/python2.7/lib-dynload/_ctypes.so)
undefined symbol: ffi_closure_alloc     (/storage/strogdon/gentoo-rap/usr/lib/python2.7/lib-dynload/_ctypes.so)
undefined symbol: ffi_call      (/storage/strogdon/gentoo-rap/usr/lib/python2.7/lib-dynload/_ctypes.so)
undefined symbol: ffi_closure_free      (/storage/strogdon/gentoo-rap/usr/lib/python2.7/lib-dynload/_ctypes.so)
kiwifb commented 5 years ago

Yep that's your failure all right. It looks for libffi.so.6 and it is not found. So revdep-rebuild didn't do python.

strogdon commented 5 years ago

Let me rebuild python and If that fixes the build I'll close.

strogdon commented 5 years ago

Looks good here.