Skip to content

Commit b35f92e

Browse files
maffoodavidhewitt
authored andcommitted
Fail compilation on 32-bit windows
1 parent bdc5ade commit b35f92e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/ci.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
3737
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
3838
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
39-
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
4039
]
4140
include:
4241
# Older versions of CPython are not available for AArch64.
@@ -84,21 +83,29 @@ jobs:
8483
RUST_BACKTRACE: 1
8584

8685
test-numpy1:
87-
name: python${{ matrix.python-version }} numpy1
88-
runs-on: ubuntu-latest
86+
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} numpy1
87+
runs-on: ${{ matrix.platform.os }}
8988
needs: [lint, check-msrv, examples]
9089
strategy:
9190
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
9291
matrix:
9392
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
93+
platform: [
94+
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
95+
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
96+
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
97+
]
9498
steps:
9599
- uses: actions/checkout@v4
96100
- name: Set up Python ${{ matrix.python-version }}
97101
uses: actions/setup-python@v5
98102
with:
99103
python-version: ${{ matrix.python-version }}
104+
architecture: ${{ matrix.platform.python-architecture }}
100105
- name: Install Rust
101106
uses: dtolnay/rust-toolchain@stable
107+
with:
108+
targets: ${{ matrix.platform.rust-target }}
102109
- name: Install toml
103110
run: pip install toml
104111
- name: Edit Cargo.toml and enable new resolver

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ as well as the [`PyReadonlyArray::try_as_matrix`] and [`PyReadwriteArray::try_as
7272
7373
#![deny(missing_docs, missing_debug_implementations)]
7474

75+
#[cfg(all(target_os = "windows", target_arch = "x86"))]
76+
compile_error!("Compilation for 32-bit windows is not currently supported. See https://github.com/PyO3/rust-numpy/issues/448");
77+
7578
pub mod array;
7679
mod array_like;
7780
pub mod borrow;

0 commit comments

Comments
 (0)