PyO3 / maturin

Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
https://maturin.rs
Apache License 2.0
3.93k stars 272 forks source link

cross-compiling to win no longer possible with the new sdk #2118

Closed btel closed 4 months ago

btel commented 4 months ago

Bug Description

When trying to cross-compile windows binaries on linux I am receiving the error:

💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: no cab files were referenced by the MSI

See upstream issue on cargo-xwin: https://github.com/Jake-Shadle/xwin/issues/126

The proposed solution is to provide the sdk version using the --sdk-version command line argument, but it's not clear how to pass it via maturin.

Your maturin version (maturin --version)

1.6.0

Your Python version (python -V)

3.11

Your pip version (pip -V)

23.0.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

maturin build --release --target x86_64-pc-windows-msvc -i python3.11

messense commented 4 months ago

You can try set env var XWIN_VERSION=16.

btel commented 4 months ago

great, this worked! Thank you!