stefantalpalaru / gentoo-overlay

Gentoo overlay
GNU General Public License v2.0
43 stars 11 forks source link

dev-python/cryptography-3.1.1 fails on compile phase when building against Python 2.7 #69

Closed torre76 closed 3 years ago

torre76 commented 3 years ago

Hi @stefantalpalaru,

I was doing a regular update on my system and cryptography-3.1.1 fails on compile phase against python 2.7 (which is also built based on your overlay):

>>> Compiling source in /var/tmp/portage/dev-python/cryptography-3.1.1/work/cryptography-3.1.1 ...
 * python2_7: running distutils-r1_run_phase distutils-r1_python_compile
python2.7 setup.py build
Traceback (most recent call last):
  File "setup.py", line 122, in <module>
    "src/_cffi_src/build_padding.py:ffi",
  File "/usr/lib64/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib64/python2.7/site-packages/setuptools/dist.py", line 426, in __init__
    k: v for k, v in attrs.items()
  File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib64/python2.7/site-packages/setuptools/dist.py", line 717, in finalize_options
    ep(self)
  File "/usr/lib64/python2.7/site-packages/setuptools/dist.py", line 724, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "/usr/lib64/python2.7/site-packages/cffi/setuptools_ext.py", line 25, in execfile
    exec(code, glob, glob)
  File "src/_cffi_src/build_openssl.py", line 130, in <module>
    extra_link_args=extra_link_args(compiler_type()),
  File "src/_cffi_src/utils.py", line 60, in build_ffi_for_binding
    extra_link_args=extra_link_args,
  File "src/_cffi_src/utils.py", line 74, in build_ffi
    ffi = FFI()
  File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 48, in __init__
    import _cffi_backend as backend
ImportError: /usr/lib64/python2.7/site-packages/_cffi_backend.so: undefined symbol: PyUnicodeUCS2_AsUTF8String

Python is compiled with these use flags:

[ebuild   R    ] dev-lang/python-2.7.18-r100:2.7::stefantalpalaru  USE="bluetooth gdbm lto ncurses pgo readline sqlite ssl (threads) (wide-unicode) xml (-berkdb) -build -doc -examples -hardened -ipv6 -libressl -tk -wininst" 0 KiB

Harvesting on the Net, it seems that Python should be compiled with a particular UTF-8 encoding support.

stefantalpalaru commented 3 years ago

Try rebuilding "dev-python/cffi".

The issue you're hitting seems to be this one: https://github.com/pyca/cryptography/issues/2906

torre76 commented 3 years ago

Thank you @stefantalpalaru,

I confirm that rebuilding dev-python/cffi fixed the problem.