Skip to content

Commit 9cc298a

Browse files
rwgkcursoragent
andauthored
ci: pass explicit ARM64 Python artifacts on windows-11-arm (#6051)
Avoid relying on Python_ROOT_DIR alone because CMake FindPython can still resolve the hosted x64 python.org install on the Windows ARM runner and then fail at link time with an x64/arm64 mismatch. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c5b3ae8 commit 9cc298a

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,15 +1271,23 @@ jobs:
12711271
python -m pip install -r tests/requirements.txt
12721272
12731273
- name: Configure CMake
1274-
run: >
1275-
cmake -G Ninja -S . -B .
1276-
-DPYBIND11_WERROR=OFF
1277-
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
1278-
-DDOWNLOAD_CATCH=ON
1279-
-DDOWNLOAD_EIGEN=ON
1280-
-DCMAKE_CXX_COMPILER=clang++
1281-
-DCMAKE_CXX_STANDARD=20
1282-
-DPython_ROOT_DIR="$env:Python_ROOT_DIR"
1274+
run: |
1275+
$pythonExecutable = Join-Path $env:pythonLocation "python.exe"
1276+
$pythonIncludeDir = Join-Path $env:pythonLocation "include"
1277+
$pythonVersion = (python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')").Trim()
1278+
# PR 6051: FindPython can still resolve the x64 python.org install on
1279+
# windows-11-arm, so pass the ARM64 interpreter, headers, and import lib.
1280+
$pythonLibrary = Join-Path (Join-Path $env:pythonLocation "libs") "python$pythonVersion.lib"
1281+
cmake -G Ninja -S . -B . `
1282+
-DPYBIND11_WERROR=OFF `
1283+
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF `
1284+
-DDOWNLOAD_CATCH=ON `
1285+
-DDOWNLOAD_EIGEN=ON `
1286+
-DCMAKE_CXX_COMPILER=clang++ `
1287+
-DCMAKE_CXX_STANDARD=20 `
1288+
-DPython_EXECUTABLE="$pythonExecutable" `
1289+
-DPython_INCLUDE_DIR="$pythonIncludeDir" `
1290+
-DPython_LIBRARY="$pythonLibrary"
12831291
12841292
- name: Build
12851293
run: cmake --build . -j 2

0 commit comments

Comments
 (0)