Assumptions
- problematic toolchain
-- rustc 1.70.0-nightly (db0cbc48d 2023-03-26)
-- rustc 1.70.0-nightly (478cbb42b 2023-03-28)
- toolchain not affected
-- rustc 1.68.0-stable
Description
wheel package generation fails with latest toolchain, when crate-type = ["cdylib"] is not contained in Cargo.toml.
Cause
The following command in build process will not work:
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'python pyo3/extension-module' --no-default-features -- --crate-type cdylib
Instead, following works:
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'python pyo3/extension-module' --no-default-features --crate-type cdylib
Workaround
any of the following avoids the bug:
- Write
crate-type = ["cdylib"] in Cargo.toml
- Write
args=["--crate-type", "cdylib"] in initializer of RustExtension
Sample:
RustExtension(
'namespace.package', 'Cargo.toml',
binding = Binding.PyO3,
args = ["--crate-type", "cdylib"],
)
I will create PRs later.
Assumptions
--
rustc 1.70.0-nightly (db0cbc48d 2023-03-26)--
rustc 1.70.0-nightly (478cbb42b 2023-03-28)--
rustc 1.68.0-stableDescription
wheelpackage generation fails with latest toolchain, whencrate-type = ["cdylib"]is not contained inCargo.toml.Cause
The following command in build process will not work:
Instead, following works:
Workaround
any of the following avoids the bug:
crate-type = ["cdylib"]inCargo.tomlargs=["--crate-type", "cdylib"]in initializer ofRustExtensionSample:
I will create PRs later.