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)

Most upvoted comments

Iโ€™ve updated to the latest Rust nighly (rustc 1.56.0-nightly (ccffcafd5 2021-08-11)), and pyo3_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!