Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21.2.0: pep517 does not build cython modules #114

Closed
kloczek opened this issue Dec 8, 2021 · 6 comments
Closed

21.2.0: pep517 does not build cython modules #114

kloczek opened this issue Dec 8, 2021 · 6 comments

Comments

@kloczek
Copy link

kloczek commented Dec 8, 2021

Doesn't matter am I using flit or build cythonized DSOs are not build

+ flit build
Not generating setup.py in sdist (default changed)                                                                                                                    I-flit
Recent versions of pip no longer need this generated file                                                                                                             I-flit
Use --[no-]setup-py to suppress this message or add setup.py                                                                                                          I-flit
Built sdist: dist/argon2-cffi-21.2.0.tar.gz                                                                                                                I-flit_core.sdist
Copying package file(s) from /tmp/tmpdy5uvwt1/argon2-cffi-21.2.0/src/argon2                                                                                I-flit_core.wheel
Writing metadata files                                                                                                                                     I-flit_core.wheel
Writing the record of files                                                                                                                                I-flit_core.wheel
Built wheel: dist/argon2_cffi-21.2.0-py3-none-any.whl                                                                                                      I-flit_core.wheel
+ /usr/bin/python3 -m build -w --no-isolation
* Getting dependencies for wheel...
* Building wheel...
Successfully built argon2_cffi-21.2.0-py3-none-any.whl

Result is that pytest after installing module is not able to find DSOs.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -k 'not test_repr'
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=1308586467
rootdir: /home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0, configfile: pyproject.toml, testpaths: tests
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, cov-2.12.1, anyio-3.3.4, forked-1.3.0, xdist-2.3.0, flaky-3.7.0, tornasync-0.6.0.post2, console-scripts-1.2.0, trio-0.7.0, timeout-2.0.1, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, pyfakefs-4.5.3, hypothesis-6.29.3, benchmark-3.4.1, profiling-1.7.0, datadir-1.3.1, regressions-2.2.0, randomly-3.8.0, rerunfailures-9.1.1, yagot-0.5.0, requests-mock-1.9.3, subtests-0.5.0, easy-server-0.8.0, django-4.5.2
collected 0 items / 4 errors

================================================================================== ERRORS ==================================================================================
__________________________________________________________________ ERROR collecting tests/test_legacy.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0/tests/test_legacy.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_legacy.py:8: in <module>
    from argon2 import (
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/__init__.py:7: in <module>
    from . import exceptions, low_level, profiles
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/low_level.py:15: in <module>
    from _argon2_cffi_bindings import ffi, lib
E   ModuleNotFoundError: No module named '_argon2_cffi_bindings'
_________________________________________________________________ ERROR collecting tests/test_low_level.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0/tests/test_low_level.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_low_level.py:16: in <module>
    from argon2.low_level import (
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/__init__.py:7: in <module>
    from . import exceptions, low_level, profiles
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/low_level.py:15: in <module>
    from _argon2_cffi_bindings import ffi, lib
E   ModuleNotFoundError: No module named '_argon2_cffi_bindings'
______________________________________________________________ ERROR collecting tests/test_password_hasher.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0/tests/test_password_hasher.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_password_hasher.py:5: in <module>
    from argon2 import PasswordHasher, Type, extract_parameters
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/__init__.py:7: in <module>
    from . import exceptions, low_level, profiles
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/low_level.py:15: in <module>
    from _argon2_cffi_bindings import ffi, lib
E   ModuleNotFoundError: No module named '_argon2_cffi_bindings'
___________________________________________________________________ ERROR collecting tests/test_utils.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0/tests/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_utils.py:10: in <module>
    from argon2 import Parameters, Type, extract_parameters
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/__init__.py:7: in <module>
    from . import exceptions, low_level, profiles
../../BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/low_level.py:15: in <module>
    from _argon2_cffi_bindings import ffi, lib
E   ModuleNotFoundError: No module named '_argon2_cffi_bindings'
========================================================================= short test summary info ==========================================================================
ERROR tests/test_legacy.py
ERROR tests/test_low_level.py
ERROR tests/test_password_hasher.py
ERROR tests/test_utils.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 4 errors in 0.38s =============================================================================
@hynek
Copy link
Owner

hynek commented Dec 9, 2021

I'm not sure what exactly you're doing but 1) there is no Cython involved 2) it looks like your method doesn't install the argon2-cffi-bindings dependency (which uses cffi).

@kloczek
Copy link
Author

kloczek commented Dec 10, 2021

OK I've added to my build env argon2-cffi-bindings however looks like pytest is crashing python with SIGILL

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=1392831610
rootdir: /home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0, configfile: pyproject.toml, testpaths: tests
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, cov-2.12.1, anyio-3.3.4, forked-1.3.0, xdist-2.3.0, flaky-3.7.0, tornasync-0.6.0.post2, console-scripts-1.2.0, trio-0.7.0, timeout-2.0.1, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, pyfakefs-4.5.3, benchmark-3.4.1, profiling-1.7.0, datadir-1.3.1, regressions-2.2.0, randomly-3.8.0, rerunfailures-9.1.1, yagot-0.5.0, requests-mock-1.9.3, subtests-0.5.0, easy-server-0.8.0, django-4.5.2, hypothesis-6.31.0
collected 67 items

tests/test_utils.py ............
tests/test_password_hasher.py Fatal Python error: Illegal instruction

Current thread 0x00007f2366f53740 (most recent call first):
  File "/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/low_level.py", line 116 in hash_secret
  File "/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/argon2/_password_hasher.py", line 157 in hash
  File "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-21.2.0/tests/test_password_hasher.py", line 99 in test_check_needs_rehash_no
  File "/usr/lib/python3.8/site-packages/pytest_tornasync/plugin.py", line 45 in pytest_pyfunc_call
  File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84 in <lambda>
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/python.py", line 1641 in runtest
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 162 in pytest_runtest_call
  File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84 in <lambda>
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 255 in <lambda>
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 311 in from_call
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 254 in call_runtest_hook
  File "/usr/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 133 in call_and_report
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 126 in runtestprotocol
  File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
  File "/usr/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 89 in pytest_runtest_protocol
  File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84 in <lambda>
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 348 in pytest_runtestloop
  File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84 in <lambda>
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 323 in _main
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269 in wrap_session
  File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
  File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84 in <lambda>
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 162 in main
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185 in console_main
  File "/usr/bin/pytest", line 33 in <module>
/var/tmp/rpm-tmp.Z0JmwF: line 48: 3309842 Illegal instruction     (core dumped) PATH="/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/bin:$PATH" PYTHONDONTWRITEBYTECODE=1 SETUPTOOLS_SCM_PRETEND_VERSION=21.2.0 PYTHONPATH="${PYTHONPATH:-/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-argon2-cffi-21.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages}" /usr/bin/pytest -ra

I'm not sure is it sometbing wrong in argon2-cffi-bindings DSO or python.
I'm opened on any suggestions about what I can try to diagnose that issue.

@quinox
Copy link

quinox commented Dec 29, 2021

Maybe it helps you: this morning I had (repeatable) issues installing argon2-cffi 21.3.0 with a subset of my projects, whereas 21.1.0 worked just fine. I fixed my problems by upgrading pip to version 21 (it was 19).

@kloczek
Copy link
Author

kloczek commented Dec 30, 2021

My pip version is

[tkloczko@ss-desktop SPECS]$ pip show pip| grep Version
Version: 21.3.1

@hynek
Copy link
Owner

hynek commented Dec 30, 2021

I think your problems are unrelated indeed. The question is why kloczek's a2c-bindings is crashing which belongs to https://github.com/hynek/argon2-cffi-bindings/issues. It could be some cross-compilation weirdness.

@hynek hynek closed this as completed Dec 30, 2021
@kloczek
Copy link
Author

kloczek commented Dec 30, 2021

In that case looks like python crashes with few modules loaded as DSOs.
I've been trying to at least encircle which one DSO it could be and I'm not 100% sure is it could be argon2-cffi-bindings :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants