Build Failure of `pysui-fastcrypto` due to Unknown Feature `stdsimd` in Dependency ahash
Closed this issue ยท 1 comments
Environment:
- Python version: 3.11.4
- OS: MacOS 14.3.1 on Apple M3 Chip
- Poetry version: 1.8.3
- Pip version: 24.0
- rustc version: 1.80.0-nightly (867900499 2024-05-23)
- rustup version: 1.27.1
Additional rust info:
$ rustc --version --verbose
rustc 1.80.0-nightly (867900499 2024-05-23)
binary: rustc
commit-hash: 8679004993f08807289911d9f400f4ac4391d2bc
commit-date: 2024-05-23
host: aarch64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.6
Issue Description:
When attempting to install pysui via Poetry, the build for pysui-fastcrypto fails. The error points to an unrecognized compiler feature stdsimd
used in the ahash
Rust crate. This issue persists even when using the latest nightly version of Rust.
Error output:
$ poetry add pysui
Configuration file exists at /Users/kz/Library/Preferences/pypoetry, reusing this directory.
Consider moving TOML configuration files to /Users/kz/Library/Application Support/pypoetry, as support for the legacy directory will be removed in an upcoming release.
Using version ^0.60.0 for pysui
Updating dependencies
Resolving dependencies... (0.3s)
Package operations: 2 installs, 0 updates, 0 removals
โข Installing pysui-fastcrypto (0.5.0): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
Running `maturin pep517 build-wheel -i /var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/tmpw_z9t7gv/.venv/bin/python --compatibility off`
๐ Found pyo3 bindings with abi3 support for Python โฅ 3.10
๐ Not using a specific python interpreter
๐ก Using build options features from pyproject.toml
๐ป Using `MACOSX_DEPLOYMENT_TARGET=11.0` for aarch64-apple-darwin by default
Compiling proc-macro2 v1.0.66
Compiling unicode-ident v1.0.11
Compiling serde v1.0.171
Compiling version_check v0.9.4
Compiling libc v0.2.147
Compiling autocfg v1.1.0
Compiling typenum v1.16.0
Compiling cfg-if v1.0.0
Compiling const-oid v0.9.4
Compiling subtle v2.5.0
Compiling generic-array v0.14.7
Compiling base64ct v1.6.0
Compiling syn v1.0.109
Compiling libm v0.2.7
Compiling num-traits v0.2.18
Compiling ppv-lite86 v0.2.17
Compiling num-integer v0.1.45
Compiling pem-rfc7468 v0.7.0
Compiling quote v1.0.31
Compiling getrandom v0.2.10
Compiling cpufeatures v0.2.9
Compiling syn v2.0.26
Compiling rand_core v0.6.4
Compiling rand_chacha v0.3.1
Compiling target-lexicon v0.12.9
Compiling rand v0.8.5
Compiling once_cell v1.18.0
Compiling pyo3-build-config v0.20.0
Compiling ff v0.13.0
Compiling num-bigint v0.4.4
Compiling cc v1.0.79
Compiling base16ct v0.2.0
Compiling group v0.13.0
Compiling ahash v0.8.3
Compiling paste v1.0.14
Compiling ark-std v0.4.0
Compiling pem-rfc7468 v0.6.0
Compiling strsim v0.10.0
Compiling either v1.8.1
Compiling ident_case v1.0.1
Compiling smallvec v1.11.0
Compiling fnv v1.0.7
Compiling darling_core v0.20.3
Compiling itertools v0.10.5
error[E0635]: unknown feature `stdsimd`
--> /Users/kz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.8.3/src/lib.rs:99:42
|
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
| ^^^^^^^
For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
๐ฅ maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `env -u CARGO MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/tmpw_z9t7gv/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/tmpw_z9t7gv/.venv/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/tmp5686acii/pysui_fastcrypto-0.5.0/Cargo.toml" "--release" "--lib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/pysui_fastcrypto.abi3.so"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/tmpw_z9t7gv/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
at ~/.pyenv/versions/3.11.4/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
143โ
144โ error = ChefBuildError("\n\n".join(message_parts))
145โ
146โ if error is not None:
โ 147โ raise error from None
148โ
149โ return path
150โ
151โ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with pysui-fastcrypto (0.5.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pysui-fastcrypto (==0.5.0)"'.
Output of pip wheel --use-pep517 "pysui-fastcrypto (==0.5.0)"
:
Collecting pysui-fastcrypto==0.5.0
Using cached pysui_fastcrypto-0.5.0.tar.gz (24 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pysui-fastcrypto
Building wheel for pysui-fastcrypto (pyproject.toml) ... error
error: subprocess-exited-with-error
ร Building wheel for pysui-fastcrypto (pyproject.toml) did not run successfully.
โ exit code: 1
โฐโ> [62 lines of output]
Running `maturin pep517 build-wheel -i /Users/kz/.pyenv/versions/3.11.4/bin/python3.11 --compatibility off`
๐ Found pyo3 bindings with abi3 support for Python โฅ 3.10
๐ Not using a specific python interpreter
๐ก Using build options features from pyproject.toml
๐ป Using `MACOSX_DEPLOYMENT_TARGET=11.0` for aarch64-apple-darwin by default
Compiling proc-macro2 v1.0.66
Compiling unicode-ident v1.0.11
Compiling autocfg v1.1.0
Compiling libc v0.2.147
Compiling serde v1.0.171
Compiling version_check v0.9.4
Compiling typenum v1.16.0
Compiling cfg-if v1.0.0
Compiling const-oid v0.9.4
Compiling subtle v2.5.0
Compiling generic-array v0.14.7
Compiling base64ct v1.6.0
Compiling syn v1.0.109
Compiling libm v0.2.7
Compiling num-traits v0.2.18
Compiling ppv-lite86 v0.2.17
Compiling getrandom v0.2.10
Compiling cpufeatures v0.2.9
Compiling num-integer v0.1.45
Compiling pem-rfc7468 v0.7.0
Compiling rand_core v0.6.4
Compiling target-lexicon v0.12.9
Compiling quote v1.0.31
Compiling rand_chacha v0.3.1
Compiling syn v2.0.26
Compiling rand v0.8.5
Compiling once_cell v1.18.0
Compiling pyo3-build-config v0.20.0
Compiling ff v0.13.0
Compiling num-bigint v0.4.4
Compiling base16ct v0.2.0
Compiling cc v1.0.79
Compiling group v0.13.0
Compiling ahash v0.8.3
Compiling paste v1.0.14
Compiling ark-std v0.4.0
Compiling pem-rfc7468 v0.6.0
Compiling strsim v0.10.0
Compiling fnv v1.0.7
Compiling either v1.8.1
Compiling ident_case v1.0.1
Compiling smallvec v1.11.0
Compiling itertools v0.10.5
Compiling num-iter v0.1.43
error[E0635]: unknown feature `stdsimd`
--> /Users/kz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.8.3/src/lib.rs:99:42
|
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
| ^^^^^^^
For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
๐ฅ maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `env -u CARGO MACOSX_DEPLOYMENT_TARGET="11.0" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/Users/kz/.pyenv/versions/3.11.4/bin/python3.11" PYTHON_SYS_EXECUTABLE="/Users/kz/.pyenv/versions/3.11.4/bin/python3.11" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/private/var/folders/3d/mdjv69sj1vx2hyh_y33rhdrm0000gn/T/pip-wheel-nuto80jb/pysui-fastcrypto_021aa2e1358f433e885b4d9ff6a88c4d/Cargo.toml" "--release" "--lib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/pysui_fastcrypto.abi3.so"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/kz/.pyenv/versions/3.11.4/bin/python3.11', '--compatibility', 'off'] returned non-zero exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysui-fastcrypto
Failed to build pysui-fastcrypto
ERROR: Failed to build one or more wheels
Solved! The build error encountered with pysui-fastcrypto
was due to using the Rust Nightly toolchain, which included an unstable feature that was not compatible with our project dependencies. I didn't realize my environment was using the nightly rustc
by default. Switching to the Rust Stable toolchain resolved the issue. For future reference and for anyone experiencing similar issues, try running rustup default stable
and see if pysui
installs normally after that.