From 5472fa6917c5075545731dc3ba29e19e80f56f37 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 10 May 2022 21:44:35 +0800 Subject: [PATCH] Add Windows non-abi3 cross compile test --- .github/workflows/ci.yml | 6 ++++++ examples/maturin-starter/Cargo.toml | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e2cd69b..c34af383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -277,11 +277,17 @@ jobs: env: XWIN_ARCH: x86_64 run: | + set -ex sudo apt-get install -y mingw-w64 llvm rustup target add x86_64-pc-windows-gnu x86_64-pc-windows-msvc python -m pip install cargo-xwin + # abi3 cargo build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-gnu cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-msvc + # non-abi3 + export PYO3_CROSS_PYTHON_VERSION=3.9 + cargo build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --target x86_64-pc-windows-gnu + cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --target x86_64-pc-windows-msvc - name: Test cross compile to Windows with maturin if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }} uses: messense/maturin-action@v1 diff --git a/examples/maturin-starter/Cargo.toml b/examples/maturin-starter/Cargo.toml index 64318dcf..c7e3d233 100644 --- a/examples/maturin-starter/Cargo.toml +++ b/examples/maturin-starter/Cargo.toml @@ -11,6 +11,7 @@ crate-type = ["cdylib"] pyo3 = { path = "../../", features = ["extension-module"] } [features] -abi3 = ["pyo3/abi3-py37", "pyo3/generate-import-lib"] +abi3 = ["pyo3/abi3-py37", "generate-import-lib"] +generate-import-lib = ["pyo3/generate-import-lib"] [workspace]