crates with conditionally included pyo3 fail to link (/usr/bin/ld: cannot find -lpython3.10: No such file or directory
)
#3086
Labels
/usr/bin/ld: cannot find -lpython3.10: No such file or directory
)
#3086
Bug Description
I am building a parser in rust that needs to have bindings in multiple languages. Since I don't want unecessary copying overhead, I figured it would be nice if I could have one feature per (non-rust) language, and define the right structs and methods with conditional compilation.
Steps to Reproduce
maturin develop --features pythonbindings
Backtrace
Your operating system and version
Ubuntu 22.04.1 LTS
Your Python version (
python --version
)Python 3.10.6
Your Rust version (
rustc --version
)rustc 1.66.1 (90743e729 2023-01-10)
Your PyO3 version
0.18.2
How did you install python? Did you use a virtualenv?
apt
+python3 -m venv .venv
Additional Info
cargo build
works fine,cargo build --features pythonbindings
fails as expected.maturin also fails to link if the pyo3 dependency is not optional:
but it does link successfully if the default feature includes the pythonbindings feature:
I am at my wits' end, I don't even know whether this is a pyo3 or a tamurin bug.
The text was updated successfully, but these errors were encountered: