From 1f79e2f6b220921a4e4c7c1523694fa70cea2086 Mon Sep 17 00:00:00 2001 From: ringsaturn Date: Mon, 2 Dec 2024 21:45:29 +0800 Subject: [PATCH] fix windows aarch64 --- .github/workflows/CI.yml | 5 +++-- Cargo.lock | 25 +++++++++++++++++++++++++ Cargo.toml | 2 +- pyproject.toml | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7b13f01..90e8ae1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -148,13 +148,14 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "3.12" - uses: messense/maturin-action@v1 with: target: aarch64-pc-windows-msvc command: build sccache: true - args: --release -o dist -i 3.9 3.10 3.11 3.12 3.13 + args: --release -o dist -i 3.11 3.12 + maturin-version: v1.7.7 - name: Upload wheels uses: actions/upload-artifact@v4 with: diff --git a/Cargo.lock b/Cargo.lock index cee96a0..e19ad54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,6 +41,15 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +[[package]] +name = "cc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +dependencies = [ + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -324,6 +333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3015cf985888fe66cfb63ce0e321c603706cd541b7aec7ddd35c281390af45d8" dependencies = [ "once_cell", + "python3-dll-a", "target-lexicon", ] @@ -362,6 +372,15 @@ dependencies = [ "syn", ] +[[package]] +name = "python3-dll-a" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b9e268ee1be609e93a13eb06839f68f67e5fe0fb4049834d261c2d5091c1b6d" +dependencies = [ + "cc", +] + [[package]] name = "quote" version = "1.0.37" @@ -452,6 +471,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "syn" version = "2.0.90" diff --git a/Cargo.toml b/Cargo.toml index b942122..2943e00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["cdylib"] [dependencies] lazy_static = "1.5.0" -pyo3 = {version = "0.23.2", features = ["extension-module", "abi3-py39"]} +pyo3 = {version = "0.23.2", features = ["extension-module", "generate-import-lib", "abi3-py39"]} # tzf-rs = { git = "https://github.com/ringsaturn/tzf-rs", rev = "31b1730", default-features = false} tzf-rs = { version = "0.4.9", default-features = false } diff --git a/pyproject.toml b/pyproject.toml index aad8583..31a6db3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,4 +55,4 @@ dev = [ [tool.maturin] # "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so) -features = ["pyo3/extension-module"] +features = ["pyo3/extension-module", "pyo3/generate-import-lib"]