cross compile from linux to win produces a wheel that crashes silently at runtime #2297
Replies: 4 comments 4 replies
-
Have you tried reproduce it directly on Windows w/o cross compilation? |
Beta Was this translation helpful? Give feedback.
-
I did try NOTE: it's a corp windows machine it is quite constrained with no admin rights. This is one reason, besides convenience, I try to buid all wheels from linux. For example Btw thx for the fast reply. |
Beta Was this translation helpful? Give feedback.
-
I keep searching and just found that if I cross compile without
mod black_scholes;
mod implied_vol;
// use pyo3_polars::PolarsAllocator;
use pyo3::types::{PyModule, PyModuleMethods};
use pyo3::{pymodule, Bound, PyResult};
#[pymodule]
fn _rust(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
Ok(())
}
// #[global_allocator]
// static ALLOC: PolarsAllocator = PolarsAllocator::new(); It seems PolarAllocator is defined there in repo pyo3-polars. What could be so toxic in it that produces a silent crash ? |
Beta Was this translation helpful? Give feedback.
-
Ref issue pola-rs/pyo3-polars#117 |
Beta Was this translation helpful? Give feedback.
-
Bug Description
The cross compile from linux to windows of package polars_plugin_option_pricing produces a wheel.
This wheel can be pip installed on windows.
So far no apparent error or warning.
But at runtime, the program exits silently without error message when reaching the compiled module:
polars_plugin_option_pricing._rust
.I tried to build the wheel on a linux host (ubuntu) and from inside a docker container (reproducible below).
I build the docker container on a ubuntu host and a redhat8 host.
Same result :-(
How to debug this ?
Is there a tested template of docker based cross compilation from linux to win somewhere in the docs ?
Note: the native and manylinux compilations work and produce working wheels.
Your maturin version (
maturin --version
)1.7.4
Your Python version (
python -V
)3.12
Your pip version (
pip -V
)24.3.1
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
Commands on linux host:
docker run logs:
Commands on win host, in conda env with py3.12:
pip install polars_plugin_option_pricing-0.1.0-cp38-abi3-win_amd64.whl # from repo root python test-run-bs.py
This command outputs:
The program should continue (cf demo notebook run-bs.ipynb), but exits without showing any indication what the error was...
Beta Was this translation helpful? Give feedback.
All reactions