angr / angr-dev

Some helper scripts to set up an environment for angr development.
BSD 2-Clause "Simplified" License
114 stars 95 forks source link

The pinned version of setuptools (64.0.1) fails for virtualenv with python3.12 #183

Closed Atipriya closed 10 months ago

Atipriya commented 10 months ago

Description

description: virtualenv with python3.12 fails to install angr-dev because setuptools' version is pinned to 64.0.1. It fails for both windows and linux. windows: https://github.com/angr/angr-dev/blob/master/setup.ps1#L17 linux: https://github.com/angr/angr-dev/blob/master/setup.sh#L316

fix: upgrade setuptools to 68.2.2


  × Checking if build backend supports build_editable did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 100, in _supported_features
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\atipr\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 994, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\setuptools\__init__.py", line 16, in <module>
          import setuptools.version
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\setuptools\version.py", line 1, in <module>
          import pkg_resources
        File "C:\Users\atipr\Envs\angr\Lib\site-packages\pkg_resources\__init__.py", line 2191, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Checking if build backend supports build_editable did not run successfully.
│ exit code: 1
╰─> See above for output.

Steps to reproduce the bug

Install angr-dev in virtualenv with python3.12

Environment

No response

Additional context

No response

twizmwazin commented 10 months ago

For now you can upgrade the setuptools version locally as a workaround. Pycharm may have issues recognizing packages installed with -e, if you use it.

ltfish commented 10 months ago

@twizmwazin Why are we pinning setuptools to an old version to begin with?

twizmwazin commented 10 months ago

Newer versions changed how wheels were built and CI was never updated to account for it because it would be a non-trivial change. We can unpin it here for now, and once the monorepo is gone we can use current versions.

ltfish commented 10 months ago

Can you please unpin it for now so that our scripts work for Python 3.12, and at the same time special-case it for our CI?

twizmwazin commented 10 months ago

Fixed in 86fa9acccd20a57795899f0f09807f5adb45e97c