From f0938767c8c323736e21b1db7be9df3babfd66c7 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 17 May 2022 19:04:24 +0800 Subject: [PATCH] Don't consider compile to i686 on x86_64 Windows cross compiling --- Changelog.md | 2 ++ src/cross_compile.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Changelog.md b/Changelog.md index 30128e102..65263a8dd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* Don't consider compile to i686 on x86_64 Windows cross compiling in [#923](https://github.com/PyO3/maturin/pull/923) + ## [0.12.16] - 2022-05-16 * Add Linux armv7l python sysconfig in [#901](https://github.com/PyO3/maturin/pull/901) diff --git a/src/cross_compile.rs b/src/cross_compile.rs index b32c9f8a3..f9cc8adc4 100644 --- a/src/cross_compile.rs +++ b/src/cross_compile.rs @@ -23,6 +23,11 @@ pub fn is_cross_compiling(target: &Target) -> Result { return Ok(false); } + if target_triple.starts_with("i686-pc-windows") && host.starts_with("x86_64-pc-windows") { + // Not cross-compiling to compile for 32-bit Python from windows 64-bit + return Ok(false); + } + if let Some(target_without_env) = target_triple .rfind('-') .map(|index| &target_triple[0..index])