# Bug: FindPython arch detection is bad with Windows on Arm

**URL:** https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769
**Category:** Development
**Tags:** os:windows
**Created:** [August 1, 2026, 10:20am UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769 "2026-08-01T10:20:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NAP64](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nap64/32/6203_2.png) [@NAP64](https://discourse.cmake.org/u/NAP64)
#### Post date: [August 1, 2026, 10:20am UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769/1 "2026-08-01T10:20:18Z")

</div>

Python architecture ID is aarch64, which does not contain ARM, thus fails the match.

CMake\share\cmake-4.4\Modules\FindPython\Support.cmake:1206

My current patch is changing the line to  
`if ((\_${\_PYTHON_PREFIX}*ARCHITECTURE_ID MATCHES "ARM") OR (*${\_PYTHON_PREFIX}\_ARCHITECTURE_ID MATCHES "aarch"))`

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [August 1, 2026, 10:32am UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769/2 "2026-08-01T10:32:54Z")

</div>

It seems that, depending on the compiler, CMAKE\_\_COMPILER\_ARCHITECTURE\_ID variable is different.

What is your CMake generator as well as compiler?

---

<div class="post-metadata">

### Author: ![NAP64](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nap64/32/6203_2.png) [@NAP64](https://discourse.cmake.org/u/NAP64)
#### Post date: [August 1, 2026, 11:07am UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769/3 "2026-08-01T11:07:41Z")

</div>

Ninja and LLVM22.1.8  
Could it be a change in LLVM? I couldn’t tell since I just updated both.

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [August 1, 2026, 2:26pm UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769/4 "2026-08-01T14:26:39Z")

</div>

Ok. I think I understood the problem. As specified by the documentation of [CMAKE\_LANG\_COMPILER\_ARCHITECTURE\_ID](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.html) variable, the value depends on the ABI (GNU or MSVC).

Please, can you log an [issue](https://gitlab.kitware.com/cmake/cmake/-/work_items?sort=created_date&state=opened) for this problem?

Thanks.
