-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
maturin strips PYO3_CROSS_LIB_DIR
from the build command env
#824
Comments
I don't remember maturin strips Meanwhile I think you can workaround it by pass Lines 259 to 261 in 8c849a1
|
It doesn't strip any env vars per se, but builds the command environment from scratch.
This doesn't work because setting
|
I'm not sure about this, according to https://doc.rust-lang.org/std/process/struct.Command.html#method.new, it should inherit the current process’s environment. |
That looks correct, but it doesn't seem to happen in practice. When invoked from the shell with Unfortunately I can't share the crate to reproduce this on. |
Ok, by trial and error I've found a workaround:
This command works, and my hypothesis is it works because of: Line 130 in 8c849a1
Line 228 in 8c849a1
here |
Ok, everything I've written above is wrong, except for the workaround, which works for a completely different reason. The true cause of this issue is That's why setting This issue is solved by #847 |
I'm going to remove |
#848 works as well. I had to pass |
@ravenexp Is it the same issue as #844 (comment) ? It was fixed in #844 by reverting #843. |
Yes, the error message looks the same. |
Bug Description
When cross-compiling a Windows wheel by calling
cargo build
everything works correctly:When using
maturin build
as follows:I get the following error:
The error is occurring when linking one of the dependencies, not the target crate itself.
This dependency is both a PyO3 extension module and a Rust library, and cargo always generates both outputs.
Of these, only the Rust library is used to link the target extension module.
If I re-add the missing
PYO3_CROSS_LIB_DIR
variable the failing command succeeds:Maybe maturin should just pass
PYO3_CROSS_LIB_DIR
tocargo rustc
directly and not try to modify the library search path manually here:maturin/src/compile.rs
Lines 179 to 194 in 8c849a1
Your Python version (
python -V
)Python 3.10.0
Your pip version (
pip -V
)pip 21.0
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
The text was updated successfully, but these errors were encountered: