pyo3: error: invalid instruction `cargo:rustc-cdylib-link-arg` from build script of `pyo3 v0.14.1`
๐ Bug Reports
I try to compile wasmer-python with pyo3 0.14.1. It uses pyo3 to create a Python extension with Rust. Whe compiling, Iโm facing this error:
error: invalid instruction `cargo:rustc-cdylib-link-arg` from build script of `pyo3 v0.14.1`
The package pyo3 v0.14.1 does not have a cdylib target.
๐ Environment
- macOS 11.1 aarch64
- Python 3.9.4 from Homebrew
- Rust 1.55 nightly
- PyO3 0.14.1
๐ฅ Reproducing
When compiling examples/word-count/ with cargo build --release, we get a warning:
warning: cargo:rustc-cdylib-link-arg was specified in the build script of pyo3 v0.14.1 (/Users/hwhost/Development/pyo3/pyo3), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: cargo:rustc-cdylib-link-arg was specified in the build script of pyo3 v0.14.1 (/Users/hwhost/Development/pyo3/pyo3), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
In my project (wasmer-python), itโs an error.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (15 by maintainers)
Iโve updated to the latest Rust nighly (
rustc 1.56.0-nightly (ccffcafd5 2021-08-11)), andpyo3_build_config::add_extension_module_link_args()is working on macOS M1.Note: It doesnโt mean it was a bug in
rustc. I didnโt dig into that. But, eh, it works!