From 7f912e7a1ec902c2cac6bf61f4d264c17d911374 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 3 Jul 2026 18:41:50 +0800 Subject: [PATCH] fix: CI/CD build fail for arm64 windows --- deps/python3/python3.cmake | 5 +++++ deps/python3/windows-api-baseline-8.1.patch | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 deps/python3/windows-api-baseline-8.1.patch diff --git a/deps/python3/python3.cmake b/deps/python3/python3.cmake index 0b8e26d9cc..2659d52340 100644 --- a/deps/python3/python3.cmake +++ b/deps/python3/python3.cmake @@ -8,6 +8,10 @@ set(_python_url "https://www.python.org/ftp/python/${_python_version}/Python-${_ set(_python_sha256 "56bfef1fdfc1221ce6720e43a661e3eb41785dd914ce99698d8c7896af4bdaa1") if(WIN32) + set(_python_patch_args + PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/windows-api-baseline-8.1.patch + ) + if(MSVC_VERSION EQUAL 1800) set(_python_platform_toolset v120) elseif(MSVC_VERSION EQUAL 1900) @@ -223,6 +227,7 @@ ExternalProject_Add(dep_python3 URL "${_python_url}" URL_HASH SHA256=${_python_sha256} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/python3 + ${_python_patch_args} BUILD_IN_SOURCE ON CONFIGURE_COMMAND ${_conf_cmd} BUILD_COMMAND ${_build_cmd} diff --git a/deps/python3/windows-api-baseline-8.1.patch b/deps/python3/windows-api-baseline-8.1.patch new file mode 100644 index 0000000000..43f72cfbc8 --- /dev/null +++ b/deps/python3/windows-api-baseline-8.1.patch @@ -0,0 +1,19 @@ +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index ac878a01e1..4f8e7f0f97 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -161,9 +161,9 @@ WIN32 is still required for the locale module. + #endif /* MS_WIN64 */ +- ++ + /* set the version macros for the windows headers */ +-/* Python 3.9+ requires Windows 8 or greater */ +-#define Py_WINVER 0x0602 /* _WIN32_WINNT_WIN8 */ +-#define Py_NTDDI NTDDI_WIN8 ++/* Python 3.12+ requires Windows 8.1 or greater */ ++#define Py_WINVER 0x0603 /* _WIN32_WINNT_WINBLUE (8.1) */ ++#define Py_NTDDI NTDDI_WINBLUE +- ++ + /* We only set these values when building Python - we don't want to force + these values on extensions, as that will affect the prototypes and