Skip to content

Commit 41a4d0c

Browse files
K20shoresrwgk
andauthored
Add Windows arm tests (#5932)
* adding windows arm test - excluding numpy 2.2.0 for arm64 builds * adding windows arm msys2 test * testing mingw python * unnamed namespace test on windows arm with clang and mingw * Revert "unnamed namespace test on windows arm with clang and mingw" This reverts commit 08abf88. * bumping c++ version * commenting out other tests * Ignore unnmaed namespace on arm windows with mingw - Updatig XFAIL condition to expect a failure on windows arm with mingw and clang - setting python home and path variables in c++ tests * Revert "commenting out other tests" This reverts commit dc75243. * removing windows-11-arm from big test, push * removing redundant shell * removing trailing whitespace * Clarify Windows ARM clang job naming Rename the Windows ARM clang jobs to windows_arm_clang_msvc and windows_arm_clang_msys2 and adjust their display names to clang-msvc / clang-msys2. The first runs clang against the MSVC/Windows SDK toolchain and python.org CPython for Windows ARM, while the second runs clang inside the MSYS2/MinGW-w64 CLANGARM64 environment with MSYS2 Python. Using clearly distinguished job names makes it easier to discuss failures and behavior in each environment without ambiguity, both in logs and in PR review discussions. * Reduce Windows ARM clang matrix size Limit the windows_arm_clang_msvc job to Python 3.13 and the windows_arm_clang_msys2 job to Python 3.12 to stay within our constrained GitHub Actions resources. Keep both jobs using a matrix over os and python so their structure stays aligned and it remains easy to expand coverage when needed. * Remove matrix.python from windows_arm_clang_msys2 job: the Python version is determined by the msys2/setup-msys2 action and cannot be changed --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
1 parent 032e73d commit 41a4d0c

File tree

3 files changed

+138
-3
lines changed

3 files changed

+138
-3
lines changed

.github/workflows/ci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,3 +1205,134 @@ jobs:
12051205

12061206
- name: Clean directory
12071207
run: git clean -fdx
1208+
1209+
# Clang with MSVC/Windows SDK toolchain + python.org CPython (Windows ARM)
1210+
windows_arm_clang_msvc:
1211+
if: github.event.pull_request.draft == false
1212+
1213+
strategy:
1214+
fail-fast: false
1215+
matrix:
1216+
os: [windows-11-arm]
1217+
python: ['3.13']
1218+
1219+
runs-on: "${{ matrix.os }}"
1220+
timeout-minutes: 90
1221+
1222+
name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msvc"
1223+
1224+
steps:
1225+
- name: Show env
1226+
run: env
1227+
1228+
- name: Checkout
1229+
uses: actions/checkout@v6
1230+
1231+
- name: Setup Python ${{ matrix.python }}
1232+
uses: actions/setup-python@v6
1233+
with:
1234+
python-version: ${{ matrix.python }}
1235+
architecture: arm64
1236+
1237+
- name: Run pip installs
1238+
run: |
1239+
python -m pip install --upgrade pip
1240+
python -m pip install -r tests/requirements.txt
1241+
1242+
- name: Configure CMake
1243+
run: >
1244+
cmake -G Ninja -S . -B .
1245+
-DPYBIND11_WERROR=OFF
1246+
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
1247+
-DDOWNLOAD_CATCH=ON
1248+
-DDOWNLOAD_EIGEN=ON
1249+
-DCMAKE_CXX_COMPILER=clang++
1250+
-DCMAKE_CXX_STANDARD=20
1251+
-DPython_ROOT_DIR="$env:Python_ROOT_DIR"
1252+
1253+
- name: Build
1254+
run: cmake --build . -j 2
1255+
1256+
- name: Python tests
1257+
run: cmake --build . --target pytest -j 2
1258+
1259+
- name: C++ tests
1260+
run: cmake --build . --target cpptest -j 2
1261+
1262+
- name: Interface test
1263+
run: cmake --build . --target test_cmake_build -j 2
1264+
1265+
- name: Visibility test
1266+
run: cmake --build . --target test_cross_module_rtti -j 2
1267+
1268+
# Clang in MSYS2/MinGW-w64 CLANGARM64 toolchain + MSYS2 Python (Windows ARM)
1269+
windows_arm_clang_msys2:
1270+
if: github.event.pull_request.draft == false
1271+
1272+
strategy:
1273+
fail-fast: false
1274+
matrix:
1275+
os: [windows-11-arm]
1276+
1277+
runs-on: "${{ matrix.os }}"
1278+
timeout-minutes: 90
1279+
1280+
name: "${{ matrix.os }} • clang-msys2"
1281+
1282+
defaults:
1283+
run:
1284+
shell: msys2 {0}
1285+
1286+
steps:
1287+
- uses: actions/checkout@v6
1288+
with:
1289+
submodules: true
1290+
1291+
- uses: msys2/setup-msys2@v2
1292+
with:
1293+
msystem: CLANGARM64
1294+
update: true
1295+
install: |
1296+
mingw-w64-clang-aarch64-cmake
1297+
mingw-w64-clang-aarch64-clang
1298+
mingw-w64-clang-aarch64-ninja
1299+
mingw-w64-clang-aarch64-python-pip
1300+
mingw-w64-clang-aarch64-python-pytest
1301+
mingw-w64-clang-aarch64-python-numpy
1302+
1303+
- name: Debug info
1304+
run: |
1305+
clang++ --version
1306+
cmake --version
1307+
ninja --version
1308+
python --version
1309+
1310+
- name: Run pip installs
1311+
run: |
1312+
python -m pip install --upgrade pip
1313+
python -m pip install -r tests/requirements.txt
1314+
1315+
- name: Configure CMake
1316+
run: >-
1317+
cmake -S . -B build
1318+
-DPYBIND11_WERROR=OFF
1319+
-DDOWNLOAD_CATCH=ON
1320+
-DDOWNLOAD_EIGEN=ON
1321+
-DCMAKE_CXX_COMPILER=clang++
1322+
-DCMAKE_CXX_STANDARD=20
1323+
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
1324+
1325+
- name: Build
1326+
run: cmake --build build -j 2
1327+
1328+
- name: Python tests
1329+
run: cmake --build build --target pytest -j 2
1330+
1331+
- name: C++ tests
1332+
run: PYTHONHOME=/clangarm64 PYTHONPATH=/clangarm64 cmake --build build --target cpptest -j 2
1333+
1334+
- name: Interface test
1335+
run: cmake --build build --target test_cmake_build -j 2
1336+
1337+
- name: Visibility test
1338+
run: cmake --build build --target test_cross_module_rtti -j 2

tests/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ numpy~=2.2.0; python_version=="3.10" and platform_python_implementation=="PyPy"
77
numpy~=1.26.0; platform_python_implementation=="GraalVM" and sys_platform=="linux"
88
numpy~=1.21.5; platform_python_implementation=="CPython" and python_version>="3.8" and python_version<"3.10"
99
numpy~=1.22.2; platform_python_implementation=="CPython" and python_version=="3.10"
10-
numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13"
11-
numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13"
10+
numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" and platform_machine!="ARM64"
11+
numpy~=2.3.0; platform_python_implementation=="CPython" and python_version>="3.11" and platform_machine=="ARM64"
12+
numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" and platform_machine!="ARM64"
1213
pytest>=6
1314
pytest-timeout
1415
scipy~=1.5.4; platform_python_implementation=="CPython" and python_version<"3.10"

tests/test_unnamed_namespace_a.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
from pybind11_tests import unnamed_namespace_a as m
66
from pybind11_tests import unnamed_namespace_b as mb
77

8-
XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)"
8+
XFAIL_CONDITION = (
9+
"m.defined__LIBCPP_VERSION or "
10+
"(not m.defined_WIN32_or__WIN32 and m.defined___clang__)"
11+
)
912
XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319"
1013

1114

0 commit comments

Comments
 (0)