Skip to content

Commit

Permalink
Fail compilation on 32-bit windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maffoo authored and davidhewitt committed Oct 4, 2024
1 parent bdc5ade commit b35f92e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
]
include:
# Older versions of CPython are not available for AArch64.
Expand Down Expand Up @@ -84,21 +83,29 @@ jobs:
RUST_BACKTRACE: 1

test-numpy1:
name: python${{ matrix.python-version }} numpy1
runs-on: ubuntu-latest
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} numpy1
runs-on: ${{ matrix.platform.os }}
needs: [lint, check-msrv, examples]
strategy:
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.rust-target }}
- name: Install toml
run: pip install toml
- name: Edit Cargo.toml and enable new resolver
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ as well as the [`PyReadonlyArray::try_as_matrix`] and [`PyReadwriteArray::try_as
#![deny(missing_docs, missing_debug_implementations)]

#[cfg(all(target_os = "windows", target_arch = "x86"))]
compile_error!("Compilation for 32-bit windows is not currently supported. See https://github.com/PyO3/rust-numpy/issues/448");

pub mod array;
mod array_like;
pub mod borrow;
Expand Down

0 comments on commit b35f92e

Please sign in to comment.