From aa7634bc492e06bfedb30550ab86f5d4979f0979 Mon Sep 17 00:00:00 2001 From: Neclow Date: Thu, 16 Apr 2026 11:45:36 +0000 Subject: [PATCH] fix(ci): add PyO3 generate-import-lib for Windows builds The Windows CI job fails because maturin-action encounters the WindowsApps python3.exe alias (EACCES) and cannot find a usable interpreter. Enabling PyO3's generate-import-lib feature generates the Windows import library at build time without needing a Python interpreter, eliminating the root cause. Co-Authored-By: Claude Opus 4.6 (1M context) --- Cargo.lock | 32 ++++++++++++++++++++++++++++++++ py-phylo2vec/Cargo.toml | 3 ++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index f5278c18..af2d8651 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,6 +68,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cc" +version = "1.2.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +dependencies = [ + "find-msvc-tools", + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -238,6 +248,12 @@ dependencies = [ "syn", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + [[package]] name = "futures" version = "0.3.31" @@ -674,6 +690,7 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6" dependencies = [ + "python3-dll-a", "target-lexicon", ] @@ -712,6 +729,15 @@ dependencies = [ "syn", ] +[[package]] +name = "python3-dll-a" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d80ba7540edb18890d444c5aa8e1f1f99b1bdf26fb26ae383135325f4a36042b" +dependencies = [ + "cc", +] + [[package]] name = "quote" version = "1.0.37" @@ -924,6 +950,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" version = "0.4.9" diff --git a/py-phylo2vec/Cargo.toml b/py-phylo2vec/Cargo.toml index d3a296ab..efdc039b 100644 --- a/py-phylo2vec/Cargo.toml +++ b/py-phylo2vec/Cargo.toml @@ -25,7 +25,8 @@ pyo3 = { version = "0.27.2", features = [ "abi3-py312", "abi3-py311", "abi3-py310", - "extension-module" + "extension-module", + "generate-import-lib", ] } phylo2vec = { workspace = true } numpy = "0.27.0"