Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
1.03k stars 145 forks source link

No 0.13.x wheels available on linux arm64 with python 3.12 #1115

Open harryzcy opened 6 months ago

harryzcy commented 6 months ago

Information

What is the current behavior?

It's building wheel during the install

What is the expected behavior?

Download prebuilt wheels, instead of rebuilding using Rust compiler

Steps to reproduce the problem

Install checkov on arm64 linux, which will install rustworkx as its dependency

108.3   Building wheel for rustworkx (pyproject.toml): started
108.6   Building wheel for rustworkx (pyproject.toml): finished with status 'error'
108.6   error: subprocess-exited-with-error
108.6   
108.6   × Building wheel for rustworkx (pyproject.toml) did not run successfully.
108.6   │ exit code: 1
108.6   ╰─> [40 lines of output]
108.6       running bdist_wheel
108.6       running build
108.6       running build_py
108.6       creating build
108.6       creating build/lib.linux-aarch64-cpython-312
108.6       creating build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/__init__.py -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/visit.py -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       creating build/lib.linux-aarch64-cpython-312/rustworkx/visualization
108.6       copying rustworkx/visualization/__init__.py -> build/lib.linux-aarch64-cpython-312/rustworkx/visualization
108.6       copying rustworkx/visualization/matplotlib.py -> build/lib.linux-aarch64-cpython-312/rustworkx/visualization
108.6       copying rustworkx/visualization/graphviz.py -> build/lib.linux-aarch64-cpython-312/rustworkx/visualization
108.6       running egg_info
108.6       writing rustworkx.egg-info/PKG-INFO
108.6       writing dependency_links to rustworkx.egg-info/dependency_links.txt
108.6       writing requirements to rustworkx.egg-info/requires.txt
108.6       writing top-level names to rustworkx.egg-info/top_level.txt
108.6       reading manifest file 'rustworkx.egg-info/SOURCES.txt'
108.6       reading manifest template 'MANIFEST.in'
108.6       adding license file 'LICENSE'
108.6       writing manifest file 'rustworkx.egg-info/SOURCES.txt'
108.6       copying rustworkx/__init__.pyi -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/digraph.pyi -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/graph.pyi -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/iterators.pyi -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/py.typed -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       copying rustworkx/rustworkx.pyi -> build/lib.linux-aarch64-cpython-312/rustworkx
108.6       running build_ext
108.6       running build_rust
108.6       error: can't find Rust compiler
108.6       
108.6       If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
108.6       
108.6       To update pip, run:
108.6       
108.6           pip install --upgrade pip
108.6       
108.6       and then retry package installation.
108.6       
108.6       If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
108.6       [end of output]
108.6   
108.6   note: This error originates from a subprocess, and is likely not a problem with pip.
108.6   ERROR: Failed building wheel for rustworkx
108.6   Building wheel for cffi (pyproject.toml): started
116.4   Building wheel for cffi (pyproject.toml): finished with status 'done'
116.4   Created wheel for cffi: filename=cffi-1.16.0-cp312-cp312-linux_aarch64.whl size=474351 sha256=d6403689b9cb25397714594a857558512f027125d9f8395b48eed37377d813d8
116.4   Stored in directory: /tmp/pip-ephem-wheel-cache-ob_7t9_m/wheels/9f/20/b5/43b003d703a3519a9adbe40423a752dd0c7618afb763739963
116.4 Successfully built pyyaml cffi
116.4 Failed to build rustworkx
116.4 ERROR: Could not build wheels for rustworkx, which is required to install pyproject.toml-based projects
mtreinish commented 6 months ago

The issue is likely that the version of rustworkx you're trying to install is too old. Rustworkx 0.13.0 was released on June 7th, 2023 and had wheels for all the supported (both by rustworkx and cpython) python versions at the time which was 3.7-3.11. The first release published with Python 3.12 support was 0.13.2 which was published on October 3rd, 2023, 1 day after python 3.12.0 was released. You can see the wheels on pypi:

https://pypi.org/project/rustworkx/0.13.2/#files

including for aarch64 linux wheel, here is a direct link to the wheel file from there:

https://files.pythonhosted.org/packages/9e/8e/6a2880f994300bc6ffdf38b28f702df164390601e172dfc5e59ba60564e0/rustworkx-0.13.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

If you're running on a musl Linux environment, support for that on aarch64 wasn't added until 0.14.0 release. It's also worth noting that rustworkx 0.13.x is no longer supported and will not receive future bugfixes or releases. So if there is a fix needed here it would be released in a 0.14.2 release.

IvanIsCoding commented 6 months ago

Matthew's answer is correct, we only provide manylinux2014_aarch64 wheels for the rustworkx 0.13 release series. Support for musllinux2014_aarch64 only started in 0.14 and from now on we will release wheels for that platform.

The fix is to either bump rustworkx to 0.14 in your requirements file or install a Rust compiler in your distro following https://rustup.rs/

IvanIsCoding commented 6 months ago

I assume checkov has a hard-requirement for 0.13.x so I will try to send a Pull Request to them to use 0.14.x

harryzcy commented 6 months ago

Thank you! @IvanIsCoding @mtreinish