-
-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single workspace member with abi3 feature will force this for all members #876
Comments
(Conversely, if I remove the usage of the |
Opened #877 |
Reading Maturin's source code and considering that Cargo unifies features across the whole of a workspace, I came to the conclusion that the way I use features in the Hence, I opened PyO3/rust-numpy#322 and think we should be closing this instead. |
(I am sorry for writing this only now, but it took me a while to understand my mistake and figure out that what I did should not be working in the first place.) |
https://doc.rust-lang.org/cargo/reference/resolver.html#features
My read of this is that when you do |
Agreed, but then instead of #877, the way the Cargo meta-data is collected should be changed so that the above applies? |
But I am not sure if Cargo actually exposes this information, i.e. if I run
in the {
"id": "pyo3 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dependencies": [
"cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"indoc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"inventory 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.123 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pyo3-build-config 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"pyo3-ffi 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"pyo3-macros 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unindent 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)"
],
"deps": [
{
"name": "cfg_if",
"pkg": "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "indoc",
"pkg": "indoc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "inventory",
"pkg": "inventory 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "libc",
"pkg": "libc 0.2.123 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "parking_lot",
"pkg": "parking_lot 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "pyo3_build_config",
"pkg": "pyo3-build-config 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": "build",
"target": null
}
]
},
{
"name": "pyo3_ffi",
"pkg": "pyo3-ffi 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "pyo3_macros",
"pkg": "pyo3-macros 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
},
{
"name": "unindent",
"pkg": "unindent 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"dep_kinds": [
{
"kind": null,
"target": null
}
]
}
],
"features": [
"abi3",
"abi3-py310",
"abi3-py37",
"abi3-py38",
"abi3-py39",
"auto-initialize",
"default",
"extension-module",
"indoc",
"inventory",
"macros",
"multiple-pymethods",
"pyo3-macros",
"pyproto",
"unindent"
]
}, even though |
So essentially, this seems to be a mismatch between what |
Yes, I think we should find or open an issue in rust-lang/cargo. |
Found it: rust-lang/cargo#7754 |
I think I will break out the examples from the workspace for now, since it will probably take a while to resolve this upstream. (I need to do this any way for our MSRV tests and the loss of usability during development can be handled via the xtask script.) |
Bug Description
The rust-numpy repository is a Cargo workspace containing the main crate and three example crates which are Python extensions, one of which enables usage of the stable Python ABI via PyO3's
abi3
features. It appears this alone is enough to force auto-detection ofabi3
usage for the other examples as well which will silently fail until PyO3 0.16.3 and fails a consistency check since PyO3 0.16.4: Maturin detectsabi3
, setsPYO3_NO_PYTHON
but the crate itself does indeed not have any of theabi3
features enabled.Is it possible that the
abi3
detection logic is per-workspace instead of per-package?Your Python version (
python -V
)3.8.13
Your pip version (
pip -V
)22.0.4
What bindings you're using
pyo3
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
https://github.com/PyO3/rust-numpy/runs/6029114285?check_suite_focus=true
The text was updated successfully, but these errors were encountered: