angr / angrop

BSD 2-Clause "Simplified" License
589 stars 69 forks source link

Import error #35

Closed fabaff closed 3 years ago

fabaff commented 3 years ago

Starting with 9.0.7293 there is a ImportError present which blocks the building of the module on NixOS.

  File "<string>", line 1, in <module>
  File "<string>", line 1, in <lambda>
  File "/nix/store/hq6mrm0pc6xn6j8y6lm4qcgg9rwmqd8q-python3-3.8.9/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/nix/store/g021fx75b3jw27clrnx6i1ghg9xfj81r-python3.8-angrop-9.0.7293/lib/python3.8/site-packages/angrop/__init__.py", line 3, in <module>
    from . import rop
  File "/nix/store/g021fx75b3jw27clrnx6i1ghg9xfj81r-python3.8-angrop-9.0.7293/lib/python3.8/site-packages/angrop/rop.py", line 7, in <module>
    from . import chain_builder
ImportError: cannot import name 'chain_builder' from partially initialized module 'angrop' (most likely due to a circular import) (/nix/store/g021fx75b3jw27clrnx6i1ghg9xfj81r-python3.8-angrop-9.0.7293/lib/python3.8/site-packages/angrop/__init__.py)

Can be reproduced on Fedora 24 in a clean venv after an installation from PyPI.

(angrop1) [fabaff@test-python angrop1]$ python
Python 3.9.5 (default, May  4 2021, 00:00:00) 
[GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import angrop
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fabaff/angrop1/lib64/python3.9/site-packages/angrop/__init__.py", line 3, in <module>
    from . import rop
  File "/home/fabaff/angrop1/lib64/python3.9/site-packages/angrop/rop.py", line 7, in <module>
    from . import chain_builder
ImportError: cannot import name 'chain_builder' from partially initialized module 'angrop' (most likely due to a circular import) (/home/fabaff/angrop1/lib64/python3.9/site-packages/angrop/__init__.py)
>>> 
rhelmot commented 3 years ago

@twizmwazin something seems to have gone wrong in the automatic release process - chain_builder.py is not included in the pypi release.

twizmwazin commented 3 years ago

It looks like packages aren't declared correctly in setup.py, meaning currently angrop only works if you use -e mode with source. I can take care of this tomorrow.

twizmwazin commented 3 years ago

Fix merged, will be in the next release. Thanks for reporting!