From a731ff5e85355191ecc836cebe47fd2dee9fffba Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 6 Jan 2026 20:07:40 +0100 Subject: [PATCH] python: Update to 3.13.11 --- ...-threads-and-make-it-default-on-min.patch} | 99 +-- ...INDOWS-and-others-when-compiling-wi.patch} | 10 +- ...ent-flags-_is_mingw-is_mingw_ucrt-an.patch | 64 ++ ...re-add-MACHDEP-and-platform-on-MINGW.patch | 43 +- ...fault-cross-configuration-for-MINGW.patch} | 20 +- ...-largefile-support-by-default-for-Mi.patch | 6 +- ...to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch} | 15 +- ...d-add-MINGW-support-for-posixmodule.patch} | 47 +- ...-by-default-when-compiling-for-MINGW.patch | 77 -- ...009-exports.h-Add-support-for-MINGW.patch} | 18 +- ...tions-so-that-shared-build-is-possib.patch | 74 ++ .../0011-build-Add-PYD_PLATFORM_TAG.patch | 100 +++ ...tions-so-that-shared-build-is-possib.patch | 59 -- ...dd-dynamic-loading-support-for-MINGW.patch | 101 --- ...ld-Add-dynload_win-support-for-MinGW.patch | 48 ++ ...xtension-suffix-fix-import-lib-insta.patch | 40 ++ ...igure-SOABI-and-EXT_SUFFIX-for-MINGW.patch | 52 ++ ...ne-MS_DLL_ID-for-sys.winver-on-MINGW.patch | 41 ++ ...-program-for-frozen-scripts-on-MING.patch} | 17 +- ...nfig-MINGW-build-extensions-with-GCC.patch | 22 - ...0017-socketmodule-add-MINGW-support.patch} | 85 +-- ...eg-msvcrt-_winapi-winsound-and-_ove.patch} | 52 +- .../0019-Customize-site-for-MINGW.patch | 59 -- ...-make-_sysconfigdata.py-relocatable.patch} | 33 +- .../0020-add-python-config-sh.patch | 159 ----- ...-treat-MINGW-builds-as-POSIX-builds.patch} | 57 +- ...-the-get_platform-method-in-sysconfi.patch | 55 ++ ...2-build-semi-native-build-sysconfig.patch} | 46 +- ...port-for-stdcall-without-underscore.patch} | 10 +- ...sysconfig-mingw-sysconfig-like-posix.patch | 62 -- ...or-for-ctypes.pythonapi-under-MINGW.patch} | 14 +- ...ngw-use-backslashes-in-compileall-py.patch | 27 - ...brary-c-should-return-None-with-ucrt.patch | 26 + .../0025-mingw-pdcurses_ISPAD.patch | 32 - .../0026-site-Customize-for-MINGW.patch | 55 ++ ...-site-packages-path-to-include-the-e.patch | 101 +++ ...tput-Windows-paths-for-the-shell-var.patch | 33 + .../0029-gdbm-module-includes.patch | 27 - ...e-the-Python-variant-of-python-confi.patch | 26 + ...-sep-if-MSYSTEM-environment-variabl.patch} | 213 +++--- ...031-build-Remove-MAXPATHLEN-default.patch} | 16 +- ...w-fix-ssl-dont-use-enum_certificates.patch | 36 - ...> 0032-build-dont-link-with-gettext.patch} | 29 +- ...fix-using-dllhandle-and-winver-mingw.patch | 36 - ...-config-so-msvccompiler-get_build_ve.patch | 39 - ...ch => 0033-use-gnu_printf-in-format.patch} | 24 +- ...4-MINGW-link-with-additional-library.patch | 30 - ...034-build-remove-usage-of-MS_COREDLL.patch | 56 ++ ...se-MINGW-toolchain-related-informati.patch | 69 ++ mingw-w64-python/0035-install-msilib.patch | 27 - ... 0036-build-fix-signal-module-build.patch} | 10 +- ...-build-winconsoleio-and-_testconsole.patch | 22 +- ...xpose-sem_unlink-to-fix-multiproces.patch} | 18 +- .../0039-Use-cygpty-while-using-isatty.patch | 165 ++--- ...win-resource-files-and-build-pythonw.patch | 73 +- ...-pycore_fileutils-add-MINGW-support.patch} | 18 +- ... 0042-configure-fix-inet_pton-check.patch} | 8 +- ...> 0043-importlib-bootstrap-path-sep.patch} | 8 +- .../0043-pass-gen-profile-ldflags.patch | 26 - ...4-configure-set-MINGW-stack-reserve.patch} | 9 +- ...indows-must-link-ext-with-python-lib.patch | 23 - ....patch => 0045-tests-fix-test_bytes.patch} | 8 +- .../0046-timemodule-add-MINGW-support.patch | 31 + mingw-w64-python/0046-warnings-fixes.patch | 94 --- ...ure-Disable-checks-for-dlopen-dlfcn.patch} | 25 +- .../0047-fix-build-testinternalcapi.patch | 22 - mingw-w64-python/0048-clang-arm64.patch | 47 -- ...d-venvlauncher.exe-from-PC-launcher.patch} | 125 ++-- ...looking-for-the-versioned-.exe-firs.patch} | 14 +- ...050-Don-t-use-os.pathsep-to-find-EOF.patch | 24 - ...p-find-python-in-Registry-for-mingw-.patch | 30 + ...ion-suffix-for-c-extensions-on-mingw.patch | 179 ----- ...re-don-t-check-for-clock_-functions.patch} | 24 +- ...d-and-add-some-mingw-specific-tests.patch} | 252 ++++--- ...the-get_platform-method-in-sysconfig.patch | 61 -- ...53-build-Fix-ncursesw-include-lookup.patch | 51 -- ...-to-without-c-locale-coercion-on-Wi.patch} | 10 +- .../0054-tests-Fix-some-failing-tests.patch | 101 +++ ...H-when-compiling-Python-sysmodule.c.patch} | 9 +- ...e-not-raising-for-invalid-year-value.patch | 25 - ...figure-correctly-find-native-python.patch} | 8 +- ...brary-c-should-return-None-with-ucrt.patch | 38 - ...d-extra-flags-for-_bootstrap_python.patch} | 8 +- ...stall-location-of-the-import-library.patch | 22 - ... 0058-getpath-add-support-for-mingw.patch} | 297 ++++++-- ...t-build-_posixsubprocess-on-Windows.patch} | 12 +- ...venvlauncher-build-installation-into.patch | 76 -- .../0060-ssl-module-add-MINGW-support.patch | 80 +++ ...e-winsock.h-when-checking-for-netdb-.patch | 58 ++ ...s-build-_multiprocessing-on-Windows.patch} | 11 +- ...-normpath-paths-coming-from-env-vars.patch | 32 - ...onfigure-build-mmap-module-on-win32.patch} | 8 +- ...0064-Define-PY3_DLLNAME-to-fix-build.patch | 26 - ...onfigure-set-BUILDEXEEXT-and-EXEEXT.patch} | 10 +- ...5-_testconsole.c-Fix-casing-path-sep.patch | 22 - ...gure-fix-building-some-test-modules.patch} | 32 +- ...-before-passing-though-pathcch-func.patch} | 16 +- ...t-architecture-markers-for-python-on.patch | 52 -- ...sesw-pkg-config-when-cross-compiling.patch | 36 - ...move-conflicting-_Py_CheckPython3-de.patch | 25 + ...nv-var-for-reverting-the-legacy-DLL.patch} | 55 +- ...mingw_smoketests-fix-_UCRT-condition.patch | 23 - ...-Modify-sys.winver-to-match-upstream.patch | 69 -- ...d_win-Port-GetPythonImport-to-MINGW.patch} | 14 +- ...-packages-path-to-include-the-enviro.patch | 119 ---- ...sure-to-only-use-backslashes-for-pa.patch} | 21 +- ...e-a-header-in-the-check-for-_beginth.patch | 33 - ...t-run-_Py_CheckPython3-for-MINGW-bui.patch | 26 + ...d-install-libpython3.dll-stable-ABI.patch} | 30 +- mingw-w64-python/0073-Fix-failing-tests.patch | 136 ---- ...gure-define-_DEBUG-for-a-debug-build.patch | 61 ++ ...sep-with-an-empty-MSYSTEM-env-var-no.patch | 132 ---- ...onfigure-fix-multiprocessing-module.patch} | 10 +- ...-add-MINGW-support-for-selectmodule.patch} | 18 +- .../0076-Make-_Py_CheckPython3-extern.patch | 38 - ...ure-disable-various-modules-on-MINGW.patch | 34 + ...dd-libraries-to-fix-ctypes-on-MINGW.patch} | 18 +- mingw-w64-python/0077-link-with-bcrypt.patch | 22 - ...078-configure-Enable-_uuid-on-MINGW.patch} | 10 +- ...ncompatible-pointer-types-a-warning.patch} | 9 +- ...80-posixmodule-undefine-HAVE_OPENDIR.patch | 31 - ...-tests-test_makefile-normalize-path.patch} | 11 +- ...1-Fix-include-naming-for-cross-build.patch | 69 ++ .../0082-Fix-format-warning.patch | 22 + .../0083-Fix-pragma-warnings.patch | 58 ++ .../0083-_ssl-link-with-ws2_32.patch | 22 - ...084-Always-normalize-path-in-abspath.patch | 22 - .../0084-math-pyhash-MINGW-support.patch | 45 ++ ...k.h-when-checking-for-netdb-function.patch | 46 -- ...0085-tests-Fix-test-for-library-name.patch | 30 + .../0086-dictobject-MINGW-support.patch | 22 + ...ld-Fix-export-Py_GetBuildInfo-symbol.patch | 25 + ...88-build-Allow-profile-tests-failure.patch | 31 + .../0088-venv-creation-fixes.patch | 51 -- ...d-add-support-for-building-C-modules.patch | 85 +++ ...n-function-where-winsock.h-is-includ.patch | 31 - .../0090-build-build-fix-the-wmi-module.patch | 71 ++ ...-Fix-exports-for-_suggestions-module.patch | 21 + ...sconfig.get_config_var-VPATH-to-an-a.patch | 53 -- .../0092-compileall-Normalize-paths.patch | 24 + ...-64-bit-time-support-for-32-bit-buil.patch | 28 + ...configure-Work-around-broken-pc-file.patch | 31 + .../0095-getpath.py-fix-dirname.patch | 55 -- ...ure-a-library-path-is-passed-when-bu.patch | 24 + ...-use-normpath-on-all-generated-paths.patch | 154 ---- ...also-install-the-versioned-launchers.patch | 36 + ...-configure-set-_WIN32_WINNT-version.patch} | 14 +- .../0097-pathconfig-normpath-sys.path-0.patch | 24 - ...ts-add-some-tests-for-sys-site-paths.patch | 43 -- ...ests-fix-sysconfig.test_get_platform.patch | 32 + ...0099-pycore_time-fix-missing-timeval.patch | 23 + .../0100-mmapmodule-define-DONT_USE_SEH.patch | 28 + ...-Add-ABIFLAGS-to-targets-when-needed.patch | 40 ++ ...-add-a-test-to-check-if-sysconfig-re.patch | 46 -- .../0106-readline-disable-on-MINGW.patch | 21 - ...lpython-version-while-linking-stdlib.patch | 44 -- .../0110-Enable-curses-library-on-MINGW.patch | 28 - ...ests-disable-distutils-related-tests.patch | 56 -- .../0112-configure.ac-use-autoconf-2.69.patch | 23 - .../0113-CI-clean-up-ignored-tests.patch | 87 --- ...g.get_platform-use-consistent-naming.patch | 255 ------- .../0117-Add-ucrt-to-version-string.patch | 41 -- ...tmodule-fix-captilization-of-headers.patch | 24 - ...smoketests-build-extension-in-a-venv.patch | 63 -- .../0121-venv-install-batch-scripts.patch | 22 - .../0122-winreg-patch-cleanup.patch | 86 --- mingw-w64-python/PKGBUILD | 666 ++++++++---------- mingw-w64-python/update-patches.sh | 2 +- 168 files changed, 3601 insertions(+), 4911 deletions(-) rename mingw-w64-python/{0002-build-add-with-nt-threads-and-make-it-default-on-min.patch => 0001-build-add-with-nt-threads-and-make-it-default-on-min.patch} (80%) rename mingw-w64-python/{0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch => 0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch} (91%) create mode 100644 mingw-w64-python/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch rename mingw-w64-python/{0005-Add-default-configuration-for-MINGW.patch => 0005-build-Add-default-cross-configuration-for-MINGW.patch} (82%) rename mingw-w64-python/{0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch => 0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch} (77%) rename mingw-w64-python/{0008-posixmodule.c-Define-necessary-headers-for-compiling.patch => 0008-build-add-MINGW-support-for-posixmodule.patch} (69%) delete mode 100644 mingw-w64-python/0009-Build-winreg-by-default-when-compiling-for-MINGW.patch rename mingw-w64-python/{0010-pyport.h-Add-support-for-MINGW.patch => 0009-exports.h-Add-support-for-MINGW.patch} (85%) create mode 100644 mingw-w64-python/0010-configure-add-options-so-that-shared-build-is-possib.patch create mode 100644 mingw-w64-python/0011-build-Add-PYD_PLATFORM_TAG.patch delete mode 100644 mingw-w64-python/0011-configure-add-options-so-that-shared-build-is-possib.patch delete mode 100644 mingw-w64-python/0012-Add-dynamic-loading-support-for-MINGW.patch create mode 100644 mingw-w64-python/0012-build-Add-dynload_win-support-for-MinGW.patch create mode 100644 mingw-w64-python/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch create mode 100644 mingw-w64-python/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch create mode 100644 mingw-w64-python/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch rename mingw-w64-python/{0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch => 0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch} (76%) delete mode 100644 mingw-w64-python/0016-sysconfig-MINGW-build-extensions-with-GCC.patch rename mingw-w64-python/{0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch => 0017-socketmodule-add-MINGW-support.patch} (70%) rename mingw-w64-python/{0015-Enable-some-windows-specific-modules.patch => 0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch} (68%) delete mode 100644 mingw-w64-python/0019-Customize-site-for-MINGW.patch rename mingw-w64-python/{0001-sysconfig-make-_sysconfigdata.py-relocatable.patch => 0019-sysconfig-make-_sysconfigdata.py-relocatable.patch} (67%) delete mode 100644 mingw-w64-python/0020-add-python-config-sh.patch rename mingw-w64-python/{0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch => 0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch} (57%) create mode 100644 mingw-w64-python/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch rename mingw-w64-python/{0022-msys-cygwin-semi-native-build-sysconfig.patch => 0022-build-semi-native-build-sysconfig.patch} (73%) rename mingw-w64-python/{0018-Add-support-for-stdcall-without-underscore.patch => 0023-ctypes-Add-support-for-stdcall-without-underscore.patch} (86%) delete mode 100644 mingw-w64-python/0023-sysconfig-mingw-sysconfig-like-posix.patch rename mingw-w64-python/{0028-ctypes-python-dll.patch => 0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch} (67%) delete mode 100644 mingw-w64-python/0024-mingw-use-backslashes-in-compileall-py.patch create mode 100644 mingw-w64-python/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch delete mode 100644 mingw-w64-python/0025-mingw-pdcurses_ISPAD.patch create mode 100644 mingw-w64-python/0026-site-Customize-for-MINGW.patch create mode 100644 mingw-w64-python/0027-site-Change-user-site-packages-path-to-include-the-e.patch create mode 100644 mingw-w64-python/0028-python-config-output-Windows-paths-for-the-shell-var.patch delete mode 100644 mingw-w64-python/0029-gdbm-module-includes.patch create mode 100644 mingw-w64-python/0029-python-config-use-the-Python-variant-of-python-confi.patch rename mingw-w64-python/{0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch => 0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch} (69%) rename mingw-w64-python/{0026-remove_path_max.default.patch => 0031-build-Remove-MAXPATHLEN-default.patch} (63%) delete mode 100644 mingw-w64-python/0031-mingw-fix-ssl-dont-use-enum_certificates.patch rename mingw-w64-python/{0027-dont-link-with-gettext.patch => 0032-build-dont-link-with-gettext.patch} (67%) delete mode 100644 mingw-w64-python/0032-fix-using-dllhandle-and-winver-mingw.patch delete mode 100644 mingw-w64-python/0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch rename mingw-w64-python/{0030-use-gnu_printf-in-format.patch => 0033-use-gnu_printf-in-format.patch} (82%) delete mode 100644 mingw-w64-python/0034-MINGW-link-with-additional-library.patch create mode 100644 mingw-w64-python/0034-build-remove-usage-of-MS_COREDLL.patch create mode 100644 mingw-w64-python/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch delete mode 100644 mingw-w64-python/0035-install-msilib.patch rename mingw-w64-python/{0036-fix-signal-module-build.patch => 0036-build-fix-signal-module-build.patch} (73%) rename mingw-w64-python/{0038-expose-sem_unlink.patch => 0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch} (58%) rename mingw-w64-python/{0041-fix-isselectable.patch => 0041-pycore_fileutils-add-MINGW-support.patch} (56%) rename mingw-w64-python/{0042-configure.ac-fix-inet_pton-check.patch => 0042-configure-fix-inet_pton-check.patch} (75%) rename mingw-w64-python/{0045-importlib-bootstrap-path-sep.patch => 0043-importlib-bootstrap-path-sep.patch} (82%) delete mode 100644 mingw-w64-python/0043-pass-gen-profile-ldflags.patch rename mingw-w64-python/{0049-configure.ac-set-MINGW-stack-reserve.patch => 0044-configure-set-MINGW-stack-reserve.patch} (70%) delete mode 100644 mingw-w64-python/0044-pkg-config-windows-must-link-ext-with-python-lib.patch rename mingw-w64-python/{0054-tests-fix-test_bytes.patch => 0045-tests-fix-test_bytes.patch} (77%) create mode 100644 mingw-w64-python/0046-timemodule-add-MINGW-support.patch delete mode 100644 mingw-w64-python/0046-warnings-fixes.patch rename mingw-w64-python/{0057-build-Disable-checks-for-dlopen-dlfcn.patch => 0047-configure-Disable-checks-for-dlopen-dlfcn.patch} (67%) delete mode 100644 mingw-w64-python/0047-fix-build-testinternalcapi.patch delete mode 100644 mingw-w64-python/0048-clang-arm64.patch rename mingw-w64-python/{0094-Build-venvlauncher.exe-from-PC-launcher.c.patch => 0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch} (67%) rename mingw-w64-python/{0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch => 0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch} (91%) delete mode 100644 mingw-w64-python/0050-Don-t-use-os.pathsep-to-find-EOF.patch create mode 100644 mingw-w64-python/0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch delete mode 100644 mingw-w64-python/0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch rename mingw-w64-python/{0061-configure.ac-don-t-check-for-clock_-functions.patch => 0051-configure-don-t-check-for-clock_-functions.patch} (50%) rename mingw-w64-python/{0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch => 0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch} (61%) delete mode 100644 mingw-w64-python/0052-Change-the-get_platform-method-in-sysconfig.patch delete mode 100644 mingw-w64-python/0053-build-Fix-ncursesw-include-lookup.patch rename mingw-w64-python/{0072-configure.ac-Default-to-without-c-locale-coercion-on.patch => 0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch} (81%) create mode 100644 mingw-w64-python/0054-tests-Fix-some-failing-tests.patch rename mingw-w64-python/{0075-def-VPATH-when-compiling-Python-sysmodule.c.patch => 0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch} (65%) delete mode 100644 mingw-w64-python/0055-time-fix-strftime-not-raising-for-invalid-year-value.patch rename mingw-w64-python/{0078-correctly-find-native-python.patch => 0056-configure-correctly-find-native-python.patch} (73%) delete mode 100644 mingw-w64-python/0056-ctypes-find_library-c-should-return-None-with-ucrt.patch rename mingw-w64-python/{0079-Add-extra-flags-for-_bootstrap_python.patch => 0057-build-Add-extra-flags-for-_bootstrap_python.patch} (77%) delete mode 100644 mingw-w64-python/0058-Fix-install-location-of-the-import-library.patch rename mingw-w64-python/{0081-getpath.py-add-support-for-mingw.patch => 0058-getpath-add-support-for-mingw.patch} (56%) rename mingw-w64-python/{0082-Don-t-build-_posixsubprocess-on-Windows.patch => 0059-build-Don-t-build-_posixsubprocess-on-Windows.patch} (68%) delete mode 100644 mingw-w64-python/0059-build-Integrate-venvlauncher-build-installation-into.patch create mode 100644 mingw-w64-python/0060-ssl-module-add-MINGW-support.patch create mode 100644 mingw-w64-python/0061-configure-Include-winsock.h-when-checking-for-netdb-.patch rename mingw-w64-python/{0086-include-_multiprocessing-semaphore.c-on-win32.patch => 0062-configure-always-build-_multiprocessing-on-Windows.patch} (63%) delete mode 100644 mingw-w64-python/0062-expanduser-normpath-paths-coming-from-env-vars.patch rename mingw-w64-python/{0087-configure-build-mmap-module-on-win32.patch => 0063-configure-build-mmap-module-on-win32.patch} (79%) delete mode 100644 mingw-w64-python/0064-Define-PY3_DLLNAME-to-fix-build.patch rename mingw-w64-python/{0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch => 0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch} (70%) delete mode 100644 mingw-w64-python/0065-_testconsole.c-Fix-casing-path-sep.patch rename mingw-w64-python/{0091-configure.ac-fix-building-some-test-modules.patch => 0065-configure-fix-building-some-test-modules.patch} (62%) rename mingw-w64-python/{0093-Always-convert-to-before-passing-though-pathcch-func.patch => 0066-Always-convert-to-before-passing-though-pathcch-func.patch} (88%) delete mode 100644 mingw-w64-python/0066-Return-consistent-architecture-markers-for-python-on.patch delete mode 100644 mingw-w64-python/0067-handle-ncursesw-pkg-config-when-cross-compiling.patch create mode 100644 mingw-w64-python/0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch rename mingw-w64-python/{0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch => 0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch} (64%) delete mode 100644 mingw-w64-python/0068-mingw_smoketests-fix-_UCRT-condition.patch delete mode 100644 mingw-w64-python/0069-Modify-sys.winver-to-match-upstream.patch rename mingw-w64-python/{0101-Port-GetPythonImport-to-mingw.patch => 0069-dynload_win-Port-GetPythonImport-to-MINGW.patch} (85%) delete mode 100644 mingw-w64-python/0070-Change-user-site-packages-path-to-include-the-enviro.patch rename mingw-w64-python/{0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch => 0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch} (67%) delete mode 100644 mingw-w64-python/0071-configure-Include-a-header-in-the-check-for-_beginth.patch create mode 100644 mingw-w64-python/0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch rename mingw-w64-python/{0100-Build-and-install-libpython3.dll.patch => 0072-build-Build-and-install-libpython3.dll-stable-ABI.patch} (79%) delete mode 100644 mingw-w64-python/0073-Fix-failing-tests.patch create mode 100644 mingw-w64-python/0073-configure-define-_DEBUG-for-a-debug-build.patch delete mode 100644 mingw-w64-python/0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch rename mingw-w64-python/{0104-Add-missing-library-for-multiprocessing-module.patch => 0074-configure-fix-multiprocessing-module.patch} (78%) rename mingw-w64-python/{0105-selectmodule-add-support-for-MINGW.patch => 0075-build-add-MINGW-support-for-selectmodule.patch} (77%) delete mode 100644 mingw-w64-python/0076-Make-_Py_CheckPython3-extern.patch create mode 100644 mingw-w64-python/0076-configure-disable-various-modules-on-MINGW.patch rename mingw-w64-python/{0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch => 0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch} (71%) delete mode 100644 mingw-w64-python/0077-link-with-bcrypt.patch rename mingw-w64-python/{0109-Enable-_uuid-on-MINGW.patch => 0078-configure-Enable-_uuid-on-MINGW.patch} (78%) rename mingw-w64-python/{0114-gcc-make-incompatible-pointer-types-as-warning.patch => 0079-configure-make-incompatible-pointer-types-a-warning.patch} (80%) delete mode 100644 mingw-w64-python/0080-posixmodule-undefine-HAVE_OPENDIR.patch rename mingw-w64-python/{0115-test_makefile-normalize-path.patch => 0080-tests-test_makefile-normalize-path.patch} (72%) create mode 100644 mingw-w64-python/0081-Fix-include-naming-for-cross-build.patch create mode 100644 mingw-w64-python/0082-Fix-format-warning.patch create mode 100644 mingw-w64-python/0083-Fix-pragma-warnings.patch delete mode 100644 mingw-w64-python/0083-_ssl-link-with-ws2_32.patch delete mode 100644 mingw-w64-python/0084-Always-normalize-path-in-abspath.patch create mode 100644 mingw-w64-python/0084-math-pyhash-MINGW-support.patch delete mode 100644 mingw-w64-python/0085-Include-winsock.h-when-checking-for-netdb-function.patch create mode 100644 mingw-w64-python/0085-tests-Fix-test-for-library-name.patch create mode 100644 mingw-w64-python/0086-dictobject-MINGW-support.patch create mode 100644 mingw-w64-python/0087-build-Fix-export-Py_GetBuildInfo-symbol.patch create mode 100644 mingw-w64-python/0088-build-Allow-profile-tests-failure.patch delete mode 100644 mingw-w64-python/0088-venv-creation-fixes.patch create mode 100644 mingw-w64-python/0089-build-add-support-for-building-C-modules.patch delete mode 100644 mingw-w64-python/0089-move-the-shutdown-function-where-winsock.h-is-includ.patch create mode 100644 mingw-w64-python/0090-build-build-fix-the-wmi-module.patch create mode 100644 mingw-w64-python/0091-Fix-exports-for-_suggestions-module.patch delete mode 100644 mingw-w64-python/0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch create mode 100644 mingw-w64-python/0092-compileall-Normalize-paths.patch create mode 100644 mingw-w64-python/0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch create mode 100644 mingw-w64-python/0094-configure-Work-around-broken-pc-file.patch delete mode 100644 mingw-w64-python/0095-getpath.py-fix-dirname.patch create mode 100644 mingw-w64-python/0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch delete mode 100644 mingw-w64-python/0096-getpath-use-normpath-on-all-generated-paths.patch create mode 100644 mingw-w64-python/0096-venv-also-install-the-versioned-launchers.patch rename mingw-w64-python/{0060-configure.ac-set-_WIN32_WINNT-version.patch => 0097-configure-set-_WIN32_WINNT-version.patch} (56%) delete mode 100644 mingw-w64-python/0097-pathconfig-normpath-sys.path-0.patch delete mode 100644 mingw-w64-python/0098-smoketests-add-some-tests-for-sys-site-paths.patch create mode 100644 mingw-w64-python/0098-tests-fix-sysconfig.test_get_platform.patch create mode 100644 mingw-w64-python/0099-pycore_time-fix-missing-timeval.patch create mode 100644 mingw-w64-python/0100-mmapmodule-define-DONT_USE_SEH.patch create mode 100644 mingw-w64-python/0101-build-Add-ABIFLAGS-to-targets-when-needed.patch delete mode 100644 mingw-w64-python/0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch delete mode 100644 mingw-w64-python/0106-readline-disable-on-MINGW.patch delete mode 100644 mingw-w64-python/0108-Add-lpython-version-while-linking-stdlib.patch delete mode 100644 mingw-w64-python/0110-Enable-curses-library-on-MINGW.patch delete mode 100644 mingw-w64-python/0111-mingw_smoketests-disable-distutils-related-tests.patch delete mode 100644 mingw-w64-python/0112-configure.ac-use-autoconf-2.69.patch delete mode 100644 mingw-w64-python/0113-CI-clean-up-ignored-tests.patch delete mode 100644 mingw-w64-python/0116-sysconfig.get_platform-use-consistent-naming.patch delete mode 100644 mingw-w64-python/0117-Add-ucrt-to-version-string.patch delete mode 100644 mingw-w64-python/0118-socketmodule-fix-captilization-of-headers.patch delete mode 100644 mingw-w64-python/0119-mingw_smoketests-build-extension-in-a-venv.patch delete mode 100644 mingw-w64-python/0121-venv-install-batch-scripts.patch delete mode 100644 mingw-w64-python/0122-winreg-patch-cleanup.patch diff --git a/mingw-w64-python/0002-build-add-with-nt-threads-and-make-it-default-on-min.patch b/mingw-w64-python/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch similarity index 80% rename from mingw-w64-python/0002-build-add-with-nt-threads-and-make-it-default-on-min.patch rename to mingw-w64-python/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch index 9573e6ac8921a..ae6c103408f34 100644 --- a/mingw-w64-python/0002-build-add-with-nt-threads-and-make-it-default-on-min.patch +++ b/mingw-w64-python/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch @@ -1,8 +1,8 @@ -From 2115fe6ff955e128126b6f7f30b9282489608a4b Mon Sep 17 00:00:00 2001 +From 954b5861478843b0f7769fce97a2ff11d50c7681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:12 +0530 -Subject: [PATCH 002/N] build: add --with-nt-threads and make it default on +Subject: [PATCH 001/N] build: add --with-nt-threads and make it default on mingw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -12,31 +12,19 @@ Co-authored-by: Naveen M K Co-authored-by: Алексей Co-authored-by: Christoph Reiter --- - Include/internal/pycore_condvar.h | 10 ++ + Include/internal/pycore_condvar.h | 4 + + Include/internal/pycore_pythread.h | 6 ++ Include/pythread.h | 6 ++ - Modules/_multiprocessing/multiprocessing.h | 5 +- + Modules/_multiprocessing/multiprocessing.h | 3 + configure.ac | 102 ++++++++++++++++++++- pyconfig.h.in | 3 + - 5 files changed, 122 insertions(+), 4 deletions(-) + 6 files changed, 121 insertions(+), 3 deletions(-) diff --git a/Include/internal/pycore_condvar.h b/Include/internal/pycore_condvar.h -index 2177bed..c46486f 100644 +index 55271f0..8b23568 100644 --- a/Include/internal/pycore_condvar.h +++ b/Include/internal/pycore_condvar.h -@@ -5,6 +5,12 @@ - # error "this header requires Py_BUILD_CORE define" - #endif - -+#ifdef __MINGW32__ -+# if !defined(HAVE_PTHREAD_H) || defined(NT_THREADS) -+# undef _POSIX_THREADS -+# endif -+#endif -+ - #ifndef _POSIX_THREADS - /* This means pthreads are not implemented in libc headers, hence the macro - not present in unistd.h. But they still can be implemented as an external -@@ -41,6 +47,10 @@ +@@ -35,6 +35,10 @@ # define WIN32_LEAN_AND_MEAN #endif #include // CRITICAL_SECTION @@ -46,9 +34,26 @@ index 2177bed..c46486f 100644 +#endif /* options */ - /* non-emulated condition variables are provided for those that want + /* emulated condition variables are provided for those that want +diff --git a/Include/internal/pycore_pythread.h b/Include/internal/pycore_pythread.h +index bc389a0..bd24235 100644 +--- a/Include/internal/pycore_pythread.h ++++ b/Include/internal/pycore_pythread.h +@@ -16,6 +16,12 @@ extern "C" { + && !defined(_POSIX_SEMAPHORES)) + # include // _POSIX_THREADS, _POSIX_SEMAPHORES + #endif ++#ifdef __MINGW32__ ++# if !defined(HAVE_PTHREAD_H) || defined(NT_THREADS) ++# undef _POSIX_THREADS ++# endif ++#endif ++ + #if (defined(HAVE_PTHREAD_H) && !defined(_POSIX_THREADS) \ + && !defined(_POSIX_SEMAPHORES)) + // This means pthreads are not implemented in libc headers, hence the macro diff --git a/Include/pythread.h b/Include/pythread.h -index 6371443..5e84e3c 100644 +index 4aa221c..af9426a 100644 --- a/Include/pythread.h +++ b/Include/pythread.h @@ -7,6 +7,12 @@ typedef void *PyThread_type_lock; @@ -65,15 +70,13 @@ index 6371443..5e84e3c 100644 * backwards compatibility, ie failure -> 0, success -> 1. */ typedef enum PyLockStatus { diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h -index dfc2a8e..dc92a23 100644 +index 099004b..ba80920 100644 --- a/Modules/_multiprocessing/multiprocessing.h +++ b/Modules/_multiprocessing/multiprocessing.h -@@ -23,7 +23,10 @@ - # endif +@@ -31,6 +31,9 @@ # define SEM_HANDLE HANDLE # define SEM_VALUE_MAX LONG_MAX --# define HAVE_MP_SEMAPHORE -+# define HAVE_MP_SEMAPHORE + # define HAVE_MP_SEMAPHORE +# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS) +# include +# endif @@ -81,10 +84,10 @@ index dfc2a8e..dc92a23 100644 # include /* O_CREAT and O_EXCL */ # if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) diff --git a/configure.ac b/configure.ac -index 1a02d19..de008a9 100644 +index 597a44b..d6f4105 100644 --- a/configure.ac +++ b/configure.ac -@@ -2721,6 +2721,53 @@ then +@@ -2832,6 +2832,53 @@ then BASECFLAGS="$BASECFLAGS $ac_arch_flags" fi @@ -121,7 +124,7 @@ index 1a02d19..de008a9 100644 +if test $with_nt_threads = yes ; then +AC_MSG_CHECKING([whether linking with nt-threads work]) +AC_LINK_IFELSE([ -+ AC_LANG_PROGRAM([[]],[[_beginthread(0, 0, 0);]]) ++ AC_LANG_PROGRAM([[#include ]],[[_beginthread(0, 0, 0);]]) + ], + [AC_MSG_RESULT([yes])], + [AC_MSG_ERROR([failed to link with nt-threads])]) @@ -138,7 +141,7 @@ index 1a02d19..de008a9 100644 # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). -@@ -2832,6 +2879,8 @@ int main(void){ +@@ -2943,6 +2990,8 @@ int main(void){ CC="$ac_save_cc"]) fi @@ -147,7 +150,7 @@ index 1a02d19..de008a9 100644 # If we have set a CC compiler flag for thread support then # check if it works for CXX, too. if test ! -z "$CXX" -@@ -2851,6 +2900,10 @@ elif test "$ac_cv_pthread" = "yes" +@@ -2962,6 +3011,10 @@ elif test "$ac_cv_pthread" = "yes" then CXX="$CXX -pthread" ac_cv_cxx_thread=yes @@ -158,9 +161,9 @@ index 1a02d19..de008a9 100644 else ac_cv_cxx_thread=no fi -@@ -2892,8 +2945,8 @@ AC_CHECK_HEADERS([ \ - alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ +@@ -3003,8 +3056,8 @@ AC_CHECK_HEADERS([ \ + alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ + io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ linux/random.h linux/soundcard.h \ - linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ - sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ @@ -169,7 +172,7 @@ index 1a02d19..de008a9 100644 sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \ sys/loadavg.h sys/lock.h sys/memfd.h sys/mkdev.h sys/mman.h sys/modem.h sys/param.h sys/pidfd.h sys/poll.h \ sys/random.h sys/resource.h sys/select.h sys/sendfile.h sys/socket.h sys/soundcard.h sys/stat.h \ -@@ -2904,6 +2957,14 @@ AC_CHECK_HEADERS([ \ +@@ -3015,6 +3068,14 @@ AC_CHECK_HEADERS([ \ AC_HEADER_DIRENT AC_HEADER_MAJOR @@ -184,7 +187,7 @@ index 1a02d19..de008a9 100644 # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS -@@ -3116,6 +3177,10 @@ elif test "$ac_cv_pthread" = "yes" +@@ -3222,6 +3283,10 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi @@ -195,7 +198,7 @@ index 1a02d19..de008a9 100644 AC_CACHE_CHECK([for pthread_t], [ac_cv_have_pthread_t], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[@%:@include ]], [[pthread_t x; x = *(pthread_t*)0;]]) -@@ -3147,7 +3212,7 @@ AS_VAR_IF([ac_cv_pthread_key_t_is_arithmetic_type], [yes], [ +@@ -3253,7 +3318,7 @@ AS_VAR_IF([ac_cv_pthread_key_t_is_arithmetic_type], [yes], [ AC_DEFINE([PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT], [1], [Define if pthread_key_t is compatible with int.]) ]) @@ -204,9 +207,9 @@ index 1a02d19..de008a9 100644 CC="$ac_save_cc" AC_MSG_CHECKING([for --enable-framework]) -@@ -3679,10 +3744,15 @@ AS_VAR_IF([have_uuid], [missing], [ - - AS_VAR_IF([have_uuid], [missing], [have_uuid=no]) +@@ -3881,10 +3946,15 @@ then + fi + fi +if test $with_nt_threads = yes ; then + dnl do not search for sem_init if NT-thread model is enabled @@ -220,7 +223,7 @@ index 1a02d19..de008a9 100644 # check if we need libintl for locale functions AC_CHECK_LIB([intl], [textdomain], -@@ -4402,6 +4472,11 @@ then +@@ -4619,6 +4689,11 @@ then CXX="$CXX -pthread" fi posix_threads=yes @@ -232,7 +235,7 @@ index 1a02d19..de008a9 100644 else if test ! -z "$withval" -a -d "$withval" then LDFLAGS="$LDFLAGS -L$withval" -@@ -4918,6 +4993,15 @@ else +@@ -5215,6 +5290,15 @@ if test "$ac_sys_system" = "Linux-android"; then fi # checks for library functions @@ -246,9 +249,9 @@ index 1a02d19..de008a9 100644 + ac_cv_func_sched_setscheduler=skip +fi AC_CHECK_FUNCS([ \ - accept4 alarm bind_textdomain_codeset chmod chown clock close_range confstr \ + accept4 alarm bind_textdomain_codeset chmod chown clock closefrom close_range confstr \ copy_file_range ctermid dup dup3 execv explicit_bzero explicit_memset \ -@@ -5814,6 +5898,10 @@ dnl actually works. For FreeBSD versions <= 7.2, +@@ -6108,6 +6192,10 @@ dnl actually works. For FreeBSD versions <= 7.2, dnl the kernel module that provides POSIX semaphores dnl isn't loaded by default, so an attempt to call dnl sem_open results in a 'Signal 12' error. @@ -259,7 +262,7 @@ index 1a02d19..de008a9 100644 AC_CACHE_CHECK([whether POSIX semaphores are enabled], [ac_cv_posix_semaphores_enabled], AC_RUN_IFELSE([ AC_LANG_SOURCE([ -@@ -5847,6 +5935,14 @@ AS_VAR_IF([ac_cv_posix_semaphores_enabled], [no], [ +@@ -6141,6 +6229,14 @@ AS_VAR_IF([ac_cv_posix_semaphores_enabled], [no], [ ]) dnl Multiprocessing check for broken sem_getvalue @@ -275,10 +278,10 @@ index 1a02d19..de008a9 100644 AC_RUN_IFELSE([ AC_LANG_SOURCE([ diff --git a/pyconfig.h.in b/pyconfig.h.in -index df4d29f..b359e13 100644 +index e18a642..60daba7 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in -@@ -1552,6 +1552,9 @@ +@@ -1633,6 +1633,9 @@ /* Define if mvwdelch in curses.h is an expression. */ #undef MVWDELCH_IS_EXPRESSION diff --git a/mingw-w64-python/0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch b/mingw-w64-python/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch similarity index 91% rename from mingw-w64-python/0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch rename to mingw-w64-python/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch index 6b9f38d86b11d..4a6ef94b8c590 100644 --- a/mingw-w64-python/0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch +++ b/mingw-w64-python/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch @@ -1,9 +1,9 @@ -From 0f488f1213d0c730a1d7a422c12da27141775ab4 Mon Sep 17 00:00:00 2001 +From 3d52cd67f6d6cd57c6a13a0066a0bf5d21d18457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:13 +0530 -Subject: [PATCH 003/N] Define `MS_WINDOWS` (and others) when compiling with - MINGW +Subject: [PATCH 002/N] build: Define `MS_WINDOWS` (and others) when + compiling with MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -22,10 +22,10 @@ Co-authored-by: Naveen M K 1 file changed, 38 insertions(+) diff --git a/Include/pyport.h b/Include/pyport.h -index e2bac3b..3d70b8e 100644 +index 72a157e..eecb181 100644 --- a/Include/pyport.h +++ b/Include/pyport.h -@@ -53,6 +53,44 @@ +@@ -49,6 +49,44 @@ #endif diff --git a/mingw-w64-python/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch b/mingw-w64-python/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch new file mode 100644 index 0000000000000..f8a6a38544642 --- /dev/null +++ b/mingw-w64-python/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch @@ -0,0 +1,64 @@ +From db7e6996294cc66d3f9d132267fbc64dd7b97acb Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 5 Sep 2025 15:15:15 +0300 +Subject: [PATCH 003/N] sysmodule: Implement flags "_is_mingw", + "is_mingw_ucrt" and "_use_alt_sep" + +--- + Python/sysmodule.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/Python/sysmodule.c b/Python/sysmodule.c +index 993763f..e722a59 100644 +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -177,6 +177,38 @@ PySys_GetObject(const char *name) + return value; + } + ++static int ++use_alt_sep(void) ++{ ++#ifdef MS_WINDOWS ++ char* msystem = getenv("MSYSTEM"); ++ if (msystem != NULL && strcmp(msystem, "") != 0) { ++ return 1; ++ } ++#endif ++ return 0; ++} ++ ++static int ++is_mingw(void) ++{ ++#ifdef __MINGW32__ ++ return 1; ++#else ++ return 0; ++#endif ++} ++ ++static int ++is_mingw_ucrt(void) ++{ ++#if defined(__MINGW32__) && defined(_UCRT) ++ return 1; ++#else ++ return 0; ++#endif ++} ++ + static int + sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v) + { +@@ -3622,6 +3654,10 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) + SET_SYS_FROM_STRING("byteorder", "little"); + #endif + ++ SET_SYS("_is_mingw", PyLong_FromLong(is_mingw())); ++ SET_SYS("_is_mingw_ucrt", PyLong_FromLong(is_mingw_ucrt())); ++ SET_SYS("_use_alt_sep", PyLong_FromLong(use_alt_sep())); ++ + #ifdef MS_COREDLL + SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); + SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); diff --git a/mingw-w64-python/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch b/mingw-w64-python/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch index 24a3d2aef9854..ba2742933a104 100644 --- a/mingw-w64-python/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch +++ b/mingw-w64-python/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch @@ -1,4 +1,4 @@ -From ed0ed208960ca1a9c8bf57b5440adb66a8bac2a4 Mon Sep 17 00:00:00 2001 +From bf4e84d3ca80ae916dddfbc5365871f7fd7bc594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:14 +0530 @@ -9,24 +9,24 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей --- - configure.ac | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + configure.ac | 7 +++++++ + 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac -index de008a9..d003a53 100644 +index d6f4105..93c17bd 100644 --- a/configure.ac +++ b/configure.ac -@@ -550,6 +550,9 @@ then +@@ -327,6 +327,9 @@ then *-*-cygwin*) ac_sys_system=Cygwin ;; + *-*-mingw*) + ac_sys_system=MINGW + ;; - *-*-vxworks*) - ac_sys_system=VxWorks - ;; -@@ -585,6 +588,7 @@ then + *-apple-ios*) + ac_sys_system=iOS + ;; +@@ -366,6 +369,7 @@ then linux*) MACHDEP="linux";; cygwin*) MACHDEP="cygwin";; darwin*) MACHDEP="darwin";; @@ -34,28 +34,13 @@ index de008a9..d003a53 100644 '') MACHDEP="unknown";; esac -@@ -618,6 +622,9 @@ if test "$cross_compiling" = yes; then - ;; +@@ -777,6 +781,9 @@ if test "$cross_compiling" = yes; then wasm32-*-* | wasm64-*-*) - _host_cpu=$host_cpu -+ ;; + _host_ident=$host_cpu + ;; + *-*-mingw*) + _host_cpu= - ;; ++ ;; *) # for now, limit cross builds to known configurations -@@ -625,6 +632,14 @@ if test "$cross_compiling" = yes; then - AC_MSG_ERROR([cross build not supported for $host]) - esac - _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" -+ -+ case "$host_os" in -+ mingw*) -+ # As sys.platform() return 'win32' to build python and extantions -+ # we will use 'mingw' (in setup.py and etc.) -+ _PYTHON_HOST_PLATFORM=mingw -+ ;; -+ esac - fi - - # Some systems cannot stand _XOPEN_SOURCE being defined at all; they + MACHDEP="unknown" diff --git a/mingw-w64-python/0005-Add-default-configuration-for-MINGW.patch b/mingw-w64-python/0005-build-Add-default-cross-configuration-for-MINGW.patch similarity index 82% rename from mingw-w64-python/0005-Add-default-configuration-for-MINGW.patch rename to mingw-w64-python/0005-build-Add-default-cross-configuration-for-MINGW.patch index 1595550b12c07..ca1bfe26957ae 100644 --- a/mingw-w64-python/0005-Add-default-configuration-for-MINGW.patch +++ b/mingw-w64-python/0005-build-Add-default-cross-configuration-for-MINGW.patch @@ -1,8 +1,8 @@ -From 86cc1d25993c107dc08cb92d7eedaaae27624732 Mon Sep 17 00:00:00 2001 +From fecace5b5c449170aa934632422f366000d07cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:15 +0530 -Subject: [PATCH 005/N] Add default configuration for MINGW +Subject: [PATCH 005/N] build: Add default cross configuration for MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,19 +10,19 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей Co-authored-by: Christoph Reiter --- - Misc/config_mingw | 12 ++++++++++++ + Misc/config_mingw | 15 +++++++++++++++ Misc/cross_mingw32 | 11 +++++++++++ configure.ac | 22 ++++++++++++++++++++++ - 3 files changed, 45 insertions(+) + 3 files changed, 48 insertions(+) create mode 100644 Misc/config_mingw create mode 100644 Misc/cross_mingw32 diff --git a/Misc/config_mingw b/Misc/config_mingw new file mode 100644 -index 0000000..513065d +index 0000000..8497aa2 --- /dev/null +++ b/Misc/config_mingw -@@ -0,0 +1,12 @@ +@@ -0,0 +1,15 @@ +# configure defaults for mingw* hosts + +# mingw functions to ignore @@ -35,6 +35,10 @@ index 0000000..513065d +# files to ignore +ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist +ac_cv_file__dev_ptc=no ++ ++# force detection of winsock2 functionality - require wxp or newer ++ac_cv_func_getpeername=yes +\ No newline at end of file diff --git a/Misc/cross_mingw32 b/Misc/cross_mingw32 new file mode 100644 index 0000000..03fde9e @@ -53,10 +57,10 @@ index 0000000..03fde9e + +ac_cv_have_size_t_format=no diff --git a/configure.ac b/configure.ac -index d003a53..8b11800 100644 +index 93c17bd..37f0a80 100644 --- a/configure.ac +++ b/configure.ac -@@ -1205,6 +1205,28 @@ AC_CACHE_CHECK([for -Wl,--no-as-needed], [ac_cv_wl_no_as_needed], [ +@@ -1225,6 +1225,28 @@ AC_CACHE_CHECK([for -Wl,--no-as-needed], [ac_cv_wl_no_as_needed], [ ]) AC_SUBST([NO_AS_NEEDED]) diff --git a/mingw-w64-python/0006-configure-enable-largefile-support-by-default-for-Mi.patch b/mingw-w64-python/0006-configure-enable-largefile-support-by-default-for-Mi.patch index 3a021c699255a..384ee3b803c2d 100644 --- a/mingw-w64-python/0006-configure-enable-largefile-support-by-default-for-Mi.patch +++ b/mingw-w64-python/0006-configure-enable-largefile-support-by-default-for-Mi.patch @@ -1,4 +1,4 @@ -From f3a173acb940c2d20d051351e199dd379811bd8d Mon Sep 17 00:00:00 2001 +From 4e98a13f4b6f6fac1e1679760ca4e98329dae938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:16 +0530 @@ -18,10 +18,10 @@ Co-authored-by: Christoph Reiter 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index 8b11800..6914b14 100644 +index 37f0a80..83ec790 100644 --- a/configure.ac +++ b/configure.ac -@@ -3184,6 +3184,10 @@ dnl LFS does not work with Emscripten 3.1 +@@ -3282,6 +3282,10 @@ dnl LFS does not work with Emscripten 3.1 AS_CASE([$ac_sys_system], [Emscripten], [have_largefile_support="no"] ) diff --git a/mingw-w64-python/0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch b/mingw-w64-python/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch similarity index 77% rename from mingw-w64-python/0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch rename to mingw-w64-python/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch index ed306095ad78c..f57302addc069 100644 --- a/mingw-w64-python/0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch +++ b/mingw-w64-python/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch @@ -1,8 +1,9 @@ -From 2c9f8d3885fbc3786086fbb39d4e3ef33c72b127 Mon Sep 17 00:00:00 2001 +From 4a9984ebac6a8cf93bc9fc849cac03b5dea9db80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:18 +0530 -Subject: [PATCH 007/N] Add `PC/` to `CPPFLAGS` and to `SRCDIRS` on Mingw +Subject: [PATCH 007/N] build: Add `PC/` to `CPPFLAGS` and to `SRCDIRS` on + Mingw Co-authored-by: Naveen M K --- @@ -10,10 +11,10 @@ Co-authored-by: Naveen M K 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac -index 6914b14..aeb9928 100644 +index 83ec790..2d2c485 100644 --- a/configure.ac +++ b/configure.ac -@@ -6913,6 +6913,16 @@ do +@@ -7190,6 +7190,16 @@ do THREADHEADERS="$THREADHEADERS \$(srcdir)/$h" done @@ -30,10 +31,10 @@ index 6914b14..aeb9928 100644 AC_SUBST([SRCDIRS]) SRCDIRS="\ Modules \ -@@ -6935,6 +6945,11 @@ SRCDIRS="\ +@@ -7217,6 +7227,11 @@ SRCDIRS="\ + Programs \ Python \ - Python/frozen_modules \ - Python/deepfreeze" + Python/frozen_modules" + +case $host in + *-*-mingw*) SRCDIRS="$SRCDIRS PC";; diff --git a/mingw-w64-python/0008-posixmodule.c-Define-necessary-headers-for-compiling.patch b/mingw-w64-python/0008-build-add-MINGW-support-for-posixmodule.patch similarity index 69% rename from mingw-w64-python/0008-posixmodule.c-Define-necessary-headers-for-compiling.patch rename to mingw-w64-python/0008-build-add-MINGW-support-for-posixmodule.patch index db2aad512ff1f..215a465523cc9 100644 --- a/mingw-w64-python/0008-posixmodule.c-Define-necessary-headers-for-compiling.patch +++ b/mingw-w64-python/0008-build-add-MINGW-support-for-posixmodule.patch @@ -1,9 +1,8 @@ -From 2976481933b3e7f0caf0ffeccac580f16f796ea8 Mon Sep 17 00:00:00 2001 +From a52642740a3772717a3364558dd110e0a95e79f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:19 +0530 -Subject: [PATCH 008/N] posixmodule.c: Define necessary headers for compiling - on MINGW +Subject: [PATCH 008/N] build: add MINGW support for posixmodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -15,12 +14,12 @@ Co-authored-by: Naveen M K Co-authored-by: Алексей --- Modules/Setup.bootstrap.in | 2 +- - Modules/posixmodule.c | 28 ++++++++++++++++++++++++---- + Modules/posixmodule.c | 34 ++++++++++++++++++++++++++++++---- configure.ac | 8 ++++++++ - 3 files changed, 33 insertions(+), 5 deletions(-) + 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index 8ef0f20..1f21d35 100644 +index aa4e60e..7d1929a 100644 --- a/Modules/Setup.bootstrap.in +++ b/Modules/Setup.bootstrap.in @@ -8,7 +8,7 @@ @@ -28,21 +27,27 @@ index 8ef0f20..1f21d35 100644 atexit atexitmodule.c faulthandler faulthandler.c -posix posixmodule.c -+@INITSYS@ posixmodule.c ++@MODULE_POSIXMODULE_NAME@ posixmodule.c _signal signalmodule.c _tracemalloc _tracemalloc.c - + _suggestions _suggestions.c diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index c21c6f0..1a62ddd 100644 +index 2370ac1..ea43a43 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -369,6 +369,26 @@ corresponding Unix manual entries for more information on calls."); +@@ -393,6 +393,32 @@ corresponding Unix manual entries for more information on calls."); # define HAVE_PIPE 1 # define HAVE_FSYNC 1 # define fsync _commit +#elif defined(__MINGW32__) /* GCC for windows hosts */ +/* getlogin is detected by configure on mingw-w64 */ +# undef HAVE_GETLOGIN ++/* opendir is detected by configure on mingw-w64, and for some reason ++things don't work as expected. For example, os.listdir always returns ++the cwd's directory listing instead of the one specified. By ++un-defining, this, os.listdir will use the one which uses native ++windows API. */ ++# undef HAVE_OPENDIR +/*# define HAVE_GETCWD 1 - detected by configure*/ +# define HAVE_GETPPID 1 +# define HAVE_GETLOGIN 1 @@ -63,7 +68,7 @@ index c21c6f0..1a62ddd 100644 #endif /* ! __WATCOMC__ || __QNX__ */ /*[clinic input] -@@ -446,7 +466,7 @@ extern char *ctermid_r(char *); +@@ -470,7 +496,7 @@ extern char *ctermid_r(char *); # endif #endif @@ -72,7 +77,7 @@ index c21c6f0..1a62ddd 100644 # ifdef HAVE_DIRECT_H # include # endif -@@ -457,7 +477,7 @@ extern char *ctermid_r(char *); +@@ -481,7 +507,7 @@ extern char *ctermid_r(char *); # include # endif # include @@ -81,10 +86,10 @@ index c21c6f0..1a62ddd 100644 #ifndef MAXPATHLEN # if defined(PATH_MAX) && PATH_MAX > 1024 -@@ -1594,9 +1614,9 @@ error: - ** man environ(7). +@@ -1653,9 +1679,9 @@ error: */ #include + #define USE_DARWIN_NS_GET_ENVIRON 1 -#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__)) +#elif !defined(MS_WINDOWS) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__)) extern char **environ; @@ -94,20 +99,20 @@ index c21c6f0..1a62ddd 100644 static PyObject * convertenviron(void) diff --git a/configure.ac b/configure.ac -index aeb9928..1bc4974 100644 +index 2d2c485..2484712 100644 --- a/configure.ac +++ b/configure.ac -@@ -755,6 +755,14 @@ then +@@ -908,6 +908,14 @@ then [Define to include mbstate_t for mbrtowc]) fi -+AC_MSG_CHECKING([for init system calls]) -+AC_SUBST(INITSYS) ++AC_MSG_CHECKING([for posixmodule name]) ++AC_SUBST(MODULE_POSIXMODULE_NAME) +case $host in -+ *-*-mingw*) INITSYS=nt;; -+ *) INITSYS=posix;; ++ *-*-mingw*) MODULE_POSIXMODULE_NAME=nt;; ++ *) MODULE_POSIXMODULE_NAME=posix;; +esac -+AC_MSG_RESULT([$INITSYS]) ++AC_MSG_RESULT([$MODULE_POSIXMODULE_NAME]) + # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils diff --git a/mingw-w64-python/0009-Build-winreg-by-default-when-compiling-for-MINGW.patch b/mingw-w64-python/0009-Build-winreg-by-default-when-compiling-for-MINGW.patch deleted file mode 100644 index e43097ca22240..0000000000000 --- a/mingw-w64-python/0009-Build-winreg-by-default-when-compiling-for-MINGW.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 4ef3c6fcfc1828ee86c646438e5ab2fd52cabb64 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:20 +0530 -Subject: [PATCH 009/N] Build winreg by default when compiling for MINGW -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей -Co-authored-by: Christoph Reiter -Co-authored-by: Naveen M K ---- - Modules/Setup.bootstrap.in | 3 +++ - PC/winreg.c | 19 +++++++++++++++++++ - configure.ac | 7 +++++++ - 3 files changed, 29 insertions(+) - -diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index 1f21d35..3def7e8 100644 ---- a/Modules/Setup.bootstrap.in -+++ b/Modules/Setup.bootstrap.in -@@ -34,3 +34,6 @@ _symtable symtablemodule.c - - # for systems without $HOME env, used by site._getuserbase() - @MODULE_PWD_TRUE@pwd pwdmodule.c -+ -+# build-in modules for windows platform: -+@USE_WIN32_MODULE@winreg ../PC/winreg.c -diff --git a/PC/winreg.c b/PC/winreg.c -index e2d5322..368291d 100644 ---- a/PC/winreg.c -+++ b/PC/winreg.c -@@ -19,6 +19,25 @@ - #include "structmember.h" // PyMemberDef - #include - -+#ifndef SIZEOF_HKEY -+/* used only here */ -+#if defined(MS_WIN64) -+# define SIZEOF_HKEY 8 -+#elif defined(MS_WIN32) -+# define SIZEOF_HKEY 4 -+#else -+# error "SIZEOF_HKEY is not defined" -+#endif -+#endif -+ -+#ifndef REG_LEGAL_CHANGE_FILTER -+#define REG_LEGAL_CHANGE_FILTER (\ -+ REG_NOTIFY_CHANGE_NAME |\ -+ REG_NOTIFY_CHANGE_ATTRIBUTES |\ -+ REG_NOTIFY_CHANGE_LAST_SET |\ -+ REG_NOTIFY_CHANGE_SECURITY ) -+#endif -+ - #if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES) - - typedef struct { -diff --git a/configure.ac b/configure.ac -index 1bc4974..c2b1e6c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4487,6 +4487,13 @@ done - IFS=$as_save_IFS - AC_MSG_RESULT([$DBM_CFLAGS $DBM_LIBS]) - -+# Determine if windows modules should be used. -+AC_SUBST(USE_WIN32_MODULE) -+USE_WIN32_MODULE='#' -+case $host in -+ *-*-mingw*) USE_WIN32_MODULE=;; -+esac -+ - # Templates for things AC_DEFINEd more than once. - # For a single AC_DEFINE, no template is needed. - AH_TEMPLATE([_REENTRANT], diff --git a/mingw-w64-python/0010-pyport.h-Add-support-for-MINGW.patch b/mingw-w64-python/0009-exports.h-Add-support-for-MINGW.patch similarity index 85% rename from mingw-w64-python/0010-pyport.h-Add-support-for-MINGW.patch rename to mingw-w64-python/0009-exports.h-Add-support-for-MINGW.patch index 892d47b4f6954..2259658944ff0 100644 --- a/mingw-w64-python/0010-pyport.h-Add-support-for-MINGW.patch +++ b/mingw-w64-python/0009-exports.h-Add-support-for-MINGW.patch @@ -1,22 +1,22 @@ -From 6e8327cc3ab0167278f8ca0c69c5e9309f4275c7 Mon Sep 17 00:00:00 2001 +From c78b5b09af35d9ac549e9c4986e56c5e4546e500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:23 +0530 -Subject: [PATCH 010/N] pyport.h: Add support for MINGW +Subject: [PATCH 009/N] exports.h: Add support for MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Алексей --- - Include/pyport.h | 20 +++++++++++--------- + Include/exports.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) -diff --git a/Include/pyport.h b/Include/pyport.h -index 3d70b8e..ddff496 100644 ---- a/Include/pyport.h -+++ b/Include/pyport.h -@@ -532,12 +532,12 @@ extern char * _getpty(int *, int, mode_t, int); +diff --git a/Include/exports.h b/Include/exports.h +index ce60121..2840241 100644 +--- a/Include/exports.h ++++ b/Include/exports.h +@@ -15,12 +15,12 @@ */ /* @@ -32,7 +32,7 @@ index 3d70b8e..ddff496 100644 # define HAVE_DECLSPEC_DLL #endif -@@ -550,21 +550,23 @@ extern char * _getpty(int *, int, mode_t, int); +@@ -63,21 +63,23 @@ # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE /* module init functions inside the core need no external linkage */ diff --git a/mingw-w64-python/0010-configure-add-options-so-that-shared-build-is-possib.patch b/mingw-w64-python/0010-configure-add-options-so-that-shared-build-is-possib.patch new file mode 100644 index 0000000000000..169d22f682747 --- /dev/null +++ b/mingw-w64-python/0010-configure-add-options-so-that-shared-build-is-possib.patch @@ -0,0 +1,74 @@ +From 285c589f52ee5238c910d9e106ae56c4b3efc63d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= + +Date: Thu, 17 Jun 2021 18:51:24 +0530 +Subject: [PATCH 010/N] configure: add options so that shared build is + possible on MINGW + +Co-authored-by: Naveen M K +--- + configure.ac | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 2484712..add4419 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1584,6 +1584,11 @@ if test $enable_shared = "yes"; then + BLDLIBRARY='-L. -lpython$(LDVERSION)' + DLLLIBRARY='libpython$(LDVERSION).dll' + ;; ++ MINGW*) ++ LDLIBRARY='libpython$(LDVERSION).dll.a' ++ DLLLIBRARY='libpython$(LDVERSION).dll' ++ BLDLIBRARY='-L. -lpython$(LDVERSION)' ++ ;; + SunOS*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' +@@ -1643,6 +1648,9 @@ else # shared is disabled + BLDLIBRARY='$(LIBRARY)' + LDLIBRARY='libpython$(LDVERSION).dll.a' + ;; ++ MINGW*) ++ LDLIBRARY='libpython$(LDVERSION).a' ++ ;; + esac + fi + AC_MSG_RESULT([$LDLIBRARY]) +@@ -3648,6 +3656,10 @@ then + CYGWIN*) + LDSHARED="gcc -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; ++ MINGW*) ++ LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base' ++ LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base' ++ ;; + *) LDSHARED="ld";; + esac + fi +@@ -6454,7 +6466,7 @@ MODULE_DEPS_SHARED='$(MODULE_DEPS_STATIC) $(EXPORTSYMS)' + LIBPYTHON='' + + # On Android and Cygwin the shared libraries must be linked with libpython. +-if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then ++if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin" || test "$MACHDEP" = "win32"); then + MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)" + LIBPYTHON="\$(BLDLIBRARY)" + fi +@@ -7248,6 +7260,15 @@ for dir in $SRCDIRS; do + done + AC_MSG_RESULT([done]) + ++# For mingw build need additional library for linking ++case $host in ++ *-*-mingw*) ++ LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt" ++ ;; ++ *) ++ ;; ++esac ++ + # Availability of -O2: + AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [ + saved_cflags="$CFLAGS" diff --git a/mingw-w64-python/0011-build-Add-PYD_PLATFORM_TAG.patch b/mingw-w64-python/0011-build-Add-PYD_PLATFORM_TAG.patch new file mode 100644 index 0000000000000..a05c943ed1522 --- /dev/null +++ b/mingw-w64-python/0011-build-Add-PYD_PLATFORM_TAG.patch @@ -0,0 +1,100 @@ +From 68b7545dc3bd0f83e5f79d23643b18a7b1122bb6 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 6 Jan 2026 12:11:05 +0100 +Subject: [PATCH 011/N] build: Add PYD_PLATFORM_TAG + +Add PYD_PLATFORM_TAG to distinguish C extensions built with different +MinGW toolchain configurations. The tag follows the format: + mingw___ + +Where: +- cpu_arch: x86_64, i686, aarch64, or armv7 +- c_runtime: ucrt or msvcrt +- toolchain: gnu or llvm + +This prevents loading extensions built with incompatible configurations. + +Co-authored-by: Naveen M K +--- + Makefile.pre.in | 1 + + configure.ac | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index a7dc970..dd91a4c 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -166,6 +166,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) + # Symbols used for using shared libraries + SHLIB_SUFFIX= @SHLIB_SUFFIX@ + EXT_SUFFIX= @EXT_SUFFIX@ ++PYD_PLATFORM_TAG = @PYD_PLATFORM_TAG@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) + BLDSHARED= @BLDSHARED@ $(PY_CORE_LDFLAGS) + LDCXXSHARED= @LDCXXSHARED@ $(PY_LDFLAGS) +diff --git a/configure.ac b/configure.ac +index add4419..0ce6f6d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6416,6 +6416,61 @@ esac + # check for endianness + AC_C_BIGENDIAN + ++AC_SUBST(PYD_PLATFORM_TAG) ++# Special case of PYD_PLATFORM_TAG with python build with mingw. ++# Python can with different cpu arch and c runtime as well as different ++# toolchain. We follow this`mingw___` ++# convention for PYD_PLATFORM_TAG. Where: ++# `cpu_arch` = `x86_64`, `aarch64` or `i686` ++# `c_runtime` = `msvcrt` or `ucrt` ++# `toolchain` = `gnu` or `llvm` ++PYD_PLATFORM_TAG="" ++case $host in ++ *-*-mingw*) ++ # check if we are linking to ucrt ++ AC_MSG_CHECKING(whether linking to ucrt) ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ++ #include ++ #ifndef _UCRT ++ #error no ucrt ++ #endif ++ int main(){ return 0; } ++ ]])],[linking_to_ucrt=yes],[linking_to_ucrt=no]) ++ AC_MSG_RESULT($linking_to_ucrt) ++ ;; ++esac ++case $host_os in ++ mingw*) ++ AC_MSG_CHECKING(PYD_PLATFORM_TAG) ++ PYD_PLATFORM_TAG="mingw" ++ case $host in ++ i686-*-mingw*) ++ PYD_PLATFORM_TAG+="_i686" ++ ;; ++ x86_64-*-mingw*) ++ PYD_PLATFORM_TAG+="_x86_64" ++ ;; ++ aarch64-*-mingw*) ++ PYD_PLATFORM_TAG+="_aarch64" ++ ;; ++ armv7-*-mingw*) ++ PYD_PLATFORM_TAG+="_armv7" ++ ;; ++ esac ++ if test $linking_to_ucrt = no; then ++ PYD_PLATFORM_TAG+="_msvcrt" ++ else ++ PYD_PLATFORM_TAG+="_ucrt" ++ fi ++ if test -n "${cc_is_clang}"; then ++ # it is CLANG32 ++ PYD_PLATFORM_TAG+="_llvm" ++ else ++ PYD_PLATFORM_TAG+="_gnu" ++ fi ++ AC_MSG_RESULT($PYD_PLATFORM_TAG) ++esac ++ + # ABI version string for Python extension modules. This appears between the + # periods in shared library file names, e.g. foo..so. It is calculated + # from the following attributes which affect the ABI of this Python build (in diff --git a/mingw-w64-python/0011-configure-add-options-so-that-shared-build-is-possib.patch b/mingw-w64-python/0011-configure-add-options-so-that-shared-build-is-possib.patch deleted file mode 100644 index 65af800933e85..0000000000000 --- a/mingw-w64-python/0011-configure-add-options-so-that-shared-build-is-possib.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0ff5f856a38d56035957951b1457715858c6b0ab Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:24 +0530 -Subject: [PATCH 011/N] configure: add options so that shared build is - possible on MINGW - -Co-authored-by: Naveen M K ---- - configure.ac | 15 ++++++++++++++- - 1 file changed, 14 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index c2b1e6c..d4e8b5f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1552,6 +1552,11 @@ if test $enable_shared = "yes"; then - LDLIBRARY='libpython$(LDVERSION).dll.a' - DLLLIBRARY='libpython$(LDVERSION).dll' - ;; -+ MINGW*) -+ LDLIBRARY='libpython$(LDVERSION).dll.a' -+ DLLLIBRARY='libpython$(LDVERSION).dll' -+ BLDLIBRARY='-L. -lpython$(LDVERSION)' -+ ;; - SunOS*) - LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' -@@ -1602,6 +1607,9 @@ else # shared is disabled - BLDLIBRARY='$(LIBRARY)' - LDLIBRARY='libpython$(LDVERSION).dll.a' - ;; -+ MINGW*) -+ LDLIBRARY='libpython$(LDVERSION).a' -+ ;; - esac - fi - -@@ -3545,6 +3553,10 @@ then - CYGWIN*) - LDSHARED="gcc -shared -Wl,--enable-auto-image-base" - LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; -+ MINGW*) -+ LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base' -+ LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base' -+ ;; - *) LDSHARED="ld";; - esac - fi -@@ -6934,7 +6946,8 @@ case $host in - dnl "errmap.h" from $srcdir/PC. - dnl Note we cannot use BASECPPFLAGS as autogenerated pyconfig.h - dnl has to be before customized located in ../PC. -- CPPFLAGS="-I\$(srcdir)/PC $CPPFLAGS" -+ dnl (-I. at end is workaround for setup.py logic) -+ CPPFLAGS="-I\$(srcdir)/PC $CPPFLAGS -I." - ;; - esac - diff --git a/mingw-w64-python/0012-Add-dynamic-loading-support-for-MINGW.patch b/mingw-w64-python/0012-Add-dynamic-loading-support-for-MINGW.patch deleted file mode 100644 index f070ce4bd99c3..0000000000000 --- a/mingw-w64-python/0012-Add-dynamic-loading-support-for-MINGW.patch +++ /dev/null @@ -1,101 +0,0 @@ -From e5719bec6bd661f18c1200b38997b5c5df39b521 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:25 +0530 -Subject: [PATCH 012/N] Add dynamic loading support for MINGW -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Makefile.pre.in | 6 ++++++ - Python/dynload_win.c | 9 +++++++-- - configure.ac | 16 ++++++++++++++++ - 3 files changed, 29 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 7ca3dc6..2d8145f 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1378,6 +1378,12 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile - -DSHLIB_EXT='"$(EXT_SUFFIX)"' \ - -o $@ $(srcdir)/Python/dynload_hpux.c - -+Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile -+ $(CC) -c $(PY_CORE_CFLAGS) \ -+ -DSHLIB_SUFFIX='"$(SHLIB_SUFFIX)"' \ -+ -DEXT_SUFFIX='"$(EXT_SUFFIX)"' \ -+ -o $@ $(srcdir)/Python/dynload_win.c -+ - Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h - $(CC) -c $(PY_CORE_CFLAGS) \ - -DABIFLAGS='"$(ABIFLAGS)"' \ -diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index acab05e..4bb90ba 100644 ---- a/Python/dynload_win.c -+++ b/Python/dynload_win.c -@@ -29,6 +29,12 @@ - #define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd" - - const char *_PyImport_DynLoadFiletab[] = { -+#ifdef EXT_SUFFIX -+ EXT_SUFFIX, /* include SOABI flags where is encoded debug */ -+#endif -+#ifdef SHLIB_SUFFIX -+ "-abi" PYTHON_ABI_STRING SHLIB_SUFFIX, -+#endif - PYD_TAGGED_SUFFIX, - PYD_UNTAGGED_SUFFIX, - NULL -@@ -251,8 +257,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, - ensure DLLs adjacent to the PYD are preferred. */ - Py_BEGIN_ALLOW_THREADS - hDLL = LoadLibraryExW(wpathname, NULL, -- LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | -- LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); -+ LOAD_WITH_ALTERED_SEARCH_PATH); - Py_END_ALLOW_THREADS - PyMem_Free(wpathname); - -diff --git a/configure.ac b/configure.ac -index d4e8b5f..1863fa8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3424,6 +3424,9 @@ if test -z "$SHLIB_SUFFIX"; then - CYGWIN*) SHLIB_SUFFIX=.dll;; - *) SHLIB_SUFFIX=.so;; - esac -+ case $host_os in -+ mingw*) SHLIB_SUFFIX=.dll;; -+ esac - fi - AC_MSG_RESULT([$SHLIB_SUFFIX]) - -@@ -5036,6 +5039,13 @@ then - fi - ;; - esac -+ case $host in -+ *-*-mingw*) -+ DYNLOADFILE="dynload_win.o" -+ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"'" -+ ;; -+ esac - fi - AC_MSG_RESULT([$DYNLOADFILE]) - if test "$DYNLOADFILE" != "dynload_stub.o" -@@ -6925,6 +6935,12 @@ case "$ac_cv_computed_gotos" in yes*) - AC_DEFINE([HAVE_COMPUTED_GOTOS], [1], - [Define if the C compiler supports computed gotos.]) - esac -+case $host_os in -+ mingw*) -+ dnl Synchronized with _PyImport_DynLoadFiletab (dynload_win.c) -+ dnl Do not use more then one dot on this platform ! -+ EXT_SUFFIX=-$SOABI$SHLIB_SUFFIX;; -+esac - - case $ac_sys_system in - AIX*) diff --git a/mingw-w64-python/0012-build-Add-dynload_win-support-for-MinGW.patch b/mingw-w64-python/0012-build-Add-dynload_win-support-for-MinGW.patch new file mode 100644 index 0000000000000..928ac9a914185 --- /dev/null +++ b/mingw-w64-python/0012-build-Add-dynload_win-support-for-MinGW.patch @@ -0,0 +1,48 @@ +From 5ab5893f00c4b2b74bb39f528ffaae791b594ca2 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 6 Jan 2026 12:45:54 +0100 +Subject: [PATCH 012/N] build: Add dynload_win support for MinGW +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Makefile.pre.in | 6 ++++++ + configure.ac | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index dd91a4c..190d71f 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1738,6 +1738,12 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile + -DSHLIB_EXT='"$(EXT_SUFFIX)"' \ + -o $@ $(srcdir)/Python/dynload_hpux.c + ++Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile ++ $(CC) -c $(PY_CORE_CFLAGS) \ ++ -DPYD_PLATFORM_TAG='"$(PYD_PLATFORM_TAG)"' \ ++ -DPY3_DLLNAME='L"$(DLLLIBRARY)"' \ ++ -o $@ $(srcdir)/Python/dynload_win.c ++ + Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h + $(CC) -c $(PY_CORE_CFLAGS) \ + -DABIFLAGS='"$(ABIFLAGS)"' \ +diff --git a/configure.ac b/configure.ac +index 0ce6f6d..c8dabee 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5294,6 +5294,12 @@ then + fi + ;; + esac ++ case $host in ++ *-*-mingw*) ++ DYNLOADFILE="dynload_win.o" ++ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" ++ ;; ++ esac + fi + AC_MSG_RESULT([$DYNLOADFILE]) + if test "$DYNLOADFILE" != "dynload_stub.o" diff --git a/mingw-w64-python/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch b/mingw-w64-python/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch new file mode 100644 index 0000000000000..92466deccb2ff --- /dev/null +++ b/mingw-w64-python/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch @@ -0,0 +1,40 @@ +From 99b3b83de273cc01fe1ab1f7197410c5371e4e50 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 6 Jan 2026 13:00:33 +0100 +Subject: [PATCH 013/N] build: Use .pyd extension suffix + fix import lib + install location + +--- + Makefile.pre.in | 4 ++-- + configure.ac | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 190d71f..0b45c88 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2697,8 +2697,8 @@ libainstall: all scripts + @if test "$(STATIC_LIBPYTHON)" = 1; then \ + if test -d $(LIBRARY); then :; else \ + if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ +- if test "$(SHLIB_SUFFIX)" = .dll; then \ +- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ ++ if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \ ++ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \ + else \ + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ + fi; \ +diff --git a/configure.ac b/configure.ac +index c8dabee..c935d1a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3522,6 +3522,9 @@ if test -z "$SHLIB_SUFFIX"; then + CYGWIN*) SHLIB_SUFFIX=.dll;; + *) SHLIB_SUFFIX=.so;; + esac ++ case $host_os in ++ mingw*) SHLIB_SUFFIX=.pyd;; ++ esac + fi + AC_MSG_RESULT([$SHLIB_SUFFIX]) + diff --git a/mingw-w64-python/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch b/mingw-w64-python/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch new file mode 100644 index 0000000000000..2d73b3de021ce --- /dev/null +++ b/mingw-w64-python/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch @@ -0,0 +1,52 @@ +From 65e6e89dfe5778a06e2c0ce8c6943db04c2d3395 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 6 Jan 2026 13:01:46 +0100 +Subject: [PATCH 014/N] build: Configure SOABI and EXT_SUFFIX for MINGW + +Try to match the format defined in pycore_importdl.h for Windows +--- + configure.ac | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c935d1a..622bd54 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6500,7 +6500,10 @@ AC_SUBST([SOABI]) + AC_MSG_CHECKING([ABIFLAGS]) + AC_MSG_RESULT([$ABIFLAGS]) + AC_MSG_CHECKING([SOABI]) +-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM} ++case $host_os in ++ mingw*) SOABI='cp'`echo $VERSION | tr -d .`${ABI_THREAD}-${PYD_PLATFORM_TAG};; ++ *) SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM};; ++esac + AC_MSG_RESULT([$SOABI]) + + # Release build, debug build (Py_DEBUG), and trace refs build (Py_TRACE_REFS) +@@ -6508,13 +6511,23 @@ AC_MSG_RESULT([$SOABI]) + if test "$Py_DEBUG" = 'true'; then + # Similar to SOABI but remove "d" flag from ABIFLAGS + AC_SUBST([ALT_SOABI]) +- ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_PLATFORM} ++ case $host_os in ++ mingw*) ALT_SOABI='cp'`echo $VERSION | tr -d .`${ABI_THREAD}-${PYD_PLATFORM_TAG};; ++ *) ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_PLATFORM};; ++ esac + AC_DEFINE_UNQUOTED([ALT_SOABI], ["${ALT_SOABI}"], + [Alternative SOABI used in debug build to load C extensions built in release mode]) + fi + + AC_SUBST([EXT_SUFFIX]) +-EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} ++PYD_DEBUG_SUFFIX="" ++if test "$Py_DEBUG" = "true"; then ++ PYD_DEBUG_SUFFIX="_d" ++fi ++case $host_os in ++ mingw*) EXT_SUFFIX=${PYD_DEBUG_SUFFIX}.${SOABI}${SHLIB_SUFFIX};; ++ *) EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; ++esac + + AC_MSG_CHECKING([LDVERSION]) + LDVERSION='$(VERSION)$(ABIFLAGS)' diff --git a/mingw-w64-python/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch b/mingw-w64-python/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch new file mode 100644 index 0000000000000..f324f56c12a59 --- /dev/null +++ b/mingw-w64-python/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch @@ -0,0 +1,41 @@ +From 98f1de1c6146e4fc6d75f83c4ee79544819f146d Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Tue, 6 Jan 2026 13:02:49 +0100 +Subject: [PATCH 015/N] build: Define MS_DLL_ID for sys.winver on MINGW + +MS_DLL_ID is used for sys.winver and Windows registry keys +--- + configure.ac | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 622bd54..a619e27 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5311,6 +5311,26 @@ then + [Defined when any dynamic module loading is enabled.]) + fi + ++# MS_DLL_ID is used for sys.winver and Windows registry keys. ++case $host in ++*-*-mingw*) ++ case $host in ++ i686*) ++ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-32\"'" ++ ;; ++ armv7*) ++ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm32\"'" ++ ;; ++ aarch64*) ++ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm64\"'" ++ ;; ++ *) ++ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"'" ++ ;; ++ esac ++ ;; ++esac ++ + # MACHDEP_OBJS can be set to platform-specific object files needed by Python + + AC_SUBST([MACHDEP_OBJS]) diff --git a/mingw-w64-python/0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch b/mingw-w64-python/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch similarity index 76% rename from mingw-w64-python/0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch rename to mingw-w64-python/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch index 5fea9102ca27a..2a705cbed2c07 100644 --- a/mingw-w64-python/0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch +++ b/mingw-w64-python/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch @@ -1,8 +1,9 @@ -From 69c4541a733021fda321c89f62888837df875ee0 Mon Sep 17 00:00:00 2001 +From 3b78858a14ae0bc04d22ab5cce3a9f2a18bb7d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:26 +0530 -Subject: [PATCH 013/N] Ignore main program for frozen scripts on MINGW +Subject: [PATCH 016/N] build: Ignore main program for frozen scripts on + MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,23 +15,23 @@ Co-authored-by: Алексей 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 2d8145f..5e005b6 100644 +index 0b45c88..b7b170b 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -383,7 +383,7 @@ PYTHON_OBJS= \ +@@ -432,7 +432,7 @@ PYTHON_OBJS= \ Python/errors.o \ Python/flowgraph.o \ Python/frame.o \ - Python/frozenmain.o \ + @PYTHON_OBJS_FROZENMAIN@ \ Python/future.o \ - Python/getargs.o \ - Python/getcompiler.o \ + Python/gc.o \ + Python/gc_free_threading.o \ diff --git a/configure.ac b/configure.ac -index 1863fa8..e03f864 100644 +index a619e27..81e53d5 100644 --- a/configure.ac +++ b/configure.ac -@@ -6967,6 +6967,16 @@ case $host in +@@ -7317,6 +7317,16 @@ case $host in ;; esac diff --git a/mingw-w64-python/0016-sysconfig-MINGW-build-extensions-with-GCC.patch b/mingw-w64-python/0016-sysconfig-MINGW-build-extensions-with-GCC.patch deleted file mode 100644 index cb6b241d87280..0000000000000 --- a/mingw-w64-python/0016-sysconfig-MINGW-build-extensions-with-GCC.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 407fcf09da49361208465a55b78f4a61233d2b61 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Tue, 21 Sep 2021 20:52:42 +0200 -Subject: [PATCH 016/N] sysconfig: MINGW build extensions with GCC - ---- - Lib/sysconfig.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 7a7c0e2..ed24aeb 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -800,6 +800,8 @@ def get_platform(): - - """ - if os.name == 'nt': -+ if 'GCC' in sys.version: -+ return 'mingw' - if 'amd64' in sys.version.lower(): - return 'win-amd64' - if '(arm)' in sys.version.lower(): diff --git a/mingw-w64-python/0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch b/mingw-w64-python/0017-socketmodule-add-MINGW-support.patch similarity index 70% rename from mingw-w64-python/0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch rename to mingw-w64-python/0017-socketmodule-add-MINGW-support.patch index 3a8039e304ed3..0e08d1018a17b 100644 --- a/mingw-w64-python/0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch +++ b/mingw-w64-python/0017-socketmodule-add-MINGW-support.patch @@ -1,8 +1,8 @@ -From 477ada14d309018f034a77cc313d4012701cc87d Mon Sep 17 00:00:00 2001 +From 9920835a8476400504b251e62d758a25c0a17e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:30 +0530 -Subject: [PATCH 014/N] Detect winsock2 and setup _socket module on MINGW +Subject: [PATCH 017/N] socketmodule: add MINGW support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,25 +10,14 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей Co-authored-by: Naveen M K --- - Misc/config_mingw | 3 +++ - Modules/socketmodule.c | 6 ++++++ + Modules/socketmodule.c | 4 +++- + Modules/socketmodule.h | 2 ++ configure.ac | 38 ++++++++++++++++++++++++++++++++------ pyconfig.h.in | 4 ++-- - 4 files changed, 43 insertions(+), 8 deletions(-) + 4 files changed, 39 insertions(+), 9 deletions(-) -diff --git a/Misc/config_mingw b/Misc/config_mingw -index 513065d..9be43fd 100644 ---- a/Misc/config_mingw -+++ b/Misc/config_mingw -@@ -10,3 +10,6 @@ ac_cv_func_alarm=ignore - # files to ignore - ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist - ac_cv_file__dev_ptc=no -+ -+# force detection of winsock2 functionality - require wxp or newer -+ac_cv_func_getpeername=yes diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 27afd73..7038e10 100644 +index edc79c9..687594a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -282,6 +282,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\ @@ -47,24 +36,37 @@ index 27afd73..7038e10 100644 /* Provides the IsWindows7SP1OrGreater() function */ #include -@@ -426,6 +428,10 @@ remove_unusable_flags(PyObject *m) +@@ -416,7 +418,7 @@ remove_unusable_flags(PyObject *m) + * _SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21, + * for example, but not by 6.5.10. + */ +-#elif defined(_MSC_VER) && _MSC_VER>1201 ++#elif (defined(_MSC_VER) && _MSC_VER>1201) || defined(__MINGW32__) /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and * EAI_* constants are defined in (the already included) ws2tcpip.h. */ -+#elif defined(__MINGW32__) -+ /* Do not include addrinfo.h as minimum supported version is -+ * _WIN32_WINNT >= WindowsXP(0x0501) -+ */ - #else - # include "addrinfo.h" - #endif +diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h +index 8480590..e2387c2 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -68,8 +68,10 @@ struct SOCKADDR_BTH_REDEF { + */ + # ifdef SIO_GET_MULTICAST_FILTER + # include /* for SIO_RCVALL */ ++#ifndef __MINGW32__ /* resolve by configure */ + # define HAVE_ADDRINFO + # define HAVE_SOCKADDR_STORAGE ++#endif + # define HAVE_GETADDRINFO + # define HAVE_GETNAMEINFO + # define ENABLE_IPV6 diff --git a/configure.ac b/configure.ac -index e03f864..37554f7 100644 +index 81e53d5..bf91394 100644 --- a/configure.ac +++ b/configure.ac -@@ -4188,6 +4188,12 @@ AS_CASE([$ac_sys_system], - [OSSAUDIODEV_LIBS=""] - ) +@@ -4397,6 +4397,12 @@ AC_SUBST([LIBMPDEC_CFLAGS]) + AC_SUBST([LIBMPDEC_INTERNAL]) + +dnl On MINGW, you need to link against ws2_32 and iphlpapi for sockets to work +AS_CASE([$MACHDEP], @@ -75,7 +77,7 @@ index e03f864..37554f7 100644 dnl detect sqlite3 from Emscripten emport PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3]) -@@ -5651,18 +5657,33 @@ if test $ac_cv_header_time_altzone = yes; then +@@ -5949,18 +5955,33 @@ if test $ac_cv_header_time_altzone = yes; then [Define this if your time.h defines altzone.]) fi @@ -113,20 +115,19 @@ index e03f864..37554f7 100644 [ac_cv_struct_sockaddr_storage=yes], [ac_cv_struct_sockaddr_storage=no])) if test $ac_cv_struct_sockaddr_storage = yes; then -@@ -6855,8 +6876,11 @@ AC_CHECK_TYPE( - [socklen_t], [], - [AC_DEFINE( - [socklen_t], [int], -- [Define to `int' if does not define.] -+ [Define to `int' if or does not define.] - )], [ +@@ -7213,7 +7234,10 @@ fi + + AC_CHECK_TYPES([socklen_t], [], + [AC_DEFINE([socklen_t], [int], +- [Define to 'int' if does not define.])], [ ++ [Define to `int' if or does not define.])], [ +#ifdef HAVE_WS2TCPIP_H +#include +#endif #ifdef HAVE_SYS_TYPES_H #include #endif -@@ -7665,7 +7689,9 @@ PY_STDLIB_MOD([mmap], +@@ -8072,7 +8096,9 @@ PY_STDLIB_MOD([mmap], PY_STDLIB_MOD([_socket], [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes" -a "$ac_cv_header_sys_types_h" = "yes" @@ -136,9 +137,9 @@ index e03f864..37554f7 100644 + [], [$SOCKET_LIBS]) dnl platform specific extensions - PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes]) + PY_STDLIB_MOD([grp], [], diff --git a/pyconfig.h.in b/pyconfig.h.in -index b359e13..398b64f 100644 +index 60daba7..483f922 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -59,7 +59,7 @@ @@ -150,11 +151,11 @@ index b359e13..398b64f 100644 #undef HAVE_ADDRINFO /* Define to 1 if you have the `alarm' function. */ -@@ -1926,7 +1926,7 @@ +@@ -2016,7 +2016,7 @@ /* Define to `unsigned int' if does not define. */ #undef size_t --/* Define to `int' if does not define. */ +-/* Define to 'int' if does not define. */ +/* Define to `int' if or does not define. */ #undef socklen_t diff --git a/mingw-w64-python/0015-Enable-some-windows-specific-modules.patch b/mingw-w64-python/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch similarity index 68% rename from mingw-w64-python/0015-Enable-some-windows-specific-modules.patch rename to mingw-w64-python/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch index 6b360e2cb6223..78e9a8f1d46b5 100644 --- a/mingw-w64-python/0015-Enable-some-windows-specific-modules.patch +++ b/mingw-w64-python/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch @@ -1,32 +1,36 @@ -From d7e39c2227c85d0c66af905ede2ec320451feded Mon Sep 17 00:00:00 2001 +From 0a3dfa6793008845b061c743e956f8659716e123 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 14 Feb 2023 20:40:42 +0530 -Subject: [PATCH 015/N] Enable some windows specific modules +Subject: [PATCH 018/N] build: enable winreg, msvcrt, _winapi, winsound and + _overlapped modules --- - Modules/Setup.bootstrap.in | 2 ++ - Modules/Setup.stdlib.in | 7 +++++++ - Modules/_winapi.c | 2 ++ - PC/msvcrtmodule.c | 2 ++ - Python/dynamic_annotations.c | 2 +- - configure.ac | 10 ++++++++++ - 6 files changed, 24 insertions(+), 1 deletion(-) + Modules/Setup.bootstrap.in | 5 +++++ + Modules/Setup.stdlib.in | 6 ++++++ + Modules/_winapi.c | 2 ++ + PC/msvcrtmodule.c | 2 ++ + Python/dynamic_annotations.c | 2 +- + configure.ac | 9 +++++++++ + 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index 3def7e8..d8b41ee 100644 +index 7d1929a..0ea9b25 100644 --- a/Modules/Setup.bootstrap.in +++ b/Modules/Setup.bootstrap.in -@@ -37,3 +37,5 @@ _symtable symtablemodule.c +@@ -36,3 +36,8 @@ _symtable symtablemodule.c - # build-in modules for windows platform: - @USE_WIN32_MODULE@winreg ../PC/winreg.c + # for systems without $HOME env, used by site._getuserbase() + @MODULE_PWD_TRUE@pwd pwdmodule.c ++ ++# build-in modules for windows platform: ++@MODULE_WINREG_TRUE@winreg ../PC/winreg.c +@MODULE_MSVCRT_TRUE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c +@MODULE__WINAPI_TRUE@_winapi _winapi.c diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in -index 5e587dd..98e3ef2 100644 +index 57b9010..c0ee182 100644 --- a/Modules/Setup.stdlib.in +++ b/Modules/Setup.stdlib.in -@@ -160,6 +160,13 @@ +@@ -155,6 +155,12 @@ # _scproxy needs SystemConfiguration and CoreFoundation framework @MODULE__SCPROXY_TRUE@_scproxy _scproxy.c @@ -34,17 +38,16 @@ index 5e587dd..98e3ef2 100644 +# Windows specific modules + +@MODULE__OVERLAPPED_TRUE@_overlapped overlapped.c -+@MODULE__MSI_TRUE@_msi ../PC/_msi.c +@MODULE_WINSOUND_TRUE@winsound ../PC/winsound.c + ############################################################################ # Test modules diff --git a/Modules/_winapi.c b/Modules/_winapi.c -index ac3ee11..b5d1468 100644 +index d51586e..3c2eb81 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c -@@ -44,7 +44,9 @@ +@@ -46,7 +46,9 @@ #endif #include "windows.h" #include @@ -55,7 +58,7 @@ index ac3ee11..b5d1468 100644 #if defined(MS_WIN32) && !defined(MS_WIN64) diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c -index 53ef26b..10cf782 100644 +index b170e06..b4c3f92 100644 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -22,7 +22,9 @@ @@ -82,23 +85,22 @@ index 7febaa0..70d5b3d 100644 #endif diff --git a/configure.ac b/configure.ac -index 37554f7..8ccec5e 100644 +index bf91394..addcfae 100644 --- a/configure.ac +++ b/configure.ac -@@ -7791,6 +7791,16 @@ PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_working_openssl_ssl" = yes], +@@ -8192,6 +8192,15 @@ PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_working_openssl_ssl" = yes], PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes], [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS]) +dnl windows specific modules ++PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"]) +PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"]) +PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"]) -+PY_STDLIB_MOD([_msi], [test "$MACHDEP" = "win32"], [], [], -+ [-lmsi -lcabinet -lrpcrt4]) +PY_STDLIB_MOD([winsound], [test "$MACHDEP" = "win32"], [], [], + [-lwinmm]) +PY_STDLIB_MOD([_overlapped], [test "$MACHDEP" = "win32"], [], [], + [-lws2_32]) + dnl test modules - PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes]) - PY_STDLIB_MOD([_testclinic], [test "$TEST_MODULES" = yes]) + PY_STDLIB_MOD([_testcapi], + [test "$TEST_MODULES" = yes], diff --git a/mingw-w64-python/0019-Customize-site-for-MINGW.patch b/mingw-w64-python/0019-Customize-site-for-MINGW.patch deleted file mode 100644 index d6c54e086dc2a..0000000000000 --- a/mingw-w64-python/0019-Customize-site-for-MINGW.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 877eab86d815bb4e0ae5395aaa4933e77eb1ef51 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:42 +0530 -Subject: [PATCH 019/N] Customize site for MINGW -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей -Co-authored-by: Christoph Reiter ---- - Lib/site.py | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/Lib/site.py b/Lib/site.py -index aed254a..fadfccf 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -89,6 +89,12 @@ USER_SITE = None - USER_BASE = None - - -+# Same as defined in Lib/sysconfig.py -+# redeclared since sysconfig is large for site. -+# GCC[mingw*] use posix build system -+_POSIX_BUILD = os.name == 'posix' or \ -+ (os.name == "nt" and 'GCC' in sys.version) -+ - def _trace(message): - if sys.flags.verbose: - print(message, file=sys.stderr) -@@ -294,7 +300,7 @@ def _getuserbase(): - def joinuser(*args): - return os.path.expanduser(os.path.join(*args)) - -- if os.name == "nt": -+ if os.name == "nt" and not _POSIX_BUILD: - base = os.environ.get("APPDATA") or "~" - return joinuser(base, "Python") - -@@ -309,7 +315,7 @@ def _getuserbase(): - def _get_path(userbase): - version = sys.version_info - -- if os.name == 'nt': -+ if os.name == 'nt' and not _POSIX_BUILD: - ver_nodot = sys.winver.replace('.', '') - return f'{userbase}\\Python{ver_nodot}\\site-packages' - -@@ -382,7 +388,7 @@ def getsitepackages(prefixes=None): - continue - seen.add(prefix) - -- if os.sep == '/': -+ if _POSIX_BUILD: - libdirs = [sys.platlibdir] - if sys.platlibdir != "lib": - libdirs.append("lib") diff --git a/mingw-w64-python/0001-sysconfig-make-_sysconfigdata.py-relocatable.patch b/mingw-w64-python/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch similarity index 67% rename from mingw-w64-python/0001-sysconfig-make-_sysconfigdata.py-relocatable.patch rename to mingw-w64-python/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch index d33de45c8fa81..0e777b50fc67b 100644 --- a/mingw-w64-python/0001-sysconfig-make-_sysconfigdata.py-relocatable.patch +++ b/mingw-w64-python/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch @@ -1,7 +1,7 @@ -From 3820da317a89366417e09b3d357e12badfde543f Mon Sep 17 00:00:00 2001 +From 83381f218491955e3a17a521cadc835905434a74 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Thu, 17 Jun 2021 18:51:10 +0530 -Subject: [PATCH 001/N] sysconfig: make _sysconfigdata.py relocatable +Subject: [PATCH 019/N] sysconfig: make _sysconfigdata.py relocatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9,22 +9,21 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей Co-authored-by: lovetox <8661218+lovetox@users.noreply.github.com> --- - Lib/sysconfig.py | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) + Lib/sysconfig/__main__.py | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index acc8d4d..7a7c0e2 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -2,6 +2,7 @@ - +diff --git a/Lib/sysconfig/__main__.py b/Lib/sysconfig/__main__.py +index d7257b9..ae15229 100644 +--- a/Lib/sysconfig/__main__.py ++++ b/Lib/sysconfig/__main__.py +@@ -1,5 +1,6 @@ import os import sys +import textwrap - import threading - from os.path import realpath - -@@ -524,11 +525,30 @@ def _generate_posix_vars(): + from sysconfig import ( + _ALWAYS_STR, + _PYTHON_BUILD, +@@ -209,11 +210,32 @@ def _generate_posix_vars(): os.makedirs(pybuilddir, exist_ok=True) destfile = os.path.join(pybuilddir, name + '.py') @@ -35,10 +34,12 @@ index acc8d4d..7a7c0e2 100644 + 'INCLDIRSTOMAKE', 'INCLUDEDIR', 'INCLUDEPY', + 'LIBDEST', 'LIBDIR', 'LIBPC', 'LIBPL', 'MACHDESTLIB', + 'MANDIR', 'SCRIPTDIR', 'datarootdir', 'exec_prefix', -+ 'TZPATH', ++ 'TZPATH', 'AR', 'EXENAME', 'LLVM_PROF_MERGER', ++ 'VENVLAUNCHERDIR', + ] + + prefix = build_time_vars['BINDIR'][:-4] ++ build_time_vars['prefix'] = sys.base_prefix + + for key in keys_to_replace: + value = build_time_vars[key] @@ -50,7 +51,7 @@ index acc8d4d..7a7c0e2 100644 f.write('# system configuration generated and used by' ' the sysconfig module\n') f.write('build_time_vars = ') - pprint.pprint(vars, stream=f) + _print_config_dict(vars, stream=f) + f.write('\n%s' % textwrap.dedent(replacement)) # Create file used for sys.path fixup -- see Modules/getpath.c diff --git a/mingw-w64-python/0020-add-python-config-sh.patch b/mingw-w64-python/0020-add-python-config-sh.patch deleted file mode 100644 index 9cbd5eb112a62..0000000000000 --- a/mingw-w64-python/0020-add-python-config-sh.patch +++ /dev/null @@ -1,159 +0,0 @@ -From dcf5c715547953f7d1e2cae6b939e2b2880b580f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:43 +0530 -Subject: [PATCH 020/N] add python config sh -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей -Co-authored-by: Christoph Reiter ---- - Misc/python-config.sh.in | 62 +++++++++++++++++++++++++--------------- - 1 file changed, 39 insertions(+), 23 deletions(-) - -diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in -index 2602fe2..195c317 100644 ---- a/Misc/python-config.sh.in -+++ b/Misc/python-config.sh.in -@@ -1,32 +1,44 @@ - #!/bin/sh - --# Keep this script in sync with python-config.in -- - exit_with_usage () - { - echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed" -- exit $1 -+ exit 1 - } - -+# Really, python-config.py (and thus .sh) should be called directly, but -+# sometimes software (e.g. GDB) calls python-config.sh as if it were the -+# Python executable, passing python-config.py as the first argument. -+# Work around that oddness by ignoring any .py passed as first arg. -+case "$1" in -+ *.py) -+ shift -+ ;; -+esac -+ - if [ "$1" = "" ] ; then -- exit_with_usage 1 -+ exit_with_usage - fi - - # Returns the actual prefix where this script was installed to. - installed_prefix () - { -- RESULT=$(dirname $(cd $(dirname "$1") && pwd -P)) -- if which readlink >/dev/null 2>&1 ; then -- if readlink -f "$RESULT" >/dev/null 2>&1; then -- RESULT=$(readlink -f "$RESULT") -- fi -+ local RESULT=$(dirname $(cd $(dirname "$1") && pwd -P)) -+ if [ $(which readlink) ] ; then -+ RESULT=$(readlink -f "$RESULT") -+ fi -+ # Since we don't know where the output from this script will end up -+ # we keep all paths in Windows-land since MSYS2 can handle that -+ # while native tools can't handle paths in MSYS2-land. -+ if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] ; then -+ RESULT=$(cd "$RESULT" && pwd -W) - fi - echo $RESULT - } - - prefix_real=$(installed_prefix "$0") - --# Use sed to fix paths from their built-to locations to their installed-to -+# Use sed to fix paths from their built-to locations to their installed to - # locations. Keep prefix & exec_prefix using their original values in case - # they are referenced in other configure variables, to prevent double - # substitution, issue #22140. -@@ -41,13 +53,17 @@ LIBM="@LIBM@" - LIBC="@LIBC@" - SYSLIBS="$LIBM $LIBC" - ABIFLAGS="@ABIFLAGS@" -+# Protect against lack of substitution. -+if [ "$ABIFLAGS" = "@""ABIFLAGS""@" ] ; then -+ ABIFLAGS= -+fi - LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS" - LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS" - BASECFLAGS="@BASECFLAGS@" --LDLIBRARY="@LDLIBRARY@" - OPT="@OPT@" - PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" - LDVERSION="@LDVERSION@" -+LDLIBRARY="@LDLIBRARY@" - LIBDEST=${prefix_real}/lib/python${VERSION} - LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#") - SO="@EXT_SUFFIX@" -@@ -61,7 +77,7 @@ for ARG in $* - do - case $ARG in - --help) -- exit_with_usage 0 -+ exit_with_usage - ;; - --embed) - PY_EMBED=1 -@@ -69,7 +85,7 @@ do - --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir) - ;; - *) -- exit_with_usage 1 -+ exit_with_usage - ;; - esac - done -@@ -80,37 +96,37 @@ fi - - for ARG in "$@" - do -- case "$ARG" in -+ case $ARG in - --prefix) -- echo "$prefix_real" -+ echo -ne "$prefix_real" - ;; - --exec-prefix) -- echo "$exec_prefix_real" -+ echo -ne "$exec_prefix_real " - ;; - --includes) -- echo "$INCDIR $PLATINCDIR" -+ echo -ne "$INCDIR $PLATINCDIR" - ;; - --cflags) -- echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT" -+ echo -ne "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT" - ;; - --libs) -- echo "$LIBS" -+ echo -ne "$LIBS" - ;; - --ldflags) - LIBPLUSED= - if [ "$PY_ENABLE_SHARED" = "0" ] ; then - LIBPLUSED="-L$LIBPL" - fi -- echo "$LIBPLUSED -L$libdir $LIBS" -+ echo -ne "$LIBPLUSED -L$libdir $LIBS " - ;; - --extension-suffix) -- echo "$SO" -+ echo -ne "$SO " - ;; - --abiflags) -- echo "$ABIFLAGS" -+ echo -ne "$ABIFLAGS " - ;; - --configdir) -- echo "$LIBPL" -+ echo -ne "$LIBPL " - ;; - esac - done diff --git a/mingw-w64-python/0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch b/mingw-w64-python/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch similarity index 57% rename from mingw-w64-python/0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch rename to mingw-w64-python/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch index 1f3b41a823fad..744ec267e76b2 100644 --- a/mingw-w64-python/0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch +++ b/mingw-w64-python/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch @@ -1,8 +1,8 @@ -From d6665e5343d10e45decec51da0c8e052087a10f1 Mon Sep 17 00:00:00 2001 +From fb852cfc0f8f37d711b2fc66a8613a553a77a28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:38 +0530 -Subject: [PATCH 017/N] sysconfig: treat MINGW builds as POSIX builds +Subject: [PATCH 020/N] sysconfig: treat MINGW builds as POSIX builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,79 +10,68 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей Co-authored-by: Naveen M K --- - Lib/sysconfig.py | 19 ++++++++++++------- - 1 file changed, 12 insertions(+), 7 deletions(-) + Lib/sysconfig/__init__.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index ed24aeb..e05a67d 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -99,13 +99,18 @@ _INSTALL_SCHEMES = { - }, +diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py +index f7bd675..3bf214a 100644 +--- a/Lib/sysconfig/__init__.py ++++ b/Lib/sysconfig/__init__.py +@@ -101,7 +101,7 @@ _INSTALL_SCHEMES = { } -+# GCC[mingw*] use posix build system -+_POSIX_BUILD = os.name == 'posix' or \ -+ (os.name == "nt" and 'GCC' in sys.version) -+ # For the OS-native venv scheme, we essentially provide an alias: -if os.name == 'nt': -+if os.name == 'nt' and not _POSIX_BUILD: ++if os.name == 'nt' and not sys._is_mingw: _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['nt_venv'] else: _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv'] - - -+ - # NOTE: site.py has copy of this function. - # Sync it when modify this function. - def _getuserbase(): -@@ -120,7 +125,7 @@ def _getuserbase(): +@@ -123,7 +123,7 @@ def _getuserbase(): def joinuser(*args): return os.path.expanduser(os.path.join(*args)) - if os.name == "nt": -+ if os.name == "nt" and not _POSIX_BUILD: ++ if os.name == "nt" and not sys._is_mingw: base = os.environ.get("APPDATA") or "~" - return joinuser(base, "Python") + return joinuser(base, _get_implementation()) -@@ -288,7 +293,7 @@ def _expand_vars(scheme, vars): +@@ -285,7 +285,7 @@ def _expand_vars(scheme, vars): def _get_preferred_schemes(): - if os.name == 'nt': -+ if os.name == 'nt' and not _POSIX_BUILD: ++ if os.name == 'nt' and not sys._is_mingw: return { 'prefix': 'nt', 'home': 'posix_home', -@@ -622,7 +627,7 @@ def parse_config_h(fp, vars=None): +@@ -426,7 +426,7 @@ def parse_config_h(fp, vars=None): def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: - if os.name == "nt": -+ if os.name == "nt" and not _POSIX_BUILD: - inc_dir = os.path.join(_PROJECT_BASE, "PC") ++ if os.name == "nt" and not sys._is_mingw: + inc_dir = os.path.dirname(sys._base_executable) else: inc_dir = _PROJECT_BASE -@@ -690,10 +695,10 @@ def _init_config_vars(): +@@ -496,10 +496,10 @@ def _init_config_vars(): except AttributeError: _CONFIG_VARS['py_version_nodot_plat'] = '' - if os.name == 'nt': -+ if os.name == 'nt' and not _POSIX_BUILD: ++ if os.name == 'nt' and not sys._is_mingw: _init_non_posix(_CONFIG_VARS) _CONFIG_VARS['VPATH'] = sys._vpath - if os.name == 'posix': -+ if _POSIX_BUILD: ++ if os.name == 'posix' or sys._is_mingw: _init_posix(_CONFIG_VARS) if _HAS_USER_BASE: # Setting 'userbase' is done below the call to the -@@ -703,7 +708,7 @@ def _init_config_vars(): +@@ -512,7 +512,7 @@ def _init_config_vars(): # Always convert srcdir to an absolute path srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) - if os.name == 'posix': -+ if _POSIX_BUILD: ++ if os.name == 'posix' or sys._is_mingw: if _PYTHON_BUILD: # If srcdir is a relative path (typically '.' or '..') # then it should be interpreted relative to the directory diff --git a/mingw-w64-python/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch b/mingw-w64-python/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch new file mode 100644 index 0000000000000..f0d11fe12320a --- /dev/null +++ b/mingw-w64-python/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch @@ -0,0 +1,55 @@ +From b5f5d5474cd9c5ab6c1603c78d289c92141ae2fa Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Tue, 21 Sep 2021 21:36:58 +0200 +Subject: [PATCH 021/N] sysconfig: Change the `get_platform()` method in + sysconfig + +This would possibly fix building wheels when mingw python +is used and would be unique to each python same as EXT_SUFFIX. + +Signed-off-by: Naveen M K +--- + Lib/sysconfig/__init__.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py +index 3bf214a..20e18ae 100644 +--- a/Lib/sysconfig/__init__.py ++++ b/Lib/sysconfig/__init__.py +@@ -586,6 +586,7 @@ def get_config_var(name): + return get_config_vars().get(name) + + ++# make sure to change site._get_platform() when changing this function + def get_platform(): + """Return a string that identifies the current platform. + +@@ -613,6 +614,28 @@ def get_platform(): + + For other non-POSIX platforms, currently just returns :data:`sys.platform`.""" + if os.name == 'nt': ++ if sys._is_mingw: ++ platform = 'mingw' ++ if 'amd64' in sys.version.lower(): ++ platform += '_x86_64' ++ elif 'arm64' in sys.version.lower(): ++ platform += '_aarch64' ++ elif 'arm' in sys.version.lower(): ++ platform += '_armv7' ++ else: ++ platform += '_i686' ++ ++ if 'ucrt' in sys.version.lower(): ++ platform += '_ucrt' ++ else: ++ platform += "_msvcrt" ++ ++ if 'clang' in sys.version.lower(): ++ platform += "_llvm" ++ else: ++ platform += "_gnu" ++ ++ return platform + if 'amd64' in sys.version.lower(): + return 'win-amd64' + if '(arm)' in sys.version.lower(): diff --git a/mingw-w64-python/0022-msys-cygwin-semi-native-build-sysconfig.patch b/mingw-w64-python/0022-build-semi-native-build-sysconfig.patch similarity index 73% rename from mingw-w64-python/0022-msys-cygwin-semi-native-build-sysconfig.patch rename to mingw-w64-python/0022-build-semi-native-build-sysconfig.patch index 0de49daf4ce2b..5992154c9ba8b 100644 --- a/mingw-w64-python/0022-msys-cygwin-semi-native-build-sysconfig.patch +++ b/mingw-w64-python/0022-build-semi-native-build-sysconfig.patch @@ -1,24 +1,25 @@ -From 3c642b927b9f71071aff679f299a84f8803f19d1 Mon Sep 17 00:00:00 2001 +From 0998afd2034dc3a9deea76e03a58c98a376f9ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:50 +0530 -Subject: [PATCH 022/N] msys cygwin semi native build sysconfig +Subject: [PATCH 022/N] build: semi native build sysconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Алексей +Co-authored-by: Naveen M K --- - Lib/sysconfig.py | 8 +++++++ - Makefile.pre.in | 7 ++++++ - configure.ac | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 74 insertions(+) + Lib/sysconfig/__main__.py | 8 ++++++ + Makefile.pre.in | 6 +++++ + configure.ac | 51 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 65 insertions(+) -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index e05a67d..60626d2 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -451,6 +451,14 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True): +diff --git a/Lib/sysconfig/__main__.py b/Lib/sysconfig/__main__.py +index ae15229..4eee7e0 100644 +--- a/Lib/sysconfig/__main__.py ++++ b/Lib/sysconfig/__main__.py +@@ -146,6 +146,14 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True): if isinstance(v, str): done[k] = v.strip() @@ -34,16 +35,15 @@ index e05a67d..60626d2 100644 vars.update(done) return vars diff --git a/Makefile.pre.in b/Makefile.pre.in -index 5e005b6..63ca7ad 100644 +index b7b170b..3eafdd3 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -142,6 +142,13 @@ exec_prefix= @exec_prefix@ +@@ -144,6 +144,12 @@ exec_prefix= @exec_prefix@ # Install prefix for data files datarootdir= @datarootdir@ +# Locations needed for semi-native fixup of sysconfig. +srcdir_b2h= @srcdir_b2h@ -+VPATH_b2h= @VPATH_b2h@ +abs_srcdir_b2h= @abs_srcdir_b2h@ +abs_builddir_b2h= @abs_builddir_b2h@ +prefix_b2h= @prefix_b2h@ @@ -52,10 +52,10 @@ index 5e005b6..63ca7ad 100644 BINDIR= @bindir@ LIBDIR= @libdir@ diff --git a/configure.ac b/configure.ac -index 8ccec5e..c8407ad 100644 +index addcfae..ea8799e 100644 --- a/configure.ac +++ b/configure.ac -@@ -755,6 +755,65 @@ then +@@ -908,6 +908,57 @@ then [Define to include mbstate_t for mbrtowc]) fi @@ -65,12 +65,8 @@ index 8ccec5e..c8407ad 100644 +# without setting up the same env and also that the build of Python +# itself will fail as the paths are not correct for the host tools. +# -+# Also, getpath.c uses GetModuleFileNameW (replacing \ with /) and -+# compares that with the define VPATH (passed in via command-line) -+# to determine whether it's the build- or the installed-Python. -+# +# To work around these issues a set of _b2h variables are created: -+# VPATH_b2h, prefix_b2h, srcdir_b2h, abs_srcdir_b2h ++# prefix_b2h, srcdir_b2h, abs_srcdir_b2h +# and abs_builddir_b2h +# .. where b2h stands for build to host. sysconfig.py replaces path +# prefixes matching the non-b2h versions with the b2h equivalents. @@ -97,10 +93,6 @@ index 8ccec5e..c8407ad 100644 +AC_SUBST([$1]) +]) + -+AC_MSG_CHECKING(absolute host location of VPATH) -+ABS_PATH_HOST([VPATH_b2h],[srcdir]) -+AC_MSG_RESULT([$VPATH_b2h]) -+ +AC_MSG_CHECKING(absolute host location of prefix) +ABS_PATH_HOST([prefix_b2h],[prefix]) +AC_MSG_RESULT([$prefix_b2h]) @@ -118,6 +110,6 @@ index 8ccec5e..c8407ad 100644 +ABS_PATH_HOST([abs_builddir_b2h],[my_builddir]) +AC_MSG_RESULT([$abs_builddir_b2h]) + - AC_MSG_CHECKING([for init system calls]) - AC_SUBST(INITSYS) + AC_MSG_CHECKING([for posixmodule name]) + AC_SUBST(MODULE_POSIXMODULE_NAME) case $host in diff --git a/mingw-w64-python/0018-Add-support-for-stdcall-without-underscore.patch b/mingw-w64-python/0023-ctypes-Add-support-for-stdcall-without-underscore.patch similarity index 86% rename from mingw-w64-python/0018-Add-support-for-stdcall-without-underscore.patch rename to mingw-w64-python/0023-ctypes-Add-support-for-stdcall-without-underscore.patch index 6ea9e7bfd55b6..54d7067f5aff8 100644 --- a/mingw-w64-python/0018-Add-support-for-stdcall-without-underscore.patch +++ b/mingw-w64-python/0023-ctypes-Add-support-for-stdcall-without-underscore.patch @@ -1,8 +1,8 @@ -From 2b1bb2c6dac4899eb9fc97c6914760c3fa413795 Mon Sep 17 00:00:00 2001 +From bdedb0d30eed8d88ae1b12935deecb9559eebfdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:39 +0530 -Subject: [PATCH 018/N] Add support for stdcall without underscore +Subject: [PATCH 023/N] ctypes: Add support for stdcall without underscore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -15,10 +15,10 @@ Co-authored-by: Алексей 1 file changed, 19 insertions(+) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c -index d3b4968..c208223 100644 +index ad088b0..bb1846b 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c -@@ -3416,6 +3416,18 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) +@@ -3568,6 +3568,18 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */ if (!mangled_name) return NULL; @@ -37,7 +37,7 @@ index d3b4968..c208223 100644 for (i = 0; i < 32; ++i) { sprintf(mangled_name, "_%s@%d", name, i*4); Py_BEGIN_ALLOW_THREADS -@@ -3423,6 +3435,13 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) +@@ -3575,6 +3587,13 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) Py_END_ALLOW_THREADS if (address) return address; diff --git a/mingw-w64-python/0023-sysconfig-mingw-sysconfig-like-posix.patch b/mingw-w64-python/0023-sysconfig-mingw-sysconfig-like-posix.patch deleted file mode 100644 index db15c9355c796..0000000000000 --- a/mingw-w64-python/0023-sysconfig-mingw-sysconfig-like-posix.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 6b8582b407c6da357e41cd85c34c8b1affa7631d Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Tue, 21 Sep 2021 20:53:59 +0200 -Subject: [PATCH 023/N] sysconfig: mingw sysconfig like posix - ---- - Lib/sysconfig.py | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) - -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 60626d2..a0e07b9 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -49,13 +49,13 @@ _INSTALL_SCHEMES = { - 'data': '{base}', - }, - 'nt': { -- 'stdlib': '{installed_base}/Lib', -- 'platstdlib': '{base}/Lib', -- 'purelib': '{base}/Lib/site-packages', -- 'platlib': '{base}/Lib/site-packages', -- 'include': '{installed_base}/Include', -- 'platinclude': '{installed_base}/Include', -- 'scripts': '{base}/Scripts', -+ 'stdlib': '{installed_base}/lib/python{py_version_short}', -+ 'platstdlib': '{base}/lib/python{py_version_short}', -+ 'purelib': '{base}/lib/python{py_version_short}/site-packages', -+ 'platlib': '{base}/lib/python{py_version_short}/site-packages', -+ 'include': '{installed_base}/include/python{py_version_short}', -+ 'platinclude': '{installed_base}/include/python{py_version_short}', -+ 'scripts': '{base}/bin', - 'data': '{base}', - }, - # Downstream distributors can overwrite the default install scheme. -@@ -141,12 +141,12 @@ if _HAS_USER_BASE: - _INSTALL_SCHEMES |= { - # NOTE: When modifying "purelib" scheme, update site._get_path() too. - 'nt_user': { -- 'stdlib': '{userbase}/Python{py_version_nodot_plat}', -- 'platstdlib': '{userbase}/Python{py_version_nodot_plat}', -- 'purelib': '{userbase}/Python{py_version_nodot_plat}/site-packages', -- 'platlib': '{userbase}/Python{py_version_nodot_plat}/site-packages', -- 'include': '{userbase}/Python{py_version_nodot_plat}/Include', -- 'scripts': '{userbase}/Python{py_version_nodot_plat}/Scripts', -+ 'stdlib': '{userbase}/lib/python{py_version_short}', -+ 'platstdlib': '{userbase}/lib/python{py_version_short}', -+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', -+ 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', -+ 'include': '{userbase}/include/python{py_version_short}', -+ 'scripts': '{userbase}/bin', - 'data': '{userbase}', - }, - 'posix_user': { -@@ -589,7 +589,7 @@ def _init_non_posix(vars): - except IndexError: - pass - vars['EXE'] = '.exe' -- vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT -+ vars['VERSION'] = _PY_VERSION_SHORT - vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) - vars['TZPATH'] = '' - diff --git a/mingw-w64-python/0028-ctypes-python-dll.patch b/mingw-w64-python/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch similarity index 67% rename from mingw-w64-python/0028-ctypes-python-dll.patch rename to mingw-w64-python/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch index 63c6ae02359ad..5809fcd1d3c0c 100644 --- a/mingw-w64-python/0028-ctypes-python-dll.patch +++ b/mingw-w64-python/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch @@ -1,8 +1,8 @@ -From 893831ac31d5fccb8310e4f7e85cfaa49b9ba8bf Mon Sep 17 00:00:00 2001 +From 6657f9ea5027750510b1b6a0e4ed655641dd6168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:52:01 +0530 -Subject: [PATCH 028/N] ctypes python dll +Subject: [PATCH 024/N] ctypes: add suppor for ctypes.pythonapi under MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,17 +14,17 @@ Co-authored-by: Christoph Reiter 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py -index 6cedee7..7fceeb8 100644 +index 80651dc..d690777 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py -@@ -464,7 +464,9 @@ class LibraryLoader(object): +@@ -484,7 +484,9 @@ class LibraryLoader(object): cdll = LibraryLoader(CDLL) pydll = LibraryLoader(PyDLL) -if _os.name == "nt": -+if _os.name == "nt" and _sys.version.find('GCC') >= 0: ++if _os.name == "nt" and _sys._is_mingw: + pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None) +elif _os.name == "nt": pythonapi = PyDLL("python dll", None, _sys.dllhandle) - elif _sys.platform == "cygwin": - pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) + elif _sys.platform in ["android", "cygwin"]: + # These are Unix-like platforms which use a dynamically-linked libpython. diff --git a/mingw-w64-python/0024-mingw-use-backslashes-in-compileall-py.patch b/mingw-w64-python/0024-mingw-use-backslashes-in-compileall-py.patch deleted file mode 100644 index 168ff322aefcd..0000000000000 --- a/mingw-w64-python/0024-mingw-use-backslashes-in-compileall-py.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e6dd88b08f0491726146d4b4bfa3c1405aa91a37 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:53 +0530 -Subject: [PATCH 024/N] mingw use backslashes in compileall py -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Lib/compileall.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Lib/compileall.py b/Lib/compileall.py -index d394156..ef3633e 100644 ---- a/Lib/compileall.py -+++ b/Lib/compileall.py -@@ -38,6 +38,8 @@ def _walk_dir(dir, maxlevels, quiet=0): - if name == '__pycache__': - continue - fullname = os.path.join(dir, name) -+ if sys.platform == "win32" and sys.version.find("GCC") >= 0: -+ fullname = fullname.replace('\\','/') - if not os.path.isdir(fullname): - yield fullname - elif (maxlevels > 0 and name != os.curdir and name != os.pardir and diff --git a/mingw-w64-python/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch b/mingw-w64-python/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch new file mode 100644 index 0000000000000..863becb5a3c51 --- /dev/null +++ b/mingw-w64-python/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch @@ -0,0 +1,26 @@ +From 62097ebdf6f7d5d4eb291a4032db6670493c7371 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 23 Jul 2021 18:23:58 +0200 +Subject: [PATCH 025/N] ctypes: find_library('c') should return None with + ucrt + +Just like with MSVC. This fixes a test in test_ctypes. +--- + Lib/ctypes/util.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 117bf06..d480336 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -54,6 +54,10 @@ if os.name == "nt": + + def find_library(name): + if name in ('c', 'm'): ++ if sys._is_mingw: ++ if sys._is_mingw_ucrt: ++ return None ++ return 'msvcrt.dll' + return find_msvcrt() + # See MSDN for the REAL search order. + for directory in os.environ['PATH'].split(os.pathsep): diff --git a/mingw-w64-python/0025-mingw-pdcurses_ISPAD.patch b/mingw-w64-python/0025-mingw-pdcurses_ISPAD.patch deleted file mode 100644 index 7874031358f76..0000000000000 --- a/mingw-w64-python/0025-mingw-pdcurses_ISPAD.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1b0d7fda75368dcee7d5450672eb4ae718861d02 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:51:55 +0530 -Subject: [PATCH 025/N] mingw pdcurses_ISPAD -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Include/py_curses.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/Include/py_curses.h b/Include/py_curses.h -index e46b08e..34228fb 100644 ---- a/Include/py_curses.h -+++ b/Include/py_curses.h -@@ -36,6 +36,13 @@ - #include - #endif - -+#if defined(__MINGW32__) -+#include -+#if !defined(_ISPAD) -+#define _ISPAD 0x10 -+#endif -+#endif -+ - #ifdef HAVE_NCURSES_H - /* configure was checking , but we will - use , which has some or all these features. */ diff --git a/mingw-w64-python/0026-site-Customize-for-MINGW.patch b/mingw-w64-python/0026-site-Customize-for-MINGW.patch new file mode 100644 index 0000000000000..16132d5318e4d --- /dev/null +++ b/mingw-w64-python/0026-site-Customize-for-MINGW.patch @@ -0,0 +1,55 @@ +From 63805260bb5885937fcf49863c77b39724e8137d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= + +Date: Thu, 17 Jun 2021 18:51:42 +0530 +Subject: [PATCH 026/N] site: Customize for MINGW +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Lib/site.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Lib/site.py b/Lib/site.py +index 041dca1..b87f05c 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -299,7 +299,7 @@ def _getuserbase(): + def joinuser(*args): + return os.path.expanduser(os.path.join(*args)) + +- if os.name == "nt": ++ if os.name == "nt" and not sys._is_mingw: + base = os.environ.get("APPDATA") or "~" + return joinuser(base, _get_implementation()) + +@@ -320,7 +320,7 @@ def _get_path(userbase): + + implementation = _get_implementation() + implementation_lower = implementation.lower() +- if os.name == 'nt': ++ if os.name == 'nt' and not sys._is_mingw: + ver_nodot = sys.winver.replace('.', '') + return f'{userbase}\\{implementation}{ver_nodot}\\site-packages' + +@@ -399,7 +399,7 @@ def getsitepackages(prefixes=None): + abi_thread = 't' + else: + abi_thread = '' +- if os.sep == '/': ++ if os.name == 'posix' or sys._is_mingw: + libdirs = [sys.platlibdir] + if sys.platlibdir != "lib": + libdirs.append("lib") +@@ -430,7 +430,7 @@ def setquit(): + The repr of each object contains a hint at how it works. + + """ +- if os.sep == '\\': ++ if sys.platform == 'win32': + eof = 'Ctrl-Z plus Return' + else: + eof = 'Ctrl-D (i.e. EOF)' diff --git a/mingw-w64-python/0027-site-Change-user-site-packages-path-to-include-the-e.patch b/mingw-w64-python/0027-site-Change-user-site-packages-path-to-include-the-e.patch new file mode 100644 index 0000000000000..3e8c32b0343c4 --- /dev/null +++ b/mingw-w64-python/0027-site-Change-user-site-packages-path-to-include-the-e.patch @@ -0,0 +1,101 @@ +From 468712d39838b44c88c819be0fc5809e5f87a804 Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Wed, 19 Jan 2022 20:01:45 +0530 +Subject: [PATCH 027/N] site: Change user site-packages path to include the + environment info + +This should avoid mixing of user site-packages between python +from various environments. Previously, the user site-packages +should be located at `~/.local/lib/python3.12` for all environment +including 32-bits variants which caused problems with 64-bit trying to +load 32-bit extensions. Now this path will be changed to +`~/.local/lib/python3.12-`, for example, in +CLANG64 this would be `~/.local/lib/python3.12-mingw_x86_64_ucrt_llvm`. + +Fixes https://github.com/msys2-contrib/cpython-mingw/issues/40 +--- + Lib/site.py | 31 ++++++++++++++++++++++++++++++- + Lib/sysconfig/__init__.py | 14 +++++++++----- + 2 files changed, 39 insertions(+), 6 deletions(-) + +diff --git a/Lib/site.py b/Lib/site.py +index b87f05c..939f45a 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -309,6 +309,32 @@ def _getuserbase(): + + return joinuser("~", ".local") + ++# Copy of sysconfig.get_platform() but only for MinGW ++def _get_platform(): ++ if os.name == 'nt': ++ if sys._is_mingw: ++ platform = 'mingw' ++ if 'amd64' in sys.version.lower(): ++ platform += '_x86_64' ++ elif 'arm64' in sys.version.lower(): ++ platform += '_aarch64' ++ elif 'arm' in sys.version.lower(): ++ platform += '_armv7' ++ else: ++ platform += '_i686' ++ ++ if 'ucrt' in sys.version.lower(): ++ platform += '_ucrt' ++ else: ++ platform += "_msvcrt" ++ ++ if 'clang' in sys.version.lower(): ++ platform += "_llvm" ++ else: ++ platform += "_gnu" ++ ++ return platform ++ return sys.platform + + # Same to sysconfig.get_path('purelib', os.name+'_user') + def _get_path(userbase): +@@ -320,7 +346,10 @@ def _get_path(userbase): + + implementation = _get_implementation() + implementation_lower = implementation.lower() +- if os.name == 'nt' and not sys._is_mingw: ++ if os.name == 'nt': ++ if sys._is_mingw: ++ return f'{userbase}/lib/{implementation_lower}{version[0]}.{version[1]}-{_get_platform()}{abi_thread}/site-packages' ++ + ver_nodot = sys.winver.replace('.', '') + return f'{userbase}\\{implementation}{ver_nodot}\\site-packages' + +diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py +index 20e18ae..fb40ef6 100644 +--- a/Lib/sysconfig/__init__.py ++++ b/Lib/sysconfig/__init__.py +@@ -148,11 +148,11 @@ if _HAS_USER_BASE: + 'data': '{userbase}', + }, + 'posix_user': { +- 'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}', +- 'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}', +- 'purelib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages', +- 'platlib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages', +- 'include': '{userbase}/include/{implementation_lower}{py_version_short}{abi_thread}', ++ 'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short_plat}{abi_thread}', ++ 'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short_plat}{abi_thread}', ++ 'purelib': '{userbase}/lib/{implementation_lower}{py_version_short_plat}{abi_thread}/site-packages', ++ 'platlib': '{userbase}/lib/{implementation_lower}{py_version_short_plat}{abi_thread}/site-packages', ++ 'include': '{userbase}/include/{implementation_lower}{py_version_short_plat}{abi_thread}', + 'scripts': '{userbase}/bin', + 'data': '{userbase}', + }, +@@ -495,6 +495,10 @@ def _init_config_vars(): + _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '') + except AttributeError: + _CONFIG_VARS['py_version_nodot_plat'] = '' ++ if os.name == 'nt' and sys._is_mingw: ++ _CONFIG_VARS['py_version_short_plat'] = f'{_PY_VERSION_SHORT}-{get_platform()}' ++ else: ++ _CONFIG_VARS['py_version_short_plat'] = _PY_VERSION_SHORT + + if os.name == 'nt' and not sys._is_mingw: + _init_non_posix(_CONFIG_VARS) diff --git a/mingw-w64-python/0028-python-config-output-Windows-paths-for-the-shell-var.patch b/mingw-w64-python/0028-python-config-output-Windows-paths-for-the-shell-var.patch new file mode 100644 index 0000000000000..ea60a756b2d82 --- /dev/null +++ b/mingw-w64-python/0028-python-config-output-Windows-paths-for-the-shell-var.patch @@ -0,0 +1,33 @@ +From d2bca23dd225bbee7609b039e3e24fda15beb28f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= + +Date: Thu, 17 Jun 2021 18:51:43 +0530 +Subject: [PATCH 028/N] python-config: output Windows paths for the shell + variant +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Misc/python-config.sh.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 555b0cb..706db08 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -27,6 +27,12 @@ installed_prefix () + RESULT=$(readlink -f "$RESULT") + fi + fi ++ # Since we don't know where the output from this script will end up ++ # we keep all paths in Windows-land since MSYS2 can handle that ++ # while native tools can't handle paths in MSYS2-land. ++ if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] ; then ++ RESULT=$(cd "$RESULT" && pwd -W) ++ fi + echo $RESULT + } + diff --git a/mingw-w64-python/0029-gdbm-module-includes.patch b/mingw-w64-python/0029-gdbm-module-includes.patch deleted file mode 100644 index 7aca8a3ab4ed3..0000000000000 --- a/mingw-w64-python/0029-gdbm-module-includes.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 269aa8cd9ad55e91228f305784d6645ad1b208a2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:02 +0530 -Subject: [PATCH 029/N] gdbm module includes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Modules/_gdbmmodule.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c -index ffd7b64..b536ced 100644 ---- a/Modules/_gdbmmodule.c -+++ b/Modules/_gdbmmodule.c -@@ -18,7 +18,7 @@ - #include - #include - --#if defined(WIN32) && !defined(__CYGWIN__) -+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) - #include "gdbmerrno.h" - extern const char * gdbm_strerror(gdbm_error); - #endif diff --git a/mingw-w64-python/0029-python-config-use-the-Python-variant-of-python-confi.patch b/mingw-w64-python/0029-python-config-use-the-Python-variant-of-python-confi.patch new file mode 100644 index 0000000000000..5e8cbec268b3f --- /dev/null +++ b/mingw-w64-python/0029-python-config-use-the-Python-variant-of-python-confi.patch @@ -0,0 +1,26 @@ +From 587fbe788f7afedddcd2d04f1a3407838488f2d6 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Mon, 5 Jan 2026 19:34:32 +0100 +Subject: [PATCH 029/N] python-config: use the Python variant of + python-config + +so there is no bash required to run it on Windows +--- + Makefile.pre.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 3eafdd3..a3c6958 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2607,6 +2607,10 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @if test `uname -s` = Darwin; then \ + cp python-config.py python-config; \ + fi ++ @ # On Windows, use the python version of the script so no bash is required ++ @if test "$(MACHDEP)" = "win32"; then \ ++ cp python-config.py python-config; \ ++ fi + + # macOS' make seems to ignore a dependency on a + # "$(BUILD_SCRIPTS_DIR): $(MKDIR_P) $@" rule. diff --git a/mingw-w64-python/0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch b/mingw-w64-python/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch similarity index 69% rename from mingw-w64-python/0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch rename to mingw-w64-python/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch index 04da49ec5451c..10ac60c2341aa 100644 --- a/mingw-w64-python/0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch +++ b/mingw-w64-python/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch @@ -1,7 +1,7 @@ -From d11b445c7da07918151fee5d5141631ca8247ac8 Mon Sep 17 00:00:00 2001 +From c6bcf96088e9c371c1d60348acc687b44cf6d469 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Thu, 17 Jun 2021 18:51:46 +0530 -Subject: [PATCH 021/N] mingw: prefer unix sep if MSYSTEM environment +Subject: [PATCH 030/N] mingw: prefer unix sep if MSYSTEM environment variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -13,15 +13,15 @@ Co-authored-by: cat Co-authored-by: Naveen M K --- Include/pylifecycle.h | 6 ++ - Lib/ntpath.py | 106 ++++++++++++++++++--------------- + Lib/ntpath.py | 122 ++++++++++++++++++++---------------- Modules/posixmodule.c | 2 + Python/initconfig.c | 2 +- - Python/pathconfig.c | 135 ++++++++++++++++++++++++++++++++++++++++++ + Python/pathconfig.c | 140 +++++++++++++++++++++++++++++++++++++++++- Python/traceback.c | 2 +- - 6 files changed, 203 insertions(+), 50 deletions(-) + 6 files changed, 217 insertions(+), 57 deletions(-) diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h -index e4c3b09..50d8b76 100644 +index de1bcb1..9f842cb 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -21,6 +21,12 @@ PyAPI_FUNC(int) Py_IsInitialized(void); @@ -38,7 +38,7 @@ index e4c3b09..50d8b76 100644 /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level * exit functions. diff --git a/Lib/ntpath.py b/Lib/ntpath.py -index 1bef630..c4855ae 100644 +index 01f060e..24bfe57 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -11,9 +11,7 @@ module as os.path. @@ -51,11 +51,11 @@ index 1bef630..c4855ae 100644 defpath = '.;C:\\bin' devnull = 'nul' -@@ -23,6 +21,14 @@ import stat +@@ -22,6 +20,15 @@ import sys import genericpath from genericpath import * -+if sys.platform == "win32" and "MSYSTEM" in os.environ: ++if sys._use_alt_sep: + sep = '/' + altsep = '\\' +else: @@ -63,10 +63,11 @@ index 1bef630..c4855ae 100644 + altsep = '/' +bsep = str.encode(sep) +baltsep = str.encode(altsep) - ++ __all__ = ["normcase","isabs","join","splitdrive","splitroot","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", -@@ -35,9 +41,33 @@ __all__ = ["normcase","isabs","join","splitdrive","splitroot","split","splitext" + "getatime","getctime", "islink","exists","lexists","isdir","isfile", +@@ -33,9 +40,39 @@ __all__ = ["normcase","isabs","join","splitdrive","splitroot","split","splitext" def _get_bothseps(path): if isinstance(path, bytes): @@ -78,14 +79,14 @@ index 1bef630..c4855ae 100644 +def _get_sep(path): + if isinstance(path, bytes): + return bsep - else: -- return '\\/' ++ else: + return sep + +def _get_altsep(path): + if isinstance(path, bytes): + return baltsep -+ else: + else: +- return '\\/' + return altsep + +def _get_colon(path): @@ -94,6 +95,12 @@ index 1bef630..c4855ae 100644 + else: + return ':' + ++def _get_colon_seps(path): ++ if isinstance(path, bytes): ++ return b':'+bsep+baltsep ++ else: ++ return ':'+sep+altsep ++ +def _get_unc_prefix(path): + if isinstance(path, bytes): + return b'\\\\?\\UNC\\' @@ -102,7 +109,7 @@ index 1bef630..c4855ae 100644 # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done -@@ -59,14 +89,14 @@ try: +@@ -57,14 +94,14 @@ try: return s if isinstance(s, bytes): encoding = sys.getfilesystemencoding() @@ -119,7 +126,7 @@ index 1bef630..c4855ae 100644 except ImportError: def normcase(s): """Normalize case of pathname. -@@ -75,8 +105,8 @@ except ImportError: +@@ -73,23 +110,17 @@ except ImportError: """ s = os.fspath(s) if isinstance(s, bytes): @@ -129,8 +136,6 @@ index 1bef630..c4855ae 100644 + return s.replace(altsep, sep).lower() - # Return whether a path is absolute. -@@ -88,14 +118,9 @@ except ImportError: def isabs(s): """Test whether a path is absolute""" s = os.fspath(s) @@ -138,60 +143,63 @@ index 1bef630..c4855ae 100644 - sep = b'\\' - altsep = b'/' - colon_sep = b':\\' +- double_sep = b'\\\\' - else: - sep = '\\' - altsep = '/' - colon_sep = ':\\' +- double_sep = '\\\\' + sep = _get_sep(s) + altsep = _get_altsep(s) + colon_sep = _get_colon(s) + sep ++ double_sep = sep + sep s = s[:3].replace(altsep, sep) # Absolute: UNC, device, and paths with a drive and root. - # LEGACY BUG: isabs("/x") should be false since the path has no drive. -@@ -107,14 +132,9 @@ def isabs(s): + return s.startswith(colon_sep, 1) or s.startswith(double_sep) +@@ -98,14 +129,9 @@ def isabs(s): # Join two (or more) paths. def join(path, *paths): path = os.fspath(path) - if isinstance(path, bytes): - sep = b'\\' - seps = b'\\/' -- colon = b':' +- colon_seps = b':\\/' - else: - sep = '\\' - seps = '\\/' -- colon = ':' +- colon_seps = ':\\/' + sep = _get_sep(path) + seps = _get_bothseps(path) -+ colon = _get_colon(path) ++ colon_seps = _get_colon_seps(path) try: - if not paths: - path[:0] + sep #23780: Ensure compatible data type even if p is null. -@@ -189,18 +209,12 @@ def splitroot(p): - splitroot('Windows/notepad') == ('', '', 'Windows/notepad') - """ - p = os.fspath(p) -- if isinstance(p, bytes): -- sep = b'\\' -- altsep = b'/' -- colon = b':' -- unc_prefix = b'\\\\?\\UNC\\' -- empty = b'' -- else: -- sep = '\\' -- altsep = '/' -- colon = ':' -- unc_prefix = '\\\\?\\UNC\\' -- empty = '' -+ sep = _get_sep(p) -+ altsep = _get_altsep(p) -+ colon = _get_colon(p) -+ unc_prefix = _get_unc_prefix(p) -+ empty = b'' if isinstance(p, bytes) else '' + result_drive, result_root, result_path = splitroot(path) + for p in paths: +@@ -174,18 +200,12 @@ except ImportError: + + The tail contains anything after the root.""" + p = os.fspath(p) +- if isinstance(p, bytes): +- sep = b'\\' +- altsep = b'/' +- colon = b':' +- unc_prefix = b'\\\\?\\UNC\\' +- empty = b'' +- else: +- sep = '\\' +- altsep = '/' +- colon = ':' +- unc_prefix = '\\\\?\\UNC\\' +- empty = '' ++ sep = _get_sep(p) ++ altsep = _get_altsep(p) ++ colon = _get_colon(p) ++ unc_prefix = _get_unc_prefix(p) ++ empty = b'' if isinstance(p, bytes) else '' + - normp = p.replace(altsep, sep) - if normp[:1] == sep: - if normp[1:2] == sep: -@@ -258,9 +272,9 @@ def split(p): + normp = p.replace(altsep, sep) + if normp[:1] == sep: + if normp[1:2] == sep: +@@ -243,9 +263,9 @@ def split(p): def splitext(p): p = os.fspath(p) if isinstance(p, bytes): @@ -203,7 +211,25 @@ index 1bef630..c4855ae 100644 splitext.__doc__ = genericpath._splitext.__doc__ -@@ -528,14 +542,12 @@ except ImportError: +@@ -360,7 +380,7 @@ def expanduser(path): + if 'USERPROFILE' in os.environ: + userhome = os.environ['USERPROFILE'] + elif 'HOMEPATH' not in os.environ: +- return path ++ return os.path.normpath(path) + else: + drive = os.environ.get('HOMEDRIVE', '') + userhome = join(drive, os.environ['HOMEPATH']) +@@ -384,7 +404,7 @@ def expanduser(path): + if isinstance(path, bytes): + userhome = os.fsencode(userhome) + +- return userhome + path[i:] ++ return os.path.normpath(userhome) + path[i:] + + + # Expand paths containing shell variable substitutions. +@@ -475,14 +495,12 @@ except ImportError: def normpath(path): """Normalize path, eliminating double slashes, etc.""" path = os.fspath(path) @@ -220,7 +246,16 @@ index 1bef630..c4855ae 100644 curdir = '.' pardir = '..' path = path.replace(altsep, sep) -@@ -773,6 +785,7 @@ else: +@@ -529,7 +547,7 @@ else: # use native Windows method on Windows + def abspath(path): + """Return the absolute version of a path.""" + try: +- return _getfullpathname(normpath(path)) ++ return normpath(_getfullpathname(normpath(path))) + except (OSError, ValueError): + # See gh-75230, handle outside for cleaner traceback + pass +@@ -728,6 +746,7 @@ else: # strip the prefix anyway. if ex.winerror == initial_winerror: path = spath @@ -228,10 +263,10 @@ index 1bef630..c4855ae 100644 return path -@@ -782,12 +795,11 @@ supports_unicode_filenames = True - def relpath(path, start=None): - """Return a relative version of a path""" - path = os.fspath(path) +@@ -740,12 +759,11 @@ def relpath(path, start=None): + if not path: + raise ValueError("no path specified") + + sep = _get_sep(path) if isinstance(path, bytes): - sep = b'\\' @@ -242,10 +277,10 @@ index 1bef630..c4855ae 100644 curdir = '.' pardir = '..' -@@ -842,13 +854,11 @@ def commonpath(paths): - raise ValueError('commonpath() arg is an empty sequence') +@@ -797,13 +815,11 @@ def commonpath(paths): + if not paths: + raise ValueError('commonpath() arg is an empty iterable') - paths = tuple(map(os.fspath, paths)) + sep = _get_sep(paths[0]) + altsep = _get_altsep(paths[0]) if isinstance(paths[0], bytes): @@ -259,10 +294,10 @@ index 1bef630..c4855ae 100644 try: diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 1a62ddd..2cb0c5b 100644 +index ea43a43..0da08e4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -4006,6 +4006,7 @@ posix_getcwd(int use_bytes) +@@ -4143,6 +4143,7 @@ posix_getcwd(int use_bytes) return NULL; } @@ -270,7 +305,7 @@ index 1a62ddd..2cb0c5b 100644 PyObject *resobj = PyUnicode_FromWideChar(wbuf2, len); if (wbuf2 != wbuf) { PyMem_RawFree(wbuf2); -@@ -4892,6 +4893,7 @@ os__getfinalpathname_impl(PyObject *module, path_t *path) +@@ -5043,6 +5044,7 @@ os__getfinalpathname_impl(PyObject *module, path_t *path) target_path = tmp; } @@ -279,10 +314,10 @@ index 1a62ddd..2cb0c5b 100644 if (result && PyBytes_Check(path->object)) { Py_SETREF(result, PyUnicode_EncodeFSDefault(result)); diff --git a/Python/initconfig.c b/Python/initconfig.c -index ed4c4e2..6ba6f5b 100644 +index fc16576..2a6daf8 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c -@@ -164,7 +164,7 @@ static const char usage_envvars[] = +@@ -304,7 +304,7 @@ static const char usage_envvars[] = "PYTHONWARNINGS : warning control (-W)\n" ; @@ -292,11 +327,20 @@ index ed4c4e2..6ba6f5b 100644 #else # define PYTHONHOMEHELP "/lib/pythonX.X" diff --git a/Python/pathconfig.c b/Python/pathconfig.c -index be0f97c..3d684d6 100644 +index 33abadd..0033e18 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c -@@ -18,6 +18,140 @@ - extern "C" { +@@ -8,7 +8,7 @@ + #include + + #include "marshal.h" // PyMarshal_ReadObjectFromString +-#include "osdefs.h" // DELIM ++#include "osdefs.h" // DELIM, SEP + + #ifdef MS_WINDOWS + # include // GetFullPathNameW(), MAX_PATH +@@ -16,6 +16,142 @@ + # include #endif +#ifdef __MINGW32__ @@ -331,7 +375,6 @@ index be0f97c..3d684d6 100644 +char +Py_GetSepA(const char *name) +{ -+ char* msystem = (char*)2; /* So that non Windows use / as sep */ + static char sep = '\0'; +#ifdef _WIN32 + /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx @@ -346,12 +389,14 @@ index be0f97c..3d684d6 100644 + if (sep != '\0') + return sep; +#if defined(__MINGW32__) -+ msystem = Py_GETENV("MSYSTEM"); -+#endif -+ if (msystem != NULL) ++ char* msystem = getenv("MSYSTEM"); ++ if (msystem != NULL && strcmp(msystem, "") != 0) + sep = '/'; + else + sep = '\\'; ++#else ++ sep = SEP; ++#endif + return sep; +} + @@ -384,7 +429,6 @@ index be0f97c..3d684d6 100644 +wchar_t +Py_GetSepW(const wchar_t *name) +{ -+ char* msystem = (char*)2; /* So that non Windows use / as sep */ + static wchar_t sep = L'\0'; +#ifdef _WIN32 + /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx @@ -399,12 +443,14 @@ index be0f97c..3d684d6 100644 + if (sep != L'\0') + return sep; +#if defined(__MINGW32__) -+ msystem = Py_GETENV("MSYSTEM"); -+#endif -+ if (msystem != NULL) ++ char* msystem = getenv("MSYSTEM"); ++ if (msystem != NULL && strcmp(msystem, "") != 0) + sep = L'/'; + else + sep = L'\\'; ++#else ++ sep = SEP; ++#endif + return sep; +} + @@ -436,19 +482,20 @@ index be0f97c..3d684d6 100644 /* External interface */ -@@ -317,6 +451,7 @@ _Py_SetProgramFullPath(const wchar_t *program_full_path) - if (has_value && _Py_path_config.program_full_path == NULL) { - path_out_of_memory(__func__); +@@ -486,7 +622,7 @@ _PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p) } -+ Py_NormalizeSepsW(_Py_path_config.program_name); - } - + #endif /* All others */ +- PyObject *path0_obj = PyUnicode_FromWideChar(path0, n); ++ PyObject *path0_obj = PyUnicode_FromWideChar(_Py_normpath(path0, -1), n); + if (path0_obj == NULL) { + return -1; + } diff --git a/Python/traceback.c b/Python/traceback.c -index 1cb82c5..37df982 100644 +index f984083..b7d16f7 100644 --- a/Python/traceback.c +++ b/Python/traceback.c -@@ -342,7 +342,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject * +@@ -338,7 +338,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject * filepath = PyBytes_AS_STRING(filebytes); /* Search tail of filename in sys.path before giving up */ diff --git a/mingw-w64-python/0026-remove_path_max.default.patch b/mingw-w64-python/0031-build-Remove-MAXPATHLEN-default.patch similarity index 63% rename from mingw-w64-python/0026-remove_path_max.default.patch rename to mingw-w64-python/0031-build-Remove-MAXPATHLEN-default.patch index c25f922271c65..82ad8cb6be735 100644 --- a/mingw-w64-python/0026-remove_path_max.default.patch +++ b/mingw-w64-python/0031-build-Remove-MAXPATHLEN-default.patch @@ -1,8 +1,8 @@ -From c205e9912fd947734482c5cf850fb79d837f21e8 Mon Sep 17 00:00:00 2001 +From c84bbcd5856f56702c9bf25f4c763f5a469ce131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:51:59 +0530 -Subject: [PATCH 026/N] remove_path_max.default +Subject: [PATCH 031/N] build: Remove MAXPATHLEN default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -13,14 +13,14 @@ Co-authored-by: Алексей 1 file changed, 1 deletion(-) diff --git a/Include/osdefs.h b/Include/osdefs.h -index 3243944..99d4977 100644 +index 2599e87..8c06827 100644 --- a/Include/osdefs.h +++ b/Include/osdefs.h -@@ -10,7 +10,6 @@ extern "C" { +@@ -16,7 +16,6 @@ extern "C" { #ifdef MS_WINDOWS - #define SEP L'\\' - #define ALTSEP L'/' --#define MAXPATHLEN 256 - #define DELIM L';' + # define SEP L'\\' + # define ALTSEP L'/' +-# define MAXPATHLEN 256 + # define DELIM L';' #endif diff --git a/mingw-w64-python/0031-mingw-fix-ssl-dont-use-enum_certificates.patch b/mingw-w64-python/0031-mingw-fix-ssl-dont-use-enum_certificates.patch deleted file mode 100644 index 7d8b081cad2af..0000000000000 --- a/mingw-w64-python/0031-mingw-fix-ssl-dont-use-enum_certificates.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ac698395e3c6cc48ae6a4615101cabcb419ea8e5 Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Thu, 17 Jun 2021 18:52:03 +0530 -Subject: [PATCH 031/N] mingw fix ssl dont use enum_certificates -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей -Co-authored-by: Christoph Reiter ---- - Lib/ssl.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Lib/ssl.py b/Lib/ssl.py -index 42ebb8e..791d5c5 100644 ---- a/Lib/ssl.py -+++ b/Lib/ssl.py -@@ -254,7 +254,7 @@ class _TLSMessageType: - CHANGE_CIPHER_SPEC = 0x0101 - - --if sys.platform == "win32": -+if sys.platform == "win32" and sys.version.find("GCC") == -1: - from _ssl import enum_certificates, enum_crls - - from socket import socket, SOCK_STREAM, create_connection -@@ -528,7 +528,7 @@ class SSLContext(_SSLContext): - def load_default_certs(self, purpose=Purpose.SERVER_AUTH): - if not isinstance(purpose, _ASN1Object): - raise TypeError(purpose) -- if sys.platform == "win32": -+ if sys.platform == "win32" and sys.version.find("GCC") == -1: - for storename in self._windows_cert_stores: - self._load_windows_store_certs(storename, purpose) - self.set_default_verify_paths() diff --git a/mingw-w64-python/0027-dont-link-with-gettext.patch b/mingw-w64-python/0032-build-dont-link-with-gettext.patch similarity index 67% rename from mingw-w64-python/0027-dont-link-with-gettext.patch rename to mingw-w64-python/0032-build-dont-link-with-gettext.patch index e625cd19ee5aa..709dc701391ac 100644 --- a/mingw-w64-python/0027-dont-link-with-gettext.patch +++ b/mingw-w64-python/0032-build-dont-link-with-gettext.patch @@ -1,26 +1,26 @@ -From 037e878c48bdaff130dbb6be551a4eee313cb5a3 Mon Sep 17 00:00:00 2001 +From e20bb99edd3fe7ac314e5050d15b8b0d3160e05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:52:00 +0530 -Subject: [PATCH 027/N] dont link with gettext +Subject: [PATCH 032/N] build: dont link with gettext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Алексей --- - Modules/_localemodule.c | 7 +++++++ + Modules/_localemodule.c | 8 ++++++++ configure.ac | 9 +++++++++ - 2 files changed, 16 insertions(+) + 2 files changed, 17 insertions(+) diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c -index db81943..416bd59 100644 +index 0af5a26..5171c61 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c -@@ -12,6 +12,13 @@ This software comes with no warranty. Use at your own risk. - #define PY_SSIZE_T_CLEAN - #include "Python.h" - #include "pycore_fileutils.h" +@@ -13,6 +13,14 @@ This software comes with no warranty. Use at your own risk. + #include "pycore_fileutils.h" // _Py_GetLocaleconvNumeric() + #include "pycore_pymem.h" // _PyMem_Strdup() + +#ifdef __MINGW32__ +/* The header libintl.h and library libintl may exist on mingw host. + * To be compatible with MSVC build we has to undef some defines. @@ -28,14 +28,15 @@ index db81943..416bd59 100644 +#undef HAVE_LIBINTL_H +#undef HAVE_BIND_TEXTDOMAIN_CODESET +#endif - - #include - #include ++ + #include // setlocale() + #include // strlen() + #ifdef HAVE_ERRNO_H diff --git a/configure.ac b/configure.ac -index c8407ad..cc7dc15 100644 +index ea8799e..c71a3f5 100644 --- a/configure.ac +++ b/configure.ac -@@ -3878,10 +3878,19 @@ AC_SEARCH_LIBS([sem_init], [pthread rt posix4]) +@@ -4064,10 +4064,19 @@ AC_SEARCH_LIBS([sem_init], [pthread rt posix4]) fi # check if we need libintl for locale functions diff --git a/mingw-w64-python/0032-fix-using-dllhandle-and-winver-mingw.patch b/mingw-w64-python/0032-fix-using-dllhandle-and-winver-mingw.patch deleted file mode 100644 index 9421bed422169..0000000000000 --- a/mingw-w64-python/0032-fix-using-dllhandle-and-winver-mingw.patch +++ /dev/null @@ -1,36 +0,0 @@ -From dbf3d4a853e6c0b6ebec51d9ac104c30ee718d40 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:06 +0530 -Subject: [PATCH 032/N] fix using dllhandle and winver mingw -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Python/sysmodule.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Python/sysmodule.c b/Python/sysmodule.c -index 6ed28ec..0182569 100644 ---- a/Python/sysmodule.c -+++ b/Python/sysmodule.c -@@ -45,7 +45,7 @@ Data members: - # include - #endif /* MS_WINDOWS */ - --#ifdef MS_COREDLL -+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) - extern void *PyWin_DLLhModule; - /* A string loaded from the DLL at startup: */ - extern const char *PyWin_DLLVersionString; -@@ -3429,7 +3429,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) - SET_SYS_FROM_STRING("byteorder", "little"); - #endif - --#ifdef MS_COREDLL -+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) - SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); - #endif diff --git a/mingw-w64-python/0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch b/mingw-w64-python/0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch deleted file mode 100644 index 767b13c0847ed..0000000000000 --- a/mingw-w64-python/0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6614b332854b172805467c0c02474e9f3210d0e4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:07 +0530 -Subject: [PATCH 033/N] Add AMD64 to sys config so msvccompiler - get_build_version works - ---- - Python/getcompiler.c | 17 ++++++++++++++++- - 1 file changed, 16 insertions(+), 1 deletion(-) - -diff --git a/Python/getcompiler.c b/Python/getcompiler.c -index a5d2623..3e31c80 100644 ---- a/Python/getcompiler.c -+++ b/Python/getcompiler.c -@@ -10,7 +10,22 @@ - #if defined(__clang__) - #define COMPILER "[Clang " __clang_version__ "]" - #elif defined(__GNUC__) --#define COMPILER "[GCC " __VERSION__ "]" -+/* To not break compatibility with things that determine -+ CPU arch by calling get_build_version in msvccompiler.py -+ (such as NumPy) add "32 bit" or "64 bit (AMD64)" on Windows -+ and also use a space as a separator rather than a newline. */ -+#if defined(_WIN32) -+#define COMP_SEP " " -+#if defined(__x86_64__) -+#define ARCH_SUFFIX " 64 bit (AMD64)" -+#else -+#define ARCH_SUFFIX " 32 bit" -+#endif -+#else -+#define COMP_SEP "\n" -+#define ARCH_SUFFIX "" -+#endif -+#define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]" - // Generic fallbacks. - #elif defined(__cplusplus) - #define COMPILER "[C++]" diff --git a/mingw-w64-python/0030-use-gnu_printf-in-format.patch b/mingw-w64-python/0033-use-gnu_printf-in-format.patch similarity index 82% rename from mingw-w64-python/0030-use-gnu_printf-in-format.patch rename to mingw-w64-python/0033-use-gnu_printf-in-format.patch index 43870723a1fe8..a6cc964986f38 100644 --- a/mingw-w64-python/0030-use-gnu_printf-in-format.patch +++ b/mingw-w64-python/0033-use-gnu_printf-in-format.patch @@ -1,8 +1,8 @@ -From cb41ac70252f2ef89f10203e7309f5add9eb6ad5 Mon Sep 17 00:00:00 2001 +From d3c8697835df203f2c2de8c5d168b85db032d19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 17 Jun 2021 18:52:03 +0530 -Subject: [PATCH 030/N] use gnu_printf in format +Subject: [PATCH 033/N] use gnu_printf in format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -16,10 +16,10 @@ Co-authored-by: Алексей 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Include/bytesobject.h b/Include/bytesobject.h -index ee448cd..d10ec3f 100644 +index c5a2419..cc7e529 100644 --- a/Include/bytesobject.h +++ b/Include/bytesobject.h -@@ -35,9 +35,9 @@ PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t); +@@ -32,9 +32,9 @@ PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *); PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list) @@ -32,10 +32,10 @@ index ee448cd..d10ec3f 100644 PyAPI_FUNC(char *) PyBytes_AsString(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int); diff --git a/Include/pyerrors.h b/Include/pyerrors.h -index d089fa7..f8e604e 100644 +index 5d0028c..cae6979 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h -@@ -321,9 +321,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( +@@ -319,9 +319,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( ); PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) @@ -48,28 +48,28 @@ index d089fa7..f8e604e 100644 #ifndef Py_LIMITED_API # define Py_CPYTHON_ERRORS_H diff --git a/Include/pyport.h b/Include/pyport.h -index ddff496..df363d0 100644 +index eecb181..2cb8c2e 100644 --- a/Include/pyport.h +++ b/Include/pyport.h -@@ -666,6 +666,12 @@ extern char * _getpty(int *, int, mode_t, int); +@@ -477,6 +477,12 @@ extern "C" { #define Py_VA_COPY va_copy +#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__>= 4) || __GNUC__ > 4) +# define Py_PRINTF(X,Y) Py_GCC_ATTRIBUTE((format(gnu_printf,X,Y))) +#else -+# define Py_PRINTF(X,Y) Py_GCC_ATTRIBUTE((format(printf,X,Y))) ++# define Py_PRINTF(X,Y) Py_GCC_ATTRIBUTE((format(printf,X,Y))) +#endif + /* * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is * detected by configure and defined in pyconfig.h. The code in pyconfig.h diff --git a/Include/sysmodule.h b/Include/sysmodule.h -index 96f8838..55c558a 100644 +index 5a0af2e..259677a 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h -@@ -15,9 +15,9 @@ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); - Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); +@@ -11,9 +11,9 @@ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **); + Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) - Py_GCC_ATTRIBUTE((format(printf, 1, 2))); diff --git a/mingw-w64-python/0034-MINGW-link-with-additional-library.patch b/mingw-w64-python/0034-MINGW-link-with-additional-library.patch deleted file mode 100644 index f028c1aa3c7f6..0000000000000 --- a/mingw-w64-python/0034-MINGW-link-with-additional-library.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e20536fb7ac99af6713301d0d3ccb2f7740fa6d1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:08 +0530 -Subject: [PATCH 034/N] MINGW link with additional library - ---- - configure.ac | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/configure.ac b/configure.ac -index cc7dc15..7002b78 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7104,6 +7104,15 @@ for dir in $SRCDIRS; do - done - AC_MSG_RESULT([done]) - -+# For mingw build need additional library for linking -+case $host in -+ *-*-mingw*) -+ LIBS="$LIBS -lversion -lshlwapi -lpathcch" -+ ;; -+ *) -+ ;; -+esac -+ - # Availability of -O2: - AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [ - saved_cflags="$CFLAGS" diff --git a/mingw-w64-python/0034-build-remove-usage-of-MS_COREDLL.patch b/mingw-w64-python/0034-build-remove-usage-of-MS_COREDLL.patch new file mode 100644 index 0000000000000..16d055363377e --- /dev/null +++ b/mingw-w64-python/0034-build-remove-usage-of-MS_COREDLL.patch @@ -0,0 +1,56 @@ +From 52639b9b2f48927df7754ea36abe5395e6b1f1fe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= + +Date: Thu, 17 Jun 2021 18:52:06 +0530 +Subject: [PATCH 034/N] build: remove usage of MS_COREDLL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +it's not set by the autotools build system and deprecated, +so port it to known macros. + +Co-authored-by: Алексей +--- + Python/sysmodule.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Python/sysmodule.c b/Python/sysmodule.c +index e722a59..5b62b52 100644 +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -50,7 +50,7 @@ Data members: + # include + #endif /* MS_WINDOWS */ + +-#ifdef MS_COREDLL ++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) + extern void *PyWin_DLLhModule; + /* A string loaded from the DLL at startup: */ + extern const char *PyWin_DLLVersionString; +@@ -3181,14 +3181,14 @@ version -- the version of this interpreter as a string\n\ + version_info -- version information as a named tuple\n\ + " + ) +-#ifdef MS_COREDLL ++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) + /* concatenating string here */ + PyDoc_STR( + "dllhandle -- [Windows only] integer handle of the Python DLL\n\ + winver -- [Windows only] version number of the Python DLL\n\ + " + ) +-#endif /* MS_COREDLL */ ++#endif /* defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) */ + #ifdef MS_WINDOWS + /* concatenating string here */ + PyDoc_STR( +@@ -3658,7 +3658,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) + SET_SYS("_is_mingw_ucrt", PyLong_FromLong(is_mingw_ucrt())); + SET_SYS("_use_alt_sep", PyLong_FromLong(use_alt_sep())); + +-#ifdef MS_COREDLL ++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) + SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); + SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); + #endif diff --git a/mingw-w64-python/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch b/mingw-w64-python/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch new file mode 100644 index 0000000000000..3bf365be602dc --- /dev/null +++ b/mingw-w64-python/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch @@ -0,0 +1,69 @@ +From 31b7b9fb4d58588f36a46946b3012789f71b0e38 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= + +Date: Thu, 17 Jun 2021 18:52:07 +0530 +Subject: [PATCH 035/N] getcompiler: expose MINGW toolchain related + information + +* include MINGW and UCRT +* include things like "64 bit (AMD64)" for compat with the MSVC build +--- + Python/getcompiler.c | 43 +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 41 insertions(+), 2 deletions(-) + +diff --git a/Python/getcompiler.c b/Python/getcompiler.c +index a5d2623..477fe9d 100644 +--- a/Python/getcompiler.c ++++ b/Python/getcompiler.c +@@ -7,10 +7,49 @@ + + // Note the __clang__ conditional has to come before the __GNUC__ one because + // clang pretends to be GCC. +-#if defined(__clang__) ++#if defined(__clang__) && !defined(_WIN32) + #define COMPILER "[Clang " __clang_version__ "]" + #elif defined(__GNUC__) +-#define COMPILER "[GCC " __VERSION__ "]" ++/* To not break compatibility with things that determine ++ CPU arch by calling get_build_version in msvccompiler.py ++ (such as NumPy) add "32 bit" or "64 bit (AMD64)" on Windows ++ and also use a space as a separator rather than a newline. */ ++#if defined(_WIN32) ++# define COMP_SEP " " ++# if defined(__x86_64__) ++# define ARCH_SUFFIX " 64 bit (AMD64)" ++# elif defined(__aarch64__) ++# define ARCH_SUFFIX " 64 bit (ARM64)" ++# elif defined(__arm__) ++# define ARCH_SUFFIX " 32 bit (ARM)" ++# else ++# define ARCH_SUFFIX " 32 bit" ++# endif ++#else ++# define COMP_SEP "\n" ++# define ARCH_SUFFIX "" ++#endif ++ ++#if defined __MINGW32__ ++# define ARCH_PREFIX "MINGW " ++#else ++# define ARCH_PREFIX "" ++#endif ++ ++#if defined(__clang__) ++# if defined(_UCRT) ++# define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang UCRT " __clang_version__ ARCH_SUFFIX "]" ++# else ++# define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang " __clang_version__ ARCH_SUFFIX "]" ++# endif ++#else ++# if defined(_UCRT) ++# define COMPILER COMP_SEP "[" ARCH_PREFIX "GCC UCRT " __VERSION__ ARCH_SUFFIX "]" ++# else ++# define COMPILER COMP_SEP "[" ARCH_PREFIX "GCC " __VERSION__ ARCH_SUFFIX "]" ++# endif ++#endif ++ + // Generic fallbacks. + #elif defined(__cplusplus) + #define COMPILER "[C++]" diff --git a/mingw-w64-python/0035-install-msilib.patch b/mingw-w64-python/0035-install-msilib.patch deleted file mode 100644 index 5cee2c7393e7e..0000000000000 --- a/mingw-w64-python/0035-install-msilib.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 47a51bd876d1e9b8fbeeb633211d0f16c0980a9c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= -Date: Thu, 17 Jun 2021 18:52:09 +0530 -Subject: [PATCH 035/N] install msilib -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей -Co-authored-by: Christoph Reiter -Co-authored-by: Ray Donnelly ---- - Makefile.pre.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 63ca7ad..5cc3d6d 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -2122,6 +2122,7 @@ LIBSUBDIRS= asyncio \ - tkinter \ - tomllib \ - turtledemo \ -+ msilib \ - unittest \ - urllib \ - venv venv/scripts venv/scripts/common venv/scripts/posix \ diff --git a/mingw-w64-python/0036-fix-signal-module-build.patch b/mingw-w64-python/0036-build-fix-signal-module-build.patch similarity index 73% rename from mingw-w64-python/0036-fix-signal-module-build.patch rename to mingw-w64-python/0036-build-fix-signal-module-build.patch index c23f0bbc72d84..fade55f1d2109 100644 --- a/mingw-w64-python/0036-fix-signal-module-build.patch +++ b/mingw-w64-python/0036-build-fix-signal-module-build.patch @@ -1,7 +1,7 @@ -From 272a424a36f574ac03f181c8cfdb005dedf37812 Mon Sep 17 00:00:00 2001 +From bf664bb5297004cf47e5f10c66580fd1c379c990 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:10 +0530 -Subject: [PATCH 036/N] fix signal module build +Subject: [PATCH 036/N] build: fix signal module build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -13,15 +13,15 @@ Co-authored-by: Naveen M K 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index d8b41ee..ec0f81e 100644 +index 0ea9b25..891279e 100644 --- a/Modules/Setup.bootstrap.in +++ b/Modules/Setup.bootstrap.in @@ -9,7 +9,7 @@ atexit atexitmodule.c faulthandler faulthandler.c - @INITSYS@ posixmodule.c + @MODULE_POSIXMODULE_NAME@ posixmodule.c -_signal signalmodule.c +_signal signalmodule.c -lws2_32 _tracemalloc _tracemalloc.c + _suggestions _suggestions.c - # modules used by importlib, deepfreeze, freeze, runpy, and sysconfig diff --git a/mingw-w64-python/0037-build-build-winconsoleio-and-_testconsole.patch b/mingw-w64-python/0037-build-build-winconsoleio-and-_testconsole.patch index c42544f5a5ac4..5402fecb63db2 100644 --- a/mingw-w64-python/0037-build-build-winconsoleio-and-_testconsole.patch +++ b/mingw-w64-python/0037-build-build-winconsoleio-and-_testconsole.patch @@ -1,4 +1,4 @@ -From 3a96d1d80a52f6912ba0469278298d8bbc8bb7c5 Mon Sep 17 00:00:00 2001 +From bc00e609841043d47670736289abe740dc2f8114 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:11 +0530 Subject: [PATCH 037/N] build: build winconsoleio and _testconsole @@ -15,10 +15,10 @@ Co-authored-by: Naveen M K 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index ec0f81e..cec80f5 100644 +index 891279e..4997f81 100644 --- a/Modules/Setup.bootstrap.in +++ b/Modules/Setup.bootstrap.in -@@ -16,7 +16,7 @@ _tracemalloc _tracemalloc.c +@@ -17,7 +17,7 @@ _suggestions _suggestions.c _codecs _codecsmodule.c _collections _collectionsmodule.c errno errnomodule.c @@ -26,25 +26,25 @@ index ec0f81e..cec80f5 100644 +_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c itertools itertoolsmodule.c _sre _sre/sre.c - _thread _threadmodule.c + _sysconfig _sysconfig.c diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in -index 98e3ef2..b96db5d 100644 +index c0ee182..cd7c2e9 100644 --- a/Modules/Setup.stdlib.in +++ b/Modules/Setup.stdlib.in -@@ -184,6 +184,7 @@ - @MODULE__TESTMULTIPHASE_TRUE@_testmultiphase _testmultiphase.c - @MODULE__TESTMULTIPHASE_TRUE@_testsinglephase _testsinglephase.c +@@ -181,6 +181,7 @@ + @MODULE__TESTSINGLEPHASE_TRUE@_testsinglephase _testsinglephase.c + @MODULE__TESTEXTERNALINSPECTION_TRUE@_testexternalinspection _testexternalinspection.c @MODULE__CTYPES_TEST_TRUE@_ctypes_test _ctypes/_ctypes_test.c +@MODULE__TESTCONSOLE_TRUE@_testconsole ../PC/_testconsole.c # Limited API template modules; must be built as shared modules. @MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c diff --git a/configure.ac b/configure.ac -index 7002b78..1c8d1e7 100644 +index c71a3f5..e2fab3f 100644 --- a/configure.ac +++ b/configure.ac -@@ -7887,6 +7887,7 @@ PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv - PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +@@ -8277,6 +8277,7 @@ PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_fu + PY_STDLIB_MOD([_testexternalinspection], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([xxsubtype], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) +PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"]) diff --git a/mingw-w64-python/0038-expose-sem_unlink.patch b/mingw-w64-python/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch similarity index 58% rename from mingw-w64-python/0038-expose-sem_unlink.patch rename to mingw-w64-python/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch index 6db608a26c3ef..aea8f08242c85 100644 --- a/mingw-w64-python/0038-expose-sem_unlink.patch +++ b/mingw-w64-python/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch @@ -1,26 +1,32 @@ -From bc6d357a914d785bd85eefca2d870103df36ee55 Mon Sep 17 00:00:00 2001 +From 335402ed7c287a1c22300dbad1295ed30195fe0a Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:12 +0530 -Subject: [PATCH 038/N] expose sem_unlink +Subject: [PATCH 038/N] multiprocessing: expose sem_unlink to fix + multiprocessing.Queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +synchronize.py requires sem_unlink to exist, even on Windows +where it's not implemented. + +This fixes multiprocessing.Queue for example. + Co-authored-by: Алексей --- Modules/_multiprocessing/multiprocessing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c -index 8f9daa5..eb2cb5f 100644 +index cee8cf7..8e09cea 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c -@@ -180,7 +180,7 @@ static PyMethodDef module_methods[] = { +@@ -181,7 +181,7 @@ static PyMethodDef module_methods[] = { _MULTIPROCESSING_RECV_METHODDEF _MULTIPROCESSING_SEND_METHODDEF #endif --#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) -+#if defined(MS_WINDOWS) || (!defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__)) +-#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) ++#if defined(MS_WINDOWS) || !defined(POSIX_SEMAPHORES_NOT_ENABLED) _MULTIPROCESSING_SEM_UNLINK_METHODDEF #endif {NULL} diff --git a/mingw-w64-python/0039-Use-cygpty-while-using-isatty.patch b/mingw-w64-python/0039-Use-cygpty-while-using-isatty.patch index b378774be18ff..9741ab741906f 100644 --- a/mingw-w64-python/0039-Use-cygpty-while-using-isatty.patch +++ b/mingw-w64-python/0039-Use-cygpty-while-using-isatty.patch @@ -1,4 +1,4 @@ -From 0f752f55442fcdfaaf2f0fa66794ba09c9cd8625 Mon Sep 17 00:00:00 2001 +From 19208aade49d1fbccb58a0778acf967c25d29bc1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:14 +0530 Subject: [PATCH 039/N] Use cygpty while using isatty @@ -11,7 +11,7 @@ so that msys shells are detected as interactive ones Co-authored-by: Алексей Co-authored-by: Naveen M K --- - Include/iscygpty.h | 41 ++++++++++ + Include/iscygpty.h | 41 +++++++++ Makefile.pre.in | 2 + Modules/_io/fileio.c | 3 +- Modules/main.c | 3 +- @@ -20,15 +20,15 @@ Co-authored-by: Naveen M K Python/bltinmodule.c | 5 +- Python/fileutils.c | 7 +- Python/frozenmain.c | 3 +- - Python/iscygpty.c | 185 ++++++++++++++++++++++++++++++++++++++++++ + Python/iscygpty.c | 190 ++++++++++++++++++++++++++++++++++++++++++ Python/pylifecycle.c | 5 +- - 11 files changed, 248 insertions(+), 12 deletions(-) + 11 files changed, 253 insertions(+), 12 deletions(-) create mode 100644 Include/iscygpty.h create mode 100644 Python/iscygpty.c diff --git a/Include/iscygpty.h b/Include/iscygpty.h new file mode 100644 -index 0000000..82fd0af +index 0000000..b053007 --- /dev/null +++ b/Include/iscygpty.h @@ -0,0 +1,41 @@ @@ -72,40 +72,40 @@ index 0000000..82fd0af +#define is_cygpty_used() 0 +#endif + -+#endif /* _ISCYGPTY_H */ ++#endif // _ISCYGPTY_H diff --git a/Makefile.pre.in b/Makefile.pre.in -index 5cc3d6d..2af2bee 100644 +index a3c6958..9341d30 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -406,6 +406,7 @@ PYTHON_OBJS= \ - Python/instrumentation.o \ +@@ -460,6 +460,7 @@ PYTHON_OBJS= \ Python/intrinsics.o \ + Python/jit.o \ Python/legacy_tracing.o \ + Python/iscygpty.o \ + Python/lock.o \ Python/marshal.o \ Python/modsupport.o \ - Python/mysnprintf.o \ -@@ -1636,6 +1637,7 @@ PYTHON_HEADERS= \ +@@ -1044,6 +1045,7 @@ PYTHON_HEADERS= \ + $(srcdir)/Include/genericaliasobject.h \ $(srcdir)/Include/import.h \ - $(srcdir)/Include/interpreteridobject.h \ $(srcdir)/Include/intrcheck.h \ + $(srcdir)/Include/iscygpty.h \ $(srcdir)/Include/iterobject.h \ $(srcdir)/Include/listobject.h \ - $(srcdir)/Include/longobject.h \ + $(srcdir)/Include/lock.h \ diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c -index bab6807..919b8b0 100644 +index 65957a7..6249693 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c -@@ -20,6 +20,7 @@ +@@ -24,6 +24,7 @@ #endif - #include /* For offsetof */ + #include "_iomodule.h" +#include "iscygpty.h" /* * Known likely problems: -@@ -1143,7 +1144,7 @@ _io_FileIO_isatty_impl(fileio *self) +@@ -1155,7 +1156,7 @@ _io_FileIO_isatty_impl(fileio *self) return err_closed(); Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH @@ -115,18 +115,18 @@ index bab6807..919b8b0 100644 Py_END_ALLOW_THREADS return PyBool_FromLong(res); diff --git a/Modules/main.c b/Modules/main.c -index f4e4018..fbdccdd 100644 +index 581c872..82fd972 100644 --- a/Modules/main.c +++ b/Modules/main.c -@@ -7,6 +7,7 @@ - #include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() +@@ -9,6 +9,7 @@ #include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv() #include "pycore_pystate.h" // _PyInterpreterState_GET() + #include "pycore_pythonrun.h" // _PyRun_AnyFileObject() +#include "iscygpty.h" /* Includes for exit_sigint() */ #include // perror() -@@ -92,7 +93,7 @@ static inline int config_run_code(const PyConfig *config) +@@ -90,7 +91,7 @@ static inline int config_run_code(const PyConfig *config) static int stdin_is_interactive(const PyConfig *config) { @@ -136,10 +136,10 @@ index f4e4018..fbdccdd 100644 diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 2cb0c5b..51b3e52 100644 +index 0da08e4..b1e23c2 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -54,6 +54,7 @@ +@@ -63,6 +63,7 @@ #ifdef __ANDROID__ # undef HAVE_FACCESSAT #endif @@ -147,7 +147,7 @@ index 2cb0c5b..51b3e52 100644 #include // ctermid() #include // system() -@@ -11235,7 +11236,7 @@ os_isatty_impl(PyObject *module, int fd) +@@ -12051,7 +12052,7 @@ os_isatty_impl(PyObject *module, int fd) int return_value; Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH @@ -157,17 +157,17 @@ index 2cb0c5b..51b3e52 100644 Py_END_ALLOW_THREADS return return_value; diff --git a/Objects/fileobject.c b/Objects/fileobject.c -index e99e155..c74d2af 100644 +index bae49d3..e0c1cfd 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c -@@ -3,6 +3,7 @@ - #define PY_SSIZE_T_CLEAN +@@ -2,6 +2,7 @@ + #include "Python.h" #include "pycore_call.h" // _PyObject_CallNoArgs() +#include "iscygpty.h" #include "pycore_runtime.h" // _PyRuntime - #if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER) + #ifdef HAVE_UNISTD_H @@ -382,7 +383,7 @@ stdprinter_isatty(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored)) } @@ -178,7 +178,7 @@ index e99e155..c74d2af 100644 return PyBool_FromLong(res); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index 2ae2869..d918964 100644 +index 5ded0bb..c7f4643 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1,6 +1,7 @@ @@ -186,10 +186,10 @@ index 2ae2869..d918964 100644 #include "Python.h" +#include "iscygpty.h" - #include #include "pycore_ast.h" // _PyAST_Validate() #include "pycore_call.h" // _PyObject_CallNoArgs() -@@ -2163,7 +2164,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) + #include "pycore_ceval.h" // _PyEval_Vector() +@@ -2224,7 +2225,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) if (fd < 0 && PyErr_Occurred()) { goto error; } @@ -198,7 +198,7 @@ index 2ae2869..d918964 100644 } if (tty) { tmp = PyObject_CallMethodNoArgs(fout, &_Py_ID(fileno)); -@@ -2176,7 +2177,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) +@@ -2237,7 +2238,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) Py_DECREF(tmp); if (fd < 0 && PyErr_Occurred()) goto error; @@ -208,7 +208,7 @@ index 2ae2869..d918964 100644 } diff --git a/Python/fileutils.c b/Python/fileutils.c -index c752175..6d3b04f 100644 +index 921500b..0ae2a2e 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1,4 +1,5 @@ @@ -217,7 +217,7 @@ index c752175..6d3b04f 100644 #include "pycore_fileutils.h" // fileutils definitions #include "pycore_runtime.h" // _PyRuntime #include "osdefs.h" // SEP -@@ -77,7 +78,7 @@ _Py_device_encoding(int fd) +@@ -80,7 +81,7 @@ _Py_device_encoding(int fd) int valid; Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH @@ -226,7 +226,7 @@ index c752175..6d3b04f 100644 _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS if (!valid) -@@ -1925,12 +1926,12 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) +@@ -1922,12 +1923,12 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held) depending on heap usage). */ if (gil_held) { Py_BEGIN_ALLOW_THREADS @@ -242,18 +242,18 @@ index c752175..6d3b04f 100644 } } diff --git a/Python/frozenmain.c b/Python/frozenmain.c -index f8be165..d18c7b3 100644 +index ec4566b..bda2e56 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -3,6 +3,7 @@ #include "Python.h" - #include "pycore_runtime.h" // _PyRuntime_Initialize() - #include + #include "pycore_pystate.h" // _Py_GetConfig() + #include "pycore_runtime.h" // _PyRuntime_Initialize() +#include "iscygpty.h" - #ifdef MS_WINDOWS - extern void PyWinFreeze_ExeInit(void); -@@ -71,7 +72,7 @@ Py_FrozenMain(int argc, char **argv) + #ifdef HAVE_UNISTD_H + # include // isatty() +@@ -82,7 +83,7 @@ Py_FrozenMain(int argc, char **argv) sts = 0; } @@ -264,15 +264,15 @@ index f8be165..d18c7b3 100644 diff --git a/Python/iscygpty.c b/Python/iscygpty.c new file mode 100644 -index 0000000..722f88f +index 0000000..9976f06 --- /dev/null +++ b/Python/iscygpty.c -@@ -0,0 +1,185 @@ +@@ -0,0 +1,190 @@ +/* + * iscygpty.c -- part of ptycheck + * https://github.com/k-takata/ptycheck + * -+ * Copyright (c) 2015-2017 K.Takata ++ * Copyright (c) 2015-2023 K.Takata + * + * You can redistribute it and/or modify it under the terms of either + * the MIT license (as described below) or the Vim license. @@ -305,18 +305,18 @@ index 0000000..722f88f +#include + +#ifdef USE_FILEEXTD -+/* VC 7.1 or earlier doesn't support SAL. */ ++// VC 7.1 or earlier doesn't support SAL. +# if !defined(_MSC_VER) || (_MSC_VER < 1400) +# define __out +# define __in +# define __in_opt +# endif -+/* Win32 FileID API Library: -+ * http://www.microsoft.com/en-us/download/details.aspx?id=22599 -+ * Needed for WinXP. */ ++// Win32 FileID API Library: ++// http://www.microsoft.com/en-us/download/details.aspx?id=22599 ++// Needed for WinXP. +# include -+#else /* USE_FILEEXTD */ -+/* VC 8 or earlier. */ ++#else // USE_FILEEXTD ++// VC 8 or earlier. +# if defined(_MSC_VER) && (_MSC_VER < 1500) +# ifdef ENABLE_STUB_IMPL +# define STUB_IMPL @@ -324,28 +324,31 @@ index 0000000..722f88f +# error "Win32 FileID API Library is required for VC2005 or earlier." +# endif +# endif -+#endif /* USE_FILEEXTD */ ++#endif // USE_FILEEXTD + ++#ifdef __MINGW32__ ++# define UNUSED __attribute__((unused)) ++#else ++# define UNUSED ++#endif + +#include "iscygpty.h" + +//#define USE_DYNFILEID +#ifdef USE_DYNFILEID +typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)( -+ HANDLE hFile, -+ FILE_INFO_BY_HANDLE_CLASS FileInformationClass, -+ LPVOID lpFileInformation, -+ DWORD dwBufferSize -+); ++ HANDLE hFile, ++ FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ++ LPVOID lpFileInformation, ++ DWORD dwBufferSize); +static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL; + +# ifndef USE_FILEEXTD +static BOOL WINAPI stub_GetFileInformationByHandleEx( -+ HANDLE hFile, -+ FILE_INFO_BY_HANDLE_CLASS FileInformationClass, -+ LPVOID lpFileInformation, -+ DWORD dwBufferSize -+ ) ++ HANDLE hFile UNUSED, ++ FILE_INFO_BY_HANDLE_CLASS FileInformationClass UNUSED, ++ LPVOID lpFileInformation UNUSED, ++ DWORD dwBufferSize UNUSED) +{ + return FALSE; +} @@ -376,14 +379,14 @@ index 0000000..722f88f +#define is_wprefix(s, prefix) \ + (wcsncmp((s), (prefix), sizeof(prefix) / sizeof(WCHAR) - 1) == 0) + -+/* Check if the fd is a cygwin/msys's pty. */ ++// Check if the fd is a cygwin/msys's pty. +int is_cygpty(int fd) +{ +#ifdef STUB_IMPL + return 0; +#else + HANDLE h; -+ int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1); ++ const int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1); + FILE_NAME_INFO *nameinfo; + WCHAR *p = NULL; + @@ -393,7 +396,7 @@ index 0000000..722f88f + if (h == INVALID_HANDLE_VALUE) { + return 0; + } -+ /* Cygwin/msys's pty is a pipe. */ ++ // Cygwin/msys's pty is a pipe. + if (GetFileType(h) != FILE_TYPE_PIPE) { + return 0; + } @@ -401,20 +404,21 @@ index 0000000..722f88f + if (nameinfo == NULL) { + return 0; + } -+ /* Check the name of the pipe: -+ * '\{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master' */ ++ // Check the name of the pipe: ++ // "\\{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master" + if (pGetFileInformationByHandleEx(h, FileNameInfo, nameinfo, size)) { + nameinfo->FileName[nameinfo->FileNameLength / sizeof(WCHAR)] = L'\0'; + p = nameinfo->FileName; -+ if (is_wprefix(p, L"\\cygwin-")) { /* Cygwin */ ++ if (is_wprefix(p, L"\\cygwin-")) { // Cygwin + p += 8; -+ } else if (is_wprefix(p, L"\\msys-")) { /* MSYS and MSYS2 */ ++ } else if (is_wprefix(p, L"\\msys-")) { // MSYS and MSYS2 + p += 6; + } else { + p = NULL; + } + if (p != NULL) { -+ while (*p && isxdigit(*p)) /* Skip 16-digit hexadecimal. */ ++ // Skip 16-digit hexadecimal. ++ while (*p && iswascii(*p) && isxdigit(*p)) + ++p; + if (is_wprefix(p, L"-pty")) { + p += 4; @@ -423,7 +427,8 @@ index 0000000..722f88f + } + } + if (p != NULL) { -+ while (*p && isdigit(*p)) /* Skip pty number. */ ++ // Skip pty number. ++ while (*p && iswascii(*p) && isdigit(*p)) + ++p; + if (is_wprefix(p, L"-from-master")) { + //p += 12; @@ -436,10 +441,10 @@ index 0000000..722f88f + } + free(nameinfo); + return (p != NULL); -+#endif /* STUB_IMPL */ ++#endif // STUB_IMPL +} + -+/* Check if at least one cygwin/msys pty is used. */ ++// Check if at least one cygwin/msys pty is used. +int is_cygpty_used(void) +{ + int fd, ret = 0; @@ -450,22 +455,22 @@ index 0000000..722f88f + return ret; +} + -+#endif /* _WIN32 */ ++#endif // _WIN32 + -+/* vim: set ts=4 sw=4: */ ++// vim: set ts=4 sw=4: diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index f5bea14..0bbb279 100644 +index 8cc6bd0..65b4444 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c -@@ -30,6 +30,7 @@ - #include "pycore_unicodeobject.h" // _PyUnicode_InitTypes() +@@ -36,6 +36,7 @@ + #include "opcode.h" +#include "iscygpty.h" #include // setlocale() #include // getenv() - -@@ -3113,7 +3114,7 @@ Py_Exit(int sts) + #ifdef HAVE_UNISTD_H +@@ -3533,7 +3534,7 @@ Py_Exit(int sts) int Py_FdIsInteractive(FILE *fp, const char *filename) { @@ -474,7 +479,7 @@ index f5bea14..0bbb279 100644 return 1; } if (!_Py_GetConfig()->interactive) { -@@ -3128,7 +3129,7 @@ Py_FdIsInteractive(FILE *fp, const char *filename) +@@ -3548,7 +3549,7 @@ Py_FdIsInteractive(FILE *fp, const char *filename) int _Py_FdIsInteractive(FILE *fp, PyObject *filename) { diff --git a/mingw-w64-python/0040-build-link-win-resource-files-and-build-pythonw.patch b/mingw-w64-python/0040-build-link-win-resource-files-and-build-pythonw.patch index d0ed21e33aee2..dc084780bd775 100644 --- a/mingw-w64-python/0040-build-link-win-resource-files-and-build-pythonw.patch +++ b/mingw-w64-python/0040-build-link-win-resource-files-and-build-pythonw.patch @@ -1,4 +1,4 @@ -From f01f0889085c2cf4785c87b9583999966e113b0f Mon Sep 17 00:00:00 2001 +From 54773f759a328d7b587876b330595bae113a028d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:16 +0530 Subject: [PATCH 040/N] build: link win resource files and build pythonw @@ -8,12 +8,14 @@ Content-Transfer-Encoding: 8bit Co-authored-by: Алексей --- - Makefile.pre.in | 26 +++++++++++++++++++++----- - configure.ac | 27 +++++++++++++++++++++++++++ - 2 files changed, 48 insertions(+), 5 deletions(-) + Makefile.pre.in | 27 ++++++++++++++++++++++----- + PC/python_exe.rc | 2 +- + PC/pythonw_exe.rc | 2 +- + configure.ac | 27 +++++++++++++++++++++++++++ + 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 2af2bee..d791660 100644 +index 9341d30..b4c8c76 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -38,6 +38,7 @@ CC= @CC@ @@ -23,8 +25,8 @@ index 2af2bee..d791660 100644 +WINDRES= @WINDRES@ READELF= @READELF@ SOABI= @SOABI@ - LDVERSION= @LDVERSION@ -@@ -124,6 +125,7 @@ PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE + ABIFLAGS= @ABIFLAGS@ +@@ -126,6 +127,7 @@ PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) # Strict or non-strict aliasing flags used to compile dtoa.c, see above CFLAGS_ALIASING=@CFLAGS_ALIASING@ @@ -32,7 +34,7 @@ index 2af2bee..d791660 100644 # Machine-dependent subdirectories -@@ -286,6 +288,7 @@ LIBOBJS= @LIBOBJS@ +@@ -301,6 +303,7 @@ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) BUILDPYTHON= python$(BUILDEXE) @@ -40,18 +42,18 @@ index 2af2bee..d791660 100644 HOSTRUNNER= @HOSTRUNNER@ -@@ -622,7 +625,7 @@ all: @DEF_MAKE_ALL_RULE@ - .PHONY: all +@@ -703,7 +706,7 @@ list-targets: + @grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}' .PHONY: build_all --build_all: check-clean-src $(BUILDPYTHON) platform sharedmods \ -+build_all: check-clean-src $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \ +-build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \ ++build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \ gdbhooks Programs/_testembed scripts checksharedmods rundsymutil .PHONY: build_wasm -@@ -789,9 +792,21 @@ coverage-report: regen-token regen-frozen - clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) +@@ -884,9 +887,21 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c + clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $(srcdir)/Lib/test/clinic.test.c +python_exe.o: $(srcdir)/PC/python_exe.rc + $(WINDRES) $(RCFLAGS) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_exe.rc $@ @@ -73,7 +75,7 @@ index 2af2bee..d791660 100644 platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform -@@ -880,10 +895,10 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ +@@ -992,10 +1007,10 @@ $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK): \ # This rule builds the Cygwin Python DLL and import library if configured # for a shared core library; otherwise, this rule is a noop. @@ -82,23 +84,50 @@ index 2af2bee..d791660 100644 if test -n "$(DLLLIBRARY)"; then \ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ - $(LIBS) $(MODLIBS) $(SYSLIBS); \ -+ $(LIBS) $(MODLIBS) $(SYSLIBS) python_nt.o; \ ++ $(LIBS) $(LDFLAGS_NODIST) $(MODLIBS) $(SYSLIBS); \ else true; \ fi -@@ -1979,6 +1994,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ +@@ -2210,6 +2225,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ done if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ + $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \ ++ $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \ else \ $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ fi +diff --git a/PC/python_exe.rc b/PC/python_exe.rc +index c3d3bff..0d8531d 100644 +--- a/PC/python_exe.rc ++++ b/PC/python_exe.rc +@@ -12,7 +12,7 @@ + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" + +-1 ICON DISCARDABLE "icons\python.ico" ++1 ICON DISCARDABLE "icons/python.ico" + + + ///////////////////////////////////////////////////////////////////////////// +diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc +index 38570b7..b879a0f 100644 +--- a/PC/pythonw_exe.rc ++++ b/PC/pythonw_exe.rc +@@ -12,7 +12,7 @@ + // current versions of Windows. + 1 RT_MANIFEST "python.manifest" + +-1 ICON DISCARDABLE "icons\pythonw.ico" ++1 ICON DISCARDABLE "icons/pythonw.ico" + + + ///////////////////////////////////////////////////////////////////////////// diff --git a/configure.ac b/configure.ac -index 1c8d1e7..af1f711 100644 +index e2fab3f..58e5ad1 100644 --- a/configure.ac +++ b/configure.ac -@@ -1762,6 +1762,10 @@ AC_SUBST([LINK_PYTHON_OBJS]) +@@ -1794,6 +1794,10 @@ AC_SUBST([LINK_PYTHON_OBJS]) AC_SUBST([AR]) AC_CHECK_TOOLS([AR], [ar aal], [ar]) @@ -109,10 +138,10 @@ index 1c8d1e7..af1f711 100644 # tweak ARFLAGS only if the user didn't set it on the command line AC_SUBST([ARFLAGS]) if test -z "$ARFLAGS" -@@ -7108,10 +7112,33 @@ AC_MSG_RESULT([done]) +@@ -7455,10 +7459,33 @@ AC_MSG_RESULT([done]) case $host in *-*-mingw*) - LIBS="$LIBS -lversion -lshlwapi -lpathcch" + LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt" + AC_PROG_AWK + if test "$AWK" = "gawk"; then + awk_extra_flag="--non-decimal-data" diff --git a/mingw-w64-python/0041-fix-isselectable.patch b/mingw-w64-python/0041-pycore_fileutils-add-MINGW-support.patch similarity index 56% rename from mingw-w64-python/0041-fix-isselectable.patch rename to mingw-w64-python/0041-pycore_fileutils-add-MINGW-support.patch index a096c698ca1f6..6bba76f4dadac 100644 --- a/mingw-w64-python/0041-fix-isselectable.patch +++ b/mingw-w64-python/0041-pycore_fileutils-add-MINGW-support.patch @@ -1,22 +1,22 @@ -From 32e36bc1162c71b0f9a444645fb2f9c94c9a9c1d Mon Sep 17 00:00:00 2001 +From acfc6c0d0a5558caa1f9d973bf822c287ad653ed Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:18 +0530 -Subject: [PATCH 041/N] fix isselectable +Subject: [PATCH 041/N] pycore_fileutils: add MINGW support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Алексей --- - Include/fileobject.h | 2 +- + Include/internal/pycore_fileutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/Include/fileobject.h b/Include/fileobject.h -index 2deef54..ae4bdac 100644 ---- a/Include/fileobject.h -+++ b/Include/fileobject.h -@@ -30,7 +30,7 @@ Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UTF8Mode; - #endif +diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h +index 13f86b0..51386b0 100644 +--- a/Include/internal/pycore_fileutils.h ++++ b/Include/internal/pycore_fileutils.h +@@ -12,7 +12,7 @@ extern "C" { + /* A routine to check if a file descriptor can be select()-ed. */ -#ifdef _MSC_VER diff --git a/mingw-w64-python/0042-configure.ac-fix-inet_pton-check.patch b/mingw-w64-python/0042-configure-fix-inet_pton-check.patch similarity index 75% rename from mingw-w64-python/0042-configure.ac-fix-inet_pton-check.patch rename to mingw-w64-python/0042-configure-fix-inet_pton-check.patch index 25b227e0489d8..8ea42ee9571b6 100644 --- a/mingw-w64-python/0042-configure.ac-fix-inet_pton-check.patch +++ b/mingw-w64-python/0042-configure-fix-inet_pton-check.patch @@ -1,7 +1,7 @@ -From 4f10cdb8782deabae69e1140e184183c55ad146b Mon Sep 17 00:00:00 2001 +From 3704c49c1688907b7cba459d3ad0c48791548f4e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:23 +0530 -Subject: [PATCH 042/N] configure.ac: fix inet_pton check +Subject: [PATCH 042/N] configure: fix inet_pton check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -12,10 +12,10 @@ Co-authored-by: Алексей 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index af1f711..87e8fc6 100644 +index 58e5ad1..408fcda 100644 --- a/configure.ac +++ b/configure.ac -@@ -5403,10 +5403,14 @@ PY_CHECK_NETDB_FUNC([getprotobyname]) +@@ -5712,10 +5712,14 @@ PY_CHECK_NETDB_FUNC([getprotobyname]) dnl PY_CHECK_SOCKET_FUNC(FUNCTION) AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [ diff --git a/mingw-w64-python/0045-importlib-bootstrap-path-sep.patch b/mingw-w64-python/0043-importlib-bootstrap-path-sep.patch similarity index 82% rename from mingw-w64-python/0045-importlib-bootstrap-path-sep.patch rename to mingw-w64-python/0043-importlib-bootstrap-path-sep.patch index bff63261483b9..15e59761b0ceb 100644 --- a/mingw-w64-python/0045-importlib-bootstrap-path-sep.patch +++ b/mingw-w64-python/0043-importlib-bootstrap-path-sep.patch @@ -1,7 +1,7 @@ -From 4d35d4620d6830c93ff75b650acf208bcd731f64 Mon Sep 17 00:00:00 2001 +From d66cb92c111f7e22aec1d63b45816361ab9ebe21 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 17 Jun 2021 18:52:30 +0530 -Subject: [PATCH 045/N] importlib bootstrap path sep +Subject: [PATCH 043/N] importlib: bootstrap path sep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -13,7 +13,7 @@ Co-authored-by: Naveen M K 1 file changed, 4 insertions(+) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py -index 9b8a8df..1fbbc55 100644 +index 41f538a..93040cc 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -42,6 +42,10 @@ if _MS_WINDOWS: @@ -21,7 +21,7 @@ index 9b8a8df..1fbbc55 100644 else: path_separators = ['/'] + -+if 'MSYSTEM' in _os.environ: ++if sys._use_alt_sep: + path_separators = path_separators[::-1] + # Assumption made in _path_join() diff --git a/mingw-w64-python/0043-pass-gen-profile-ldflags.patch b/mingw-w64-python/0043-pass-gen-profile-ldflags.patch deleted file mode 100644 index 7fd4ae0fca621..0000000000000 --- a/mingw-w64-python/0043-pass-gen-profile-ldflags.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0c9d32752bdab2a27c42f2aeca9103d8d1a2fcd5 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Thu, 17 Jun 2021 18:52:27 +0530 -Subject: [PATCH 043/N] pass gen profile ldflags -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Алексей ---- - Makefile.pre.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index d791660..db921e5 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -898,7 +898,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ - $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o - if test -n "$(DLLLIBRARY)"; then \ - $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ -- $(LIBS) $(MODLIBS) $(SYSLIBS) python_nt.o; \ -+ $(LIBS) $(LDFLAGS_NODIST) $(MODLIBS) $(SYSLIBS) python_nt.o; \ - else true; \ - fi - diff --git a/mingw-w64-python/0049-configure.ac-set-MINGW-stack-reserve.patch b/mingw-w64-python/0044-configure-set-MINGW-stack-reserve.patch similarity index 70% rename from mingw-w64-python/0049-configure.ac-set-MINGW-stack-reserve.patch rename to mingw-w64-python/0044-configure-set-MINGW-stack-reserve.patch index af90aee656da1..6db5b9702f92c 100644 --- a/mingw-w64-python/0049-configure.ac-set-MINGW-stack-reserve.patch +++ b/mingw-w64-python/0044-configure-set-MINGW-stack-reserve.patch @@ -1,17 +1,18 @@ -From f598b5abe85b03030a4586cbf4425e338576f193 Mon Sep 17 00:00:00 2001 +From 7a0e0c4be51934d9837a8b348075314f2ee60383 Mon Sep 17 00:00:00 2001 From: jeremyd2019 <4524874+jeremyd2019@users.noreply.github.com> Date: Thu, 17 Jun 2021 18:52:37 +0530 -Subject: [PATCH 049/N] configure.ac: set MINGW stack reserve +Subject: [PATCH 044/N] configure: set MINGW stack reserve +to match the MSVC build --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac -index 6ac5799..18d5f41 100644 +index 408fcda..b3516c7 100644 --- a/configure.ac +++ b/configure.ac -@@ -3746,6 +3746,11 @@ then +@@ -3844,6 +3844,11 @@ then VxWorks*) LINKFORSHARED='-Wl,-export-dynamic';; esac diff --git a/mingw-w64-python/0044-pkg-config-windows-must-link-ext-with-python-lib.patch b/mingw-w64-python/0044-pkg-config-windows-must-link-ext-with-python-lib.patch deleted file mode 100644 index cfc465f158053..0000000000000 --- a/mingw-w64-python/0044-pkg-config-windows-must-link-ext-with-python-lib.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 08294f9fd95e351c6e7f048c0fcf76665ceb8824 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:29 +0530 -Subject: [PATCH 044/N] pkg config windows must link ext with python lib - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 87e8fc6..6843218 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6284,7 +6284,7 @@ AC_MSG_RESULT([$LDVERSION]) - - # On Android and Cygwin the shared libraries must be linked with libpython. - AC_SUBST([LIBPYTHON]) --if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then -+if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin" || test "$MACHDEP" = "win32"); then - LIBPYTHON="-lpython${VERSION}${ABIFLAGS}" - else - LIBPYTHON='' diff --git a/mingw-w64-python/0054-tests-fix-test_bytes.patch b/mingw-w64-python/0045-tests-fix-test_bytes.patch similarity index 77% rename from mingw-w64-python/0054-tests-fix-test_bytes.patch rename to mingw-w64-python/0045-tests-fix-test_bytes.patch index fda1f3258ada9..bd5f9c92ebb3b 100644 --- a/mingw-w64-python/0054-tests-fix-test_bytes.patch +++ b/mingw-w64-python/0045-tests-fix-test_bytes.patch @@ -1,7 +1,7 @@ -From 30836e7f007c363a25d2173dd527331a53eab0de Mon Sep 17 00:00:00 2001 +From 4390187189423a3cd3676ec806c71a8a8c9e3f7a Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 23 Jul 2021 08:51:32 +0200 -Subject: [PATCH 054/N] tests: fix test_bytes +Subject: [PATCH 045/N] tests: fix test_bytes %p has different casing with mingw-w64, but it's implementation defined. Change the test to the mingw-w64 variant. @@ -10,10 +10,10 @@ Change the test to the mingw-w64 variant. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py -index b27d436..f18d38c 100644 +index 2b4705a..27b6aaa 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py -@@ -1168,7 +1168,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase): +@@ -1186,7 +1186,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase): if os.name == 'nt': # Windows (MSCRT) diff --git a/mingw-w64-python/0046-timemodule-add-MINGW-support.patch b/mingw-w64-python/0046-timemodule-add-MINGW-support.patch new file mode 100644 index 0000000000000..da6b140f62cb3 --- /dev/null +++ b/mingw-w64-python/0046-timemodule-add-MINGW-support.patch @@ -0,0 +1,31 @@ +From 0df58ccba1310dcb9e6463f6b3f7e53bdf648e7d Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 23 Jul 2021 08:52:50 +0200 +Subject: [PATCH 046/N] timemodule: add MINGW support + +--- + Modules/timemodule.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Modules/timemodule.c b/Modules/timemodule.c +index 49626d3..0d071ea 100644 +--- a/Modules/timemodule.c ++++ b/Modules/timemodule.c +@@ -41,7 +41,7 @@ + # include + #endif + +-#ifdef _MSC_VER ++#ifdef MS_WINDOWS + # define _Py_timezone _timezone + # define _Py_daylight _daylight + # define _Py_tzname _tzname +@@ -892,7 +892,7 @@ time_strftime(PyObject *module, PyObject *args) + // + // Android works with negative years on the emulator, but fails on some + // physical devices (#123017). +-#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) \ ++#if defined(MS_WINDOWS) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) \ + || defined(__VXWORKS__) || defined(__ANDROID__) + if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) { + PyErr_SetString(PyExc_ValueError, diff --git a/mingw-w64-python/0046-warnings-fixes.patch b/mingw-w64-python/0046-warnings-fixes.patch deleted file mode 100644 index 85c406b8f4b3b..0000000000000 --- a/mingw-w64-python/0046-warnings-fixes.patch +++ /dev/null @@ -1,94 +0,0 @@ -From e72a2378f85356a22c9be846593c262d68b61b7d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:33 +0530 -Subject: [PATCH 046/N] warnings fixes - ---- - Modules/_winapi.c | 2 +- - Modules/posixmodule.c | 2 +- - Modules/socketmodule.h | 2 ++ - PC/python_exe.rc | 2 +- - PC/pythonw_exe.rc | 2 +- - PC/winreg.c | 1 + - 6 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/Modules/_winapi.c b/Modules/_winapi.c -index b5d1468..abb32f0 100644 ---- a/Modules/_winapi.c -+++ b/Modules/_winapi.c -@@ -1127,7 +1127,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list) - DWORD err; - BOOL result; - PyObject *value; -- Py_ssize_t handle_list_size; -+ Py_ssize_t handle_list_size = 0; - DWORD attribute_count = 0; - SIZE_T attribute_list_size = 0; - -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 51b3e52..b326a14 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -6280,7 +6280,7 @@ os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns, - /*[clinic end generated code: output=cfcac69d027b82cf input=2fbd62a2f228f8f4]*/ - { - #ifdef MS_WINDOWS -- HANDLE hFile; -+ HANDLE hFile = 0; - FILETIME atime, mtime; - #else - int result; -diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index f5ca004..1e92327 100644 ---- a/Modules/socketmodule.h -+++ b/Modules/socketmodule.h -@@ -68,8 +68,10 @@ struct SOCKADDR_BTH_REDEF { - */ - # ifdef SIO_GET_MULTICAST_FILTER - # include /* for SIO_RCVALL */ -+#ifndef __MINGW32__ /* resolve by configure */ - # define HAVE_ADDRINFO - # define HAVE_SOCKADDR_STORAGE -+#endif - # define HAVE_GETADDRINFO - # define HAVE_GETNAMEINFO - # define ENABLE_IPV6 -diff --git a/PC/python_exe.rc b/PC/python_exe.rc -index c3d3bff..dde0e53 100644 ---- a/PC/python_exe.rc -+++ b/PC/python_exe.rc -@@ -12,7 +12,7 @@ - // current versions of Windows. - 1 RT_MANIFEST "python.manifest" - --1 ICON DISCARDABLE "icons\python.ico" -+1 ICON DISCARDABLE "icons/python.ico" - - - ///////////////////////////////////////////////////////////////////////////// -diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc -index 38570b7..7ce1043 100644 ---- a/PC/pythonw_exe.rc -+++ b/PC/pythonw_exe.rc -@@ -12,7 +12,7 @@ - // current versions of Windows. - 1 RT_MANIFEST "python.manifest" - --1 ICON DISCARDABLE "icons\pythonw.ico" -+1 ICON DISCARDABLE "icons/pythonw.ico" - - - ///////////////////////////////////////////////////////////////////////////// -diff --git a/PC/winreg.c b/PC/winreg.c -index 368291d..33ec8ff 100644 ---- a/PC/winreg.c -+++ b/PC/winreg.c -@@ -831,6 +831,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ) - case REG_BINARY: - /* ALSO handle ALL unknown data types here. Even if we can't - support it natively, we should handle the bits. */ -+ /* fallthrough */ - default: - if (retDataSize == 0) { - obData = Py_NewRef(Py_None); diff --git a/mingw-w64-python/0057-build-Disable-checks-for-dlopen-dlfcn.patch b/mingw-w64-python/0047-configure-Disable-checks-for-dlopen-dlfcn.patch similarity index 67% rename from mingw-w64-python/0057-build-Disable-checks-for-dlopen-dlfcn.patch rename to mingw-w64-python/0047-configure-Disable-checks-for-dlopen-dlfcn.patch index 0c6c0df44b5c7..a4bf624cc9901 100644 --- a/mingw-w64-python/0057-build-Disable-checks-for-dlopen-dlfcn.patch +++ b/mingw-w64-python/0047-configure-Disable-checks-for-dlopen-dlfcn.patch @@ -1,28 +1,28 @@ -From 0a7778d7bcf908304c939705106c3ec8c3699c2e Mon Sep 17 00:00:00 2001 +From b2ba7513dfaff2b1da32c82a1a4abcb068e1c324 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 25 Jul 2021 13:54:12 +0200 -Subject: [PATCH 057/N] build: Disable checks for dlopen/dlfcn +Subject: [PATCH 047/N] configure: Disable checks for dlopen/dlfcn While it is (potentially) available with mingw we don't want to use it, so skip any checks for it. --- - configure.ac | 21 ++++++++++++++++++--- - 1 file changed, 18 insertions(+), 3 deletions(-) + configure.ac | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac -index a566bba..d3b8dbf 100644 +index b3516c7..6752a59 100644 --- a/configure.ac +++ b/configure.ac -@@ -3058,7 +3058,7 @@ AC_DEFINE([STDC_HEADERS], [1], +@@ -3153,7 +3153,7 @@ AC_DEFINE([STDC_HEADERS], [1], # checks for header files AC_CHECK_HEADERS([ \ -- alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ -+ alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ +- alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ ++ alloca.h asm/types.h bluetooth.h conio.h direct.h endian.h errno.h fcntl.h grp.h \ + io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pty.h \ -@@ -3070,6 +3070,13 @@ AC_CHECK_HEADERS([ \ +@@ -3165,6 +3165,12 @@ AC_CHECK_HEADERS([ \ sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h sys/xattr.h sysexits.h syslog.h \ termios.h util.h utime.h utmp.h \ ]) @@ -31,12 +31,11 @@ index a566bba..d3b8dbf 100644 + *-*-mingw*) ;; + *) AC_CHECK_HEADERS([dlfcn.h]);; +esac -+ + AC_HEADER_DIRENT AC_HEADER_MAJOR -@@ -3815,7 +3822,12 @@ AC_SUBST([PERF_TRAMPOLINE_OBJ]) +@@ -3913,7 +3919,12 @@ AC_SUBST([PERF_TRAMPOLINE_OBJ]) # checks for libraries AC_CHECK_LIB([sendfile], [sendfile]) @@ -50,7 +49,7 @@ index a566bba..d3b8dbf 100644 AC_CHECK_LIB([dld], [shl_load]) # Dynamic linking for HP-UX -@@ -6159,7 +6171,10 @@ AS_VAR_IF([ac_cv_broken_sem_getvalue], [yes], [ +@@ -6449,7 +6460,10 @@ AS_VAR_IF([ac_cv_broken_sem_getvalue], [yes], [ ) ]) diff --git a/mingw-w64-python/0047-fix-build-testinternalcapi.patch b/mingw-w64-python/0047-fix-build-testinternalcapi.patch deleted file mode 100644 index 5bb5231dac821..0000000000000 --- a/mingw-w64-python/0047-fix-build-testinternalcapi.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 114ac5e4c236fd3e0deb3a14071e5369dbc7880a Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sat, 17 Jun 2023 00:21:25 +0530 -Subject: [PATCH 047/N] fix build testinternalcapi - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 6843218..6ac5799 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7912,7 +7912,7 @@ PY_STDLIB_MOD([_overlapped], [test "$MACHDEP" = "win32"], [], [], - dnl test modules - PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes]) - PY_STDLIB_MOD([_testclinic], [test "$TEST_MODULES" = yes]) --PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes]) -+PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes], [], [-DPY3_DLLNAME="\"$DLLLIBRARY\""], []) - PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes]) - PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) - PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) diff --git a/mingw-w64-python/0048-clang-arm64.patch b/mingw-w64-python/0048-clang-arm64.patch deleted file mode 100644 index 6f301885111c4..0000000000000 --- a/mingw-w64-python/0048-clang-arm64.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 852ade1e64a07991efc2d76c87cae3a51a9e3bf1 Mon Sep 17 00:00:00 2001 -From: jeremyd2019 <4524874+jeremyd2019@users.noreply.github.com> -Date: Thu, 17 Jun 2021 18:52:36 +0530 -Subject: [PATCH 048/N] clang arm64 - -Co-authored-by: Naveen M K ---- - Python/getcompiler.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/Python/getcompiler.c b/Python/getcompiler.c -index 3e31c80..7e7be71 100644 ---- a/Python/getcompiler.c -+++ b/Python/getcompiler.c -@@ -7,7 +7,7 @@ - - // Note the __clang__ conditional has to come before the __GNUC__ one because - // clang pretends to be GCC. --#if defined(__clang__) -+#if defined(__clang__) && !defined(_WIN32) - #define COMPILER "[Clang " __clang_version__ "]" - #elif defined(__GNUC__) - /* To not break compatibility with things that determine -@@ -18,6 +18,8 @@ - #define COMP_SEP " " - #if defined(__x86_64__) - #define ARCH_SUFFIX " 64 bit (AMD64)" -+#elif defined(__aarch64__) -+#define ARCH_SUFFIX " 64 bit (ARM64)" - #else - #define ARCH_SUFFIX " 32 bit" - #endif -@@ -25,7 +27,14 @@ - #define COMP_SEP "\n" - #define ARCH_SUFFIX "" - #endif -+#if defined(__clang__) -+#define str(x) #x -+#define xstr(x) str(x) -+#define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \ -+ xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]" -+#else - #define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]" -+#endif - // Generic fallbacks. - #elif defined(__cplusplus) - #define COMPILER "[C++]" diff --git a/mingw-w64-python/0094-Build-venvlauncher.exe-from-PC-launcher.c.patch b/mingw-w64-python/0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch similarity index 67% rename from mingw-w64-python/0094-Build-venvlauncher.exe-from-PC-launcher.c.patch rename to mingw-w64-python/0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch index 5427f58b70089..405b1510c375e 100644 --- a/mingw-w64-python/0094-Build-venvlauncher.exe-from-PC-launcher.c.patch +++ b/mingw-w64-python/0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch @@ -1,24 +1,50 @@ -From cda1f3666796290ea37cc84806ac03ebde4a945d Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 25 Jun 2023 17:26:55 +0530 -Subject: [PATCH 094/N] Build venvlauncher.exe from PC/launcher.c +From 48f99ead337b1c08215a9b01cddbaa5105c3e5bf Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 25 Jul 2021 16:53:35 +0200 +Subject: [PATCH 048/N] venvlauncher: Build venvlauncher.exe from + PC/launcher.c - Use function available in original msvcrt.dll _wdupenv_s -> _wgetenv_s fread_s -> fread - Add a test for checking the new launchers --- - Makefile.pre.in | 20 ++++++++++++-------- - PC/launcher.c | 29 +++++++++++++++++------------ - PC/pylauncher.rc | 20 ++++++++++---------- - mingw_smoketests.py | 12 ++++++++++++ - 4 files changed, 51 insertions(+), 30 deletions(-) + Makefile.pre.in | 23 ++++++++++++++++++++--- + PC/launcher.c | 29 +++++++++++++++++------------ + PC/pylauncher.rc | 18 +++++++++--------- + 3 files changed, 46 insertions(+), 24 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 1b48cd2..2d2a64f 100644 +index b4c8c76..a986206 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -808,6 +808,12 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.rc +@@ -170,6 +170,7 @@ BINLIBDEST= @BINLIBDEST@ + LIBDEST= $(SCRIPTDIR)/python$(VERSION)$(ABI_THREAD) + INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION) + CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) ++VENVLAUNCHERDIR= $(BINLIBDEST)/venv/scripts/nt + + # Symbols used for using shared libraries + SHLIB_SUFFIX= @SHLIB_SUFFIX@ +@@ -304,6 +305,8 @@ LIBOBJS= @LIBOBJS@ + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) + BUILDPYTHONW= pythonw$(BUILDEXE) ++BUILDVENVLAUNCHER= venvlauncher$(BUILDEXE) ++BUILDVENVWLAUNCHER= venvwlauncher$(BUILDEXE) + + HOSTRUNNER= @HOSTRUNNER@ + +@@ -706,7 +709,7 @@ list-targets: + @grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}' + + .PHONY: build_all +-build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \ ++build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \ + gdbhooks Programs/_testembed scripts checksharedmods rundsymutil + + .PHONY: build_wasm +@@ -896,6 +899,12 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.rc python_nt.o: $(srcdir)/PC/python_nt.rc $(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@ @@ -31,37 +57,48 @@ index 1b48cd2..2d2a64f 100644 $(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw_exe.o $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -mwindows -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) pythonw_exe.o -@@ -815,13 +821,11 @@ $(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw +@@ -903,6 +912,12 @@ $(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o --# FIXME: build these from PC/launcher.c instead --$(BUILDVENVLAUNCHER): $(BUILDPYTHON) -- cp $(BUILDPYTHON) $(BUILDVENVLAUNCHER) +$(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o $(srcdir)/PC/launcher.c + $(LINKCC) -D_CONSOLE -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion - --# FIXME: build these from PC/launcher.c instead --$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) -- cp $(BUILDPYTHONW) $(BUILDVENVWLAUNCHER) ++ +$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) venvwlauncher.o $(srcdir)/PC/launcher.c + $(LINKCC) -D_WINDOWS -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion - ++ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform -@@ -2010,8 +2014,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ - if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ + +@@ -2215,7 +2230,7 @@ sharedinstall: all + # This goes into $(exec_prefix) + .PHONY: altbininstall + altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ +- @for i in $(BINDIR) $(LIBDIR); \ ++ @for i in $(BINDIR) $(LIBDIR) $(VENVLAUNCHERDIR); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ +@@ -2227,6 +2242,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \ -- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(EXE); \ -- $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(EXE); \ -+ $(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(EXE); \ -+ $(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(EXE); \ + $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \ ++ $(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVLAUNCHER); \ ++ $(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVWLAUNCHER); \ else \ $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ fi +@@ -2373,7 +2390,7 @@ LIBSUBDIRS= asyncio \ + turtledemo \ + unittest \ + urllib \ +- venv venv/scripts venv/scripts/common venv/scripts/posix \ ++ venv venv/scripts venv/scripts/common venv/scripts/posix venv/scripts/nt \ + wsgiref \ + $(XMLLIBSUBDIRS) \ + xmlrpc \ diff --git a/PC/launcher.c b/PC/launcher.c -index dc26553..14d8b8f 100644 +index 8e60ab9..796bf73 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -924,7 +924,7 @@ static COMMAND path_command; @@ -107,7 +144,7 @@ index dc26553..14d8b8f 100644 } } return result; -@@ -1912,7 +1917,7 @@ process(int argc, wchar_t ** argv) +@@ -1913,7 +1918,7 @@ process(int argc, wchar_t ** argv) if (_wfopen_s(&f, venv_cfg_path, L"r")) { error(RC_BAD_VENV_CFG, L"Cannot read '%ls'", venv_cfg_path); } @@ -117,7 +154,7 @@ index dc26553..14d8b8f 100644 fclose(f); diff --git a/PC/pylauncher.rc b/PC/pylauncher.rc -index 1186264..84b2917 100644 +index 1186264..3926e8a 100644 --- a/PC/pylauncher.rc +++ b/PC/pylauncher.rc @@ -12,17 +12,17 @@ @@ -147,33 +184,3 @@ index 1186264..84b2917 100644 #endif 1 USAGE "launcher-usage.txt" -@@ -64,4 +64,4 @@ BEGIN - BEGIN - VALUE "Translation", 0x0, 1200 - END --END -\ No newline at end of file -+END -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 2a8bd16..00601f9 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -194,6 +194,18 @@ class Tests(unittest.TestCase): - assert os.path.exists(os.path.join(tmp, "bin", "python3.exe")) - subprocess.check_call([shutil.which("bash.exe"), os.path.join(tmp, "bin", "activate")]) - -+ # This will not work in in-tree build -+ if not sysconfig.is_python_build(): -+ op = subprocess.check_output( -+ [ -+ os.path.join(tmp, "bin", "python.exe"), -+ "-c", -+ "print('Hello World')" -+ ], -+ cwd=tmp, -+ ) -+ assert op.decode().strip() == "Hello World" -+ - def test_has_mktime(self): - from time import mktime, gmtime - mktime(gmtime()) diff --git a/mingw-w64-python/0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch b/mingw-w64-python/0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch similarity index 91% rename from mingw-w64-python/0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch rename to mingw-w64-python/0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch index 24280b65547e3..717f2042f0b72 100644 --- a/mingw-w64-python/0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch +++ b/mingw-w64-python/0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch @@ -1,7 +1,7 @@ -From 963fcc79deb13b8ef3aefc42eef8e18f6897f41c Mon Sep 17 00:00:00 2001 +From 8fbc1e5fafb87dc9487d522688a53a8c60f59b0f Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 23 Dec 2024 06:03:11 +0100 -Subject: [PATCH 120/N] venvlauncher: try looking for the versioned .exe +Subject: [PATCH 049/N] venvlauncher: try looking for the versioned .exe first and then fall back By default venvlauncher only looks for python.exe in the python "home", @@ -23,10 +23,10 @@ fall back to python.exe. 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index e9ded19..68fbe7b 100644 +index a986206..68c7c4c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -827,10 +827,10 @@ $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o +@@ -913,10 +913,10 @@ $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o $(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o $(srcdir)/PC/launcher.c @@ -40,10 +40,10 @@ index e9ded19..68fbe7b 100644 platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform diff --git a/PC/launcher.c b/PC/launcher.c -index 14d8b8f..ee76004 100644 +index 796bf73..6c8cd76 100644 --- a/PC/launcher.c +++ b/PC/launcher.c -@@ -1930,7 +1930,8 @@ process(int argc, wchar_t ** argv) +@@ -1931,7 +1931,8 @@ process(int argc, wchar_t ** argv) if (!cch) { error(0, L"Cannot determine memory for home path"); } @@ -53,7 +53,7 @@ index 14d8b8f..ee76004 100644 executable = (wchar_t *)malloc(cch * sizeof(wchar_t)); if (executable == NULL) { error(RC_NO_MEMORY, L"A memory allocation failed"); -@@ -1948,13 +1949,22 @@ process(int argc, wchar_t ** argv) +@@ -1949,13 +1950,22 @@ process(int argc, wchar_t ** argv) executable[cch_actual++] = L'\\'; executable[cch_actual] = L'\0'; } diff --git a/mingw-w64-python/0050-Don-t-use-os.pathsep-to-find-EOF.patch b/mingw-w64-python/0050-Don-t-use-os.pathsep-to-find-EOF.patch deleted file mode 100644 index ec1aa8a84eedb..0000000000000 --- a/mingw-w64-python/0050-Don-t-use-os.pathsep-to-find-EOF.patch +++ /dev/null @@ -1,24 +0,0 @@ -From a1d212c2c4954021002cc8692a0cbd11ee63baa0 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Fri, 18 Jun 2021 12:38:11 +0530 -Subject: [PATCH 050/N] Don't use os.pathsep to find EOF not all - distributions in win32 have them as \ instead check using sys.platform - -Signed-off-by: Naveen M K ---- - Lib/site.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Lib/site.py b/Lib/site.py -index fadfccf..938b0a2 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -419,7 +419,7 @@ def setquit(): - The repr of each object contains a hint at how it works. - - """ -- if os.sep == '\\': -+ if sys.platform == 'win32': - eof = 'Ctrl-Z plus Return' - else: - eof = 'Ctrl-D (i.e. EOF)' diff --git a/mingw-w64-python/0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch b/mingw-w64-python/0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch new file mode 100644 index 0000000000000..ee579f2433dd2 --- /dev/null +++ b/mingw-w64-python/0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch @@ -0,0 +1,30 @@ +From eb1eb4b3ef0d509ccea2c478c82c38d224fb65f4 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 29 Aug 2025 14:03:35 +0300 +Subject: [PATCH 050/N] venvlauncher: Skip find python in Registry for mingw + builds + +--- + PC/launcher.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/PC/launcher.c b/PC/launcher.c +index 6c8cd76..ffd7f7e 100644 +--- a/PC/launcher.c ++++ b/PC/launcher.c +@@ -499,6 +499,7 @@ locate_all_pythons(void) + { + /* venv Python is highest priority */ + locate_venv_python(); ++#ifndef __MINGW32__ + #if defined(_M_X64) + /* If we are a 64bit process, first hit the 32bit keys. */ + debug(L"locating Pythons in 32bit registry\n"); +@@ -519,6 +520,7 @@ locate_all_pythons(void) + locate_pythons_for_key(HKEY_LOCAL_MACHINE, KEY_READ); + /* Store-installed Python is lowest priority */ + locate_store_pythons(); ++#endif + qsort(installed_pythons, num_installed_pythons, sizeof(INSTALLED_PYTHON), + compare_pythons); + } diff --git a/mingw-w64-python/0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch b/mingw-w64-python/0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch deleted file mode 100644 index 2eac88296f2b3..0000000000000 --- a/mingw-w64-python/0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch +++ /dev/null @@ -1,179 +0,0 @@ -From 3033d58f6f38cba3c977775715b28503f0d221ef Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Wed, 23 Jun 2021 18:12:12 +0530 -Subject: [PATCH 051/N] Fix extension suffix for c-extensions on mingw - -Python is compiled with various compilers which previously -had same platform tags or extension suffix. This can be error -prone while loading c-extensions, so now each compiler or -runtime has a different extension suffix. - -Also, changed all extension to end with .pyd rather than -.dll file. - -Fixes https://github.com/msys2/MINGW-packages/issues/8843 - -Signed-off-by: Naveen M K ---- - Makefile.pre.in | 6 ++-- - Python/dynload_win.c | 6 ---- - configure.ac | 77 +++++++++++++++++++++++++++++++++++++++----- - 3 files changed, 72 insertions(+), 17 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index db921e5..cfe8634 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -174,6 +174,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) - # Symbols used for using shared libraries - SHLIB_SUFFIX= @SHLIB_SUFFIX@ - EXT_SUFFIX= @EXT_SUFFIX@ -+PYD_PLATFORM_TAG = @PYD_PLATFORM_TAG@ - LDSHARED= @LDSHARED@ $(PY_LDFLAGS) - BLDSHARED= @BLDSHARED@ $(PY_CORE_LDFLAGS) - LDCXXSHARED= @LDCXXSHARED@ $(PY_LDFLAGS) -@@ -1403,8 +1404,7 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile - - Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile - $(CC) -c $(PY_CORE_CFLAGS) \ -- -DSHLIB_SUFFIX='"$(SHLIB_SUFFIX)"' \ -- -DEXT_SUFFIX='"$(EXT_SUFFIX)"' \ -+ -DPYD_PLATFORM_TAG='"$(PYD_PLATFORM_TAG)"' \ - -o $@ $(srcdir)/Python/dynload_win.c - - Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h -@@ -2483,7 +2483,7 @@ libainstall: all scripts - @if test "$(STATIC_LIBPYTHON)" = 1; then \ - if test -d $(LIBRARY); then :; else \ - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ -- if test "$(SHLIB_SUFFIX)" = .dll; then \ -+ if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ -diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index 4bb90ba..26d6036 100644 ---- a/Python/dynload_win.c -+++ b/Python/dynload_win.c -@@ -29,12 +29,6 @@ - #define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd" - - const char *_PyImport_DynLoadFiletab[] = { --#ifdef EXT_SUFFIX -- EXT_SUFFIX, /* include SOABI flags where is encoded debug */ --#endif --#ifdef SHLIB_SUFFIX -- "-abi" PYTHON_ABI_STRING SHLIB_SUFFIX, --#endif - PYD_TAGGED_SUFFIX, - PYD_UNTAGGED_SUFFIX, - NULL -diff --git a/configure.ac b/configure.ac -index 18d5f41..19b866a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3488,7 +3488,7 @@ if test -z "$SHLIB_SUFFIX"; then - *) SHLIB_SUFFIX=.so;; - esac - case $host_os in -- mingw*) SHLIB_SUFFIX=.dll;; -+ mingw*) SHLIB_SUFFIX=.pyd;; - esac - fi - AC_MSG_RESULT([$SHLIB_SUFFIX]) -@@ -6249,6 +6249,68 @@ esac - # check for endianness - AC_C_BIGENDIAN - -+AC_SUBST(PYD_PLATFORM_TAG) -+# Special case of PYD_PLATFORM_TAG with python build with mingw. -+# Python can with compiled with clang or gcc and linked -+# to msvcrt or ucrt. To avoid conflicts between them -+# we are selecting the extension as based on the compiler -+# and the runtime they link to -+# gcc + x86_64 + msvcrt = cp{version number}-x86_64 -+# gcc + i686 + msvcrt = cp{version number}-i686 -+# gcc + x86_64 + ucrt = cp{version number}-x86_64-ucrt -+# clang + x86_64 + ucrt = cp{version number}-x86_64-clang -+# clang + i686 + ucrt = cp{version number}-i686-clang -+ -+PYD_PLATFORM_TAG="" -+case $host in -+ *-*-mingw*) -+ # check if we are linking to ucrt -+ AC_MSG_CHECKING(whether linking to ucrt) -+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ -+ #include -+ #ifndef _UCRT -+ #error no ucrt -+ #endif -+ int main(){ return 0; } -+ ]])],[linking_to_ucrt=yes],[linking_to_ucrt=no]) -+ AC_MSG_RESULT($linking_to_ucrt) -+ ;; -+esac -+case $host_os in -+ mingw*) -+ AC_MSG_CHECKING(PYD_PLATFORM_TAG) -+ case $host in -+ i686-*-mingw*) -+ if test -n "${cc_is_clang}"; then -+ # it is CLANG32 -+ PYD_PLATFORM_TAG="mingw_i686_clang" -+ else -+ if test $linking_to_ucrt = no; then -+ PYD_PLATFORM_TAG="mingw_i686" -+ else -+ PYD_PLATFORM_TAG="mingw_i686_ucrt" -+ fi -+ fi -+ ;; -+ x86_64-*-mingw*) -+ if test -n "${cc_is_clang}"; then -+ # it is CLANG64 -+ PYD_PLATFORM_TAG="mingw_x86_64_clang" -+ else -+ if test $linking_to_ucrt = no; then -+ PYD_PLATFORM_TAG="mingw_x86_64" -+ else -+ PYD_PLATFORM_TAG="mingw_x86_64_ucrt" -+ fi -+ fi -+ ;; -+ aarch64-*-mingw*) -+ PYD_PLATFORM_TAG+="mingw_aarch64" -+ ;; -+ esac -+ AC_MSG_RESULT($PYD_PLATFORM_TAG) -+esac -+ - # ABI version string for Python extension modules. This appears between the - # periods in shared library file names, e.g. foo..so. It is calculated - # from the following attributes which affect the ABI of this Python build (in -@@ -6281,7 +6343,12 @@ if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then - fi - - AC_SUBST([EXT_SUFFIX]) --EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} -+VERSION_NO_DOTS=$(echo $LDVERSION | tr -d .) -+if test -n "${PYD_PLATFORM_TAG}"; then -+ EXT_SUFFIX=".cp${VERSION_NO_DOTS}-${PYD_PLATFORM_TAG}${SHLIB_SUFFIX}" -+else -+ EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} -+fi - - AC_MSG_CHECKING([LDVERSION]) - LDVERSION='$(VERSION)$(ABIFLAGS)' -@@ -7040,12 +7107,6 @@ case "$ac_cv_computed_gotos" in yes*) - AC_DEFINE([HAVE_COMPUTED_GOTOS], [1], - [Define if the C compiler supports computed gotos.]) - esac --case $host_os in -- mingw*) -- dnl Synchronized with _PyImport_DynLoadFiletab (dynload_win.c) -- dnl Do not use more then one dot on this platform ! -- EXT_SUFFIX=-$SOABI$SHLIB_SUFFIX;; --esac - - case $ac_sys_system in - AIX*) diff --git a/mingw-w64-python/0061-configure.ac-don-t-check-for-clock_-functions.patch b/mingw-w64-python/0051-configure-don-t-check-for-clock_-functions.patch similarity index 50% rename from mingw-w64-python/0061-configure.ac-don-t-check-for-clock_-functions.patch rename to mingw-w64-python/0051-configure-don-t-check-for-clock_-functions.patch index f984cc7ae780b..dc6acf54e9de5 100644 --- a/mingw-w64-python/0061-configure.ac-don-t-check-for-clock_-functions.patch +++ b/mingw-w64-python/0051-configure-don-t-check-for-clock_-functions.patch @@ -1,7 +1,7 @@ -From 025f254000599a2531c3ea5beb32e03bc92daeaf Mon Sep 17 00:00:00 2001 +From 7492fd9b21d336b3f1d3cf4fc04d9ebf06c0fec8 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 1 Aug 2021 18:35:17 +0200 -Subject: [PATCH 061/N] configure.ac: don't check for clock_ functions +Subject: [PATCH 051/N] configure: don't check for clock_ functions They shouldn't be exposed on Windows and lead to winpthread being linked in --- @@ -9,12 +9,12 @@ They shouldn't be exposed on Windows and lead to winpthread being linked in 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac -index d6e8604..e884431 100644 +index 6752a59..4c172f9 100644 --- a/configure.ac +++ b/configure.ac -@@ -5540,6 +5540,9 @@ WITH_SAVE_ENV([ - ]) - ]) +@@ -5811,6 +5811,9 @@ AC_CHECK_FUNCS([setpgrp], + # check for namespace functions + AC_CHECK_FUNCS([setns unshare]) +case $host in + *-*-mingw*) ;; @@ -22,12 +22,12 @@ index d6e8604..e884431 100644 AC_CHECK_FUNCS([clock_gettime], [], [ AC_CHECK_LIB([rt], [clock_gettime], [ LIBS="$LIBS -lrt" -@@ -5560,6 +5563,8 @@ AC_CHECK_FUNCS([clock_settime], [], [ - AC_DEFINE([HAVE_CLOCK_SETTIME], [1]) - ]) - ]) +@@ -5837,6 +5840,8 @@ then + ]) + ]) + fi + ;; +esac - AC_CHECK_FUNCS([clock_nanosleep], [], [ - AC_CHECK_LIB([rt], [clock_nanosleep], [ + # On Android before API level 23, clock_nanosleep returns the wrong value when + # interrupted by a signal (https://issuetracker.google.com/issues/216495770). diff --git a/mingw-w64-python/0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch b/mingw-w64-python/0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch similarity index 61% rename from mingw-w64-python/0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch rename to mingw-w64-python/0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch index 979fab072be80..ae958def94728 100644 --- a/mingw-w64-python/0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch +++ b/mingw-w64-python/0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch @@ -1,82 +1,98 @@ -From 1eaade51fb39dde46b814f22ecd27bdfefb5f0d9 Mon Sep 17 00:00:00 2001 +From a2fcc662095af0d637ead0a4782d8a7b37d7b2bb Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Fri, 18 Jun 2021 17:51:59 +0530 -Subject: [PATCH 063/N] CI: test the build and add some mingw specific tests - -- Use actions/setup-python for setting up correct version in cross build -- CI: add cross llvm-mingw jobs -- CI: fix sed pattern for python-config.py shebang - The shebang (`#!`) does not include `${pkgdir}` so this sed did nothing -- CI: remove --without-c-locale-coercion - No longer needed since the default now works on Windows -- Make sure we always use the stdlib distutils -- CI: update actions and images - ubuntu-18.04 is gone now -- CI: updates for mstorsjo/llvm-mingw moving to 20.04 -- CI: 3.10 -> 3.11 -- CI: remove `--with-system-libmpdec` for cross builds -- CI: move gcc cross build to Ubuntu for newer mingw-w64 - - The build requires headers that are only available in v12 (processsnapshot.h) - and Arch is still on v11. So move things to Ubuntu. - Similarely to other cross builds remove the system libs configure flags, those - were never there and now fail properly with the 3.12 build system. +Subject: [PATCH 052/N] CI: test the build and add some mingw specific tests Co-authored-by: Christoph Reiter --- - mingw_ignorefile.txt | 34 +++++ - mingw_smoketests.py | 313 +++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 347 insertions(+) + mingw_ignorefile.txt | 54 ++++++ + mingw_ignorefile_msvcrt.txt | 8 + + mingw_smoketests.py | 353 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 415 insertions(+) create mode 100644 mingw_ignorefile.txt + create mode 100644 mingw_ignorefile_msvcrt.txt create mode 100644 mingw_smoketests.py diff --git a/mingw_ignorefile.txt b/mingw_ignorefile.txt new file mode 100644 -index 0000000..dc3802e +index 0000000..a049c93 --- /dev/null +++ b/mingw_ignorefile.txt -@@ -0,0 +1,34 @@ -+ctypes.test.test_loading.LoaderTest.test_load_dll_with_flags -+distutils.tests.test_bdist_dumb.BuildDumbTestCase.test_simple_built -+distutils.tests.test_cygwinccompiler.CygwinCCompilerTestCase.test_get_versions -+distutils.tests.test_util.UtilTestCase.test_change_root -+test.datetimetester.TestLocalTimeDisambiguation_Fast.* -+test.datetimetester.TestLocalTimeDisambiguation_Pure.* -+test.test_cmath.CMathTests.test_specific_values -+test.test_cmd_line_script.CmdLineTest.test_consistent_sys_path_for_direct_execution -+test.test_compileall.CommandLineTestsNoSourceEpoch.* +@@ -0,0 +1,54 @@ ++test.test_compileall.CommandLineTestsNoSourceEpoch.test_d_compile_error ++test.test_compileall.CommandLineTestsNoSourceEpoch.test_d_runtime_error ++test.test_compileall.CommandLineTestsNoSourceEpoch.test_strip_and_prepend +test.test_compileall.CommandLineTestsWithSourceEpoch.* -+test.test_compileall.CompileallTestsWithoutSourceEpoch.* -+test.test_compileall.CompileallTestsWithSourceEpoch.* ++test.test_compileall.CommandLineTestsWithSourceEpoch.test_d_compile_error ++test.test_compileall.CommandLineTestsWithSourceEpoch.test_d_runtime_error ++test.test_compileall.CommandLineTestsWithSourceEpoch.test_strip_and_prepend ++test.test_compileall.CompileallTestsWithSourceEpoch.test_ddir_empty_only_one_worker ++test.test_compileall.CompileallTestsWithSourceEpoch.test_ddir_multiple_workers ++test.test_compileall.CompileallTestsWithSourceEpoch.test_prepend_onl ++test.test_compileall.CompileallTestsWithSourceEpoch.test_strip_and_prepend ++test.test_compileall.CompileallTestsWithSourceEpoch.test_strip_only ++test.test_compileall.CompileallTestsWithSourceEpoch.test_strip_only_invalid ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_ddir_empty_only_one_worker ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_ddir_multiple_workers ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_prepend_only ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_strip_and_prepend ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_strip_only ++test.test_compileall.CompileallTestsWithoutSourceEpoch.test_strip_only_invalid ++test.test_ctypes.test_loading.LoaderTest.test_load_dll_with_flags +test.test_import.ImportTests.test_dll_dependency_import -+test.test_math.MathTests.* ++test.test_int.IntStrDigitLimitsTests.test_denial_of_service_prevented_str_to_in ++test.test_locale.TestRealLocales.test_setlocale_long_encoding ++test.test_math.FMATests.test_fma_infinities ++test.test_math.FMATests.test_fma_overflow ++test.test_math.FMATests.test_fma_zero_result ++test.test_math.FMATests.test_random +test.test_ntpath.NtCommonTest.test_import -+test.test_os.StatAttributeTests.test_stat_block_device -+test.test_os.TestScandir.test_attributes -+test.test_os.UtimeTests.test_large_time -+test.test_platform.PlatformTest.test_architecture_via_symlink ++test.test_site.CommandLineTests.test_no_args ++test.test_site.HelperFunctionsTests.test_getsitepackages ++test.test_site.HelperFunctionsTests.test_get_path +test.test_regrtest.ProgramsTestCase.test_pcbuild_rt +test.test_regrtest.ProgramsTestCase.test_tools_buildbot_test -+test.test_site._pthFileTests.* -+test.test_site.HelperFunctionsTests.* -+test.test_site.StartupImportTests.* -+test.test_ssl.* ++test.test_venv.BasicTest.test_activate_shell_script_has_no_dos_newlines ++test.test_venv.BasicTest.test_defaults_with_pathlike ++test.test_venv.BasicTest.test_defaults_with_str_path ++test.test_venv.BasicTest.test_executable ++test.test_venv.BasicTest.test_executable_symlinks ++test.test_venv.BasicTest.test_failed_symlink ++test.test_venv.BasicTest.test_multiprocessing ++test.test_venv.BasicTest.test_multiprocessing_recursion ++test.test_venv.BasicTest.test_prefixes ++test.test_venv.BasicTest.test_special_chars_windows ++test.test_venv.BasicTest.test_symlinking ++test.test_venv.BasicTest.test_sysconfig ++test.test_venv.BasicTest.test_sysconfig_symlinks ++test.test_venv.BasicTest.test_unicode_in_batch_file ++test.test_venv.BasicTest.test_unoverwritable_fails ++test.test_venv.BasicTest.test_upgrade ++test.test_venv.BasicTest.test_upgrade_dependencies ++test.test_venv.BasicTest.test_venvwlauncher ++test.test_venv.EnsurePipTest.test_explicit_no_pip ++test.test_venv.EnsurePipTest.test_no_pip_by_default ++test.test_multiprocessing_spawn.test_manager.WithManagerTestMyManager.* +diff --git a/mingw_ignorefile_msvcrt.txt b/mingw_ignorefile_msvcrt.txt +new file mode 100644 +index 0000000..be363bd +--- /dev/null ++++ b/mingw_ignorefile_msvcrt.txt +@@ -0,0 +1,8 @@ ++test.datetimetester.TestLocalTimeDisambiguation_Fast.* ++test.datetimetester.TestLocalTimeDisambiguation_Pure.* ++test.test_cmath.CMathTests.test_specific_values ++test.test_math.MathTests.* +test.test_strptime.CalculationTests.* +test.test_strptime.StrptimeTests.test_weekday +test.test_strptime.TimeRETests.test_compile +test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date -+test.test_venv.BasicTest.* -+test.test_venv.EnsurePipTest.* -+# flaky -+test.test__xxsubinterpreters.* -+test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe -\ No newline at end of file diff --git a/mingw_smoketests.py b/mingw_smoketests.py new file mode 100644 -index 0000000..d92c74a +index 0000000..7aff2d4 --- /dev/null +++ b/mingw_smoketests.py -@@ -0,0 +1,313 @@ +@@ -0,0 +1,353 @@ +#!/usr/bin/env python3 +# Copyright 2017 Christoph Reiter +# @@ -104,16 +120,17 @@ index 0000000..d92c74a +Feel free to extend. +""" + ++import sys +import os +import unittest +import sysconfig + -+if "MSYSTEM" in os.environ: ++if sys._use_alt_sep: + SEP = "/" +else: + SEP = "\\" + -+_UCRT = "clang" in sysconfig.get_platform() or "ucrt" in sysconfig.get_platform() ++_UCRT = 'ucrt' in sysconfig.get_platform() + + +class Tests(unittest.TestCase): @@ -137,25 +154,6 @@ index 0000000..d92c74a + self.assertEqual(str(Path("~").expanduser()), expanduser("~")) + self.assertEqual(str(Path.home()), expanduser("~")) + -+ def test_sysconfig_schemes(self): -+ # https://github.com/msys2/MINGW-packages/issues/9319 -+ import sysconfig -+ from distutils.dist import Distribution -+ from distutils.command.install import install -+ -+ names = ['scripts', 'purelib', 'platlib', 'data', 'include'] -+ for scheme in ["nt", "nt_user"]: -+ for name in names: -+ c = install(Distribution({"name": "foobar"})) -+ c.user = (scheme == "nt_user") -+ c.finalize_options() -+ if name == "include": -+ dist_path = os.path.dirname(getattr(c, "install_" + "headers")) -+ else: -+ dist_path = getattr(c, "install_" + name) -+ sys_path = sysconfig.get_path(name, scheme) -+ self.assertEqual(dist_path, sys_path, (scheme, name)) -+ + def test_ctypes_find_library(self): + from ctypes.util import find_library + from ctypes import cdll @@ -167,7 +165,6 @@ index 0000000..d92c74a + + def test_ctypes_dlopen(self): + import ctypes -+ import sys + self.assertEqual(ctypes.RTLD_GLOBAL, 0) + self.assertEqual(ctypes.RTLD_GLOBAL, ctypes.RTLD_LOCAL) + self.assertFalse(hasattr(sys, 'setdlopenflags')) @@ -251,7 +248,6 @@ index 0000000..d92c74a + pass + + def test_sysconfig(self): -+ import sysconfig + # This should be able to execute without exceptions + sysconfig.get_config_vars() + @@ -268,45 +264,114 @@ index 0000000..d92c74a + with tempfile.TemporaryDirectory() as tmp: + builder = venv.EnvBuilder() + builder.create(tmp) ++ abiflags = sysconfig.get_config_var('ABIFLAGS') + assert os.path.exists(os.path.join(tmp, "bin", "activate")) -+ assert os.path.exists(os.path.join(tmp, "bin", "python.exe")) -+ assert os.path.exists(os.path.join(tmp, "bin", "python3.exe")) ++ assert os.path.exists(os.path.join(tmp, "bin", "python" + abiflags + ".exe")) ++ assert os.path.exists(os.path.join(tmp, "bin", "pythonw" + abiflags + ".exe")) + subprocess.check_call([shutil.which("bash.exe"), os.path.join(tmp, "bin", "activate")]) + ++ # This will not work in in-tree build ++ if not sysconfig.is_python_build(): ++ op = subprocess.check_output( ++ [ ++ os.path.join(tmp, "bin", "python" + abiflags + ".exe"), ++ "-c", ++ "print('Hello World')" ++ ], ++ cwd=tmp, ++ ) ++ assert op.decode().strip() == "Hello World" ++ + def test_has_mktime(self): + from time import mktime, gmtime + mktime(gmtime()) + + def test_platform_things(self): -+ import sys -+ import sysconfig + import platform + import importlib.machinery ++ import tempfile ++ import venv ++ import subprocess + self.assertEqual(sys.implementation.name, "cpython") + self.assertEqual(sys.platform, "win32") + self.assertTrue(sysconfig.get_platform().startswith("mingw")) -+ self.assertTrue(sysconfig.get_config_var('SOABI').startswith("cpython-")) ++ soabi = sysconfig.get_config_var('SOABI') ++ self.assertTrue(soabi.startswith("cp" + f'{sys.version_info.major}{sys.version_info.minor}')) + ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') ++ abiflags = sysconfig.get_config_var('ABIFLAGS') ++ self.assertTrue("." + soabi + "." in ext_suffix) + self.assertTrue(ext_suffix.endswith(".pyd")) + self.assertTrue("mingw" in ext_suffix) + self.assertEqual(sysconfig.get_config_var('SHLIB_SUFFIX'), ".pyd") + ext_suffixes = importlib.machinery.EXTENSION_SUFFIXES + self.assertTrue(ext_suffix in ext_suffixes) -+ self.assertTrue(".pyd" in ext_suffixes) -+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2]))) ++ untagged_ext = abiflags + '.pyd' ++ self.assertTrue(untagged_ext in ext_suffixes) ++ if sysconfig.get_platform().startswith('mingw_i686'): ++ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-32') ++ elif sysconfig.get_platform().startswith('mingw_aarch64'): ++ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm64') ++ elif sysconfig.get_platform().startswith('mingw_armv7'): ++ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm32') ++ else: ++ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2]))) + self.assertEqual(platform.python_implementation(), "CPython") + self.assertEqual(platform.system(), "Windows") + self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0) + ++ with tempfile.TemporaryDirectory() as tmp: ++ builder = venv.EnvBuilder() ++ builder.create(tmp) ++ # This will not work in in-tree build ++ if not sysconfig.is_python_build(): ++ op = subprocess.check_output( ++ [ ++ os.path.join(tmp, "bin", 'python' + abiflags + '.exe'), ++ "-c", ++ "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))" ++ ], ++ cwd=tmp, ++ ) ++ self.assertTrue(op.decode().strip().startswith(sys.base_prefix)) ++ ++ def test_sys_getpath(self): ++ # everything sourced from getpath.py ++ ++ def assertNormpath(path): ++ self.assertEqual(path, os.path.normpath(path)) ++ ++ assertNormpath(sys.executable) ++ assertNormpath(sys._base_executable) ++ assertNormpath(sys.prefix) ++ assertNormpath(sys.base_prefix) ++ assertNormpath(sys.exec_prefix) ++ assertNormpath(sys.base_exec_prefix) ++ assertNormpath(sys.platlibdir) ++ assertNormpath(sys._stdlib_dir) ++ for p in sys.path: ++ assertNormpath(p) ++ ++ def test_site(self): ++ import site ++ ++ self.assertEqual(len(site.getsitepackages()), 1) ++ + def test_c_ext_build(self): + import tempfile -+ import sys + import subprocess + import textwrap ++ import venv + from pathlib import Path + ++ if sysconfig.is_python_build(): ++ pydir = os.path.dirname(sys._base_executable).replace('\\', '/') ++ os.environ["LDFLAGS"] = "-L " + pydir ++ + with tempfile.TemporaryDirectory() as tmppro: -+ subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"]) ++ builder = venv.EnvBuilder(with_pip=True) ++ builder.create(tmppro) ++ venv_exe = os.path.join(tmppro, "bin", os.path.basename(sys.executable)) ++ + with Path(tmppro, "setup.py").open("w") as f: + f.write( + textwrap.dedent( @@ -358,20 +423,11 @@ index 0000000..d92c74a + ) + ) + subprocess.check_call( -+ [sys.executable, "-c", "import struct"], -+ ) -+ subprocess.check_call( -+ [ -+ sys.executable, -+ "-m", -+ "pip", -+ "install", -+ "wheel", -+ ], ++ [venv_exe, "-c", "import struct"], + ) + subprocess.check_call( + [ -+ sys.executable, ++ venv_exe, + "-m", + "pip", + "install", @@ -379,7 +435,7 @@ index 0000000..d92c74a + ], + ) + subprocess.check_call( -+ [sys.executable, "-c", "import cwrapper"], ++ [venv_exe, "-c", "import cwrapper"], + ) + + diff --git a/mingw-w64-python/0052-Change-the-get_platform-method-in-sysconfig.patch b/mingw-w64-python/0052-Change-the-get_platform-method-in-sysconfig.patch deleted file mode 100644 index ea9cd3f547e89..0000000000000 --- a/mingw-w64-python/0052-Change-the-get_platform-method-in-sysconfig.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 8593bd4755f7e892e9b4ad5dae1a8bb79632e0c8 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 21 Sep 2021 21:36:58 +0200 -Subject: [PATCH 052/N] Change the `get_platform()` method in sysconfig - -This would possibly fix building wheels when mingw python -is used and would be unique to each python same as EXT_SUFFIX. - -Also, this modifies the `sys.version` argument to include UCRT -in it. - -Signed-off-by: Naveen M K ---- - Lib/sysconfig.py | 16 ++++++++++++++-- - Python/getcompiler.c | 4 ++++ - 2 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index a0e07b9..2a67b84 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -813,8 +813,20 @@ def get_platform(): - - """ - if os.name == 'nt': -- if 'GCC' in sys.version: -- return 'mingw' -+ if 'gcc' in sys.version.lower(): -+ if 'ucrt' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_ucrt' -+ return 'mingw_i686_ucrt' -+ if 'clang' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_clang' -+ if 'arm64' in sys.version.lower(): -+ return 'mingw_aarch64' -+ return 'mingw_i686_clang' -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64' -+ return 'mingw_i686' - if 'amd64' in sys.version.lower(): - return 'win-amd64' - if '(arm)' in sys.version.lower(): -diff --git a/Python/getcompiler.c b/Python/getcompiler.c -index 7e7be71..275f799 100644 ---- a/Python/getcompiler.c -+++ b/Python/getcompiler.c -@@ -33,8 +33,12 @@ - #define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \ - xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]" - #else -+#if defined(_UCRT) -+#define COMPILER COMP_SEP "[GCC UCRT " __VERSION__ ARCH_SUFFIX "]" -+#else - #define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]" - #endif -+#endif - // Generic fallbacks. - #elif defined(__cplusplus) - #define COMPILER "[C++]" diff --git a/mingw-w64-python/0053-build-Fix-ncursesw-include-lookup.patch b/mingw-w64-python/0053-build-Fix-ncursesw-include-lookup.patch deleted file mode 100644 index e2808c2b10189..0000000000000 --- a/mingw-w64-python/0053-build-Fix-ncursesw-include-lookup.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 3e7467b231de015ec9f31a4982206e9d79f3f948 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= - -Date: Thu, 17 Jun 2021 18:52:09 +0530 -Subject: [PATCH 053/N] build: Fix ncursesw include lookup - -Mirror what is already done for libffi; Look it up via -pkg-config and use the exported path via sysconfig in setup.py ---- - Makefile.pre.in | 4 ++++ - configure.ac | 9 ++++++++- - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index cfe8634..e7c7b89 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -347,6 +347,10 @@ IO_OBJS= \ - Modules/_io/bytesio.o \ - Modules/_io/stringio.o - -+########################################################################## -+ -+NCURSESW_INCLUDEDIR= @NCURSESW_INCLUDEDIR@ -+ - ########################################################################## - # Parser - -diff --git a/configure.ac b/configure.ac -index 19b866a..a566bba 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6900,10 +6900,17 @@ AS_VAR_IF([have_panel], [no], [ - AC_MSG_RESULT([$have_panel (CFLAGS: $PANEL_CFLAGS, LIBS: $PANEL_LIBS)]) - ]) - -+if test -n "$PKG_CONFIG"; then -+ NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`" -+else -+ NCURSESW_INCLUDEDIR="" -+fi -+AC_SUBST(NCURSESW_INCLUDEDIR) -+ - # first curses header check - ac_save_cppflags="$CPPFLAGS" - if test "$cross_compiling" = no; then -- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" -+ CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR" - fi - - # On Solaris, term.h requires curses.h diff --git a/mingw-w64-python/0072-configure.ac-Default-to-without-c-locale-coercion-on.patch b/mingw-w64-python/0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch similarity index 81% rename from mingw-w64-python/0072-configure.ac-Default-to-without-c-locale-coercion-on.patch rename to mingw-w64-python/0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch index 5190992585753..0666392a45bb2 100644 --- a/mingw-w64-python/0072-configure.ac-Default-to-without-c-locale-coercion-on.patch +++ b/mingw-w64-python/0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch @@ -1,8 +1,8 @@ -From d542017523f271326ff0034ad5777c03d6cac07a Mon Sep 17 00:00:00 2001 +From 713d17cc9f1c6b2a7d8475cc2397bd4411b985bc Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 22 Apr 2022 17:31:19 +0200 -Subject: [PATCH 072/N] configure.ac: Default to --without-c-locale-coercion - on Windows +Subject: [PATCH 053/N] configure: Default to --without-c-locale-coercion on + Windows --with-c-locale-coercion otherwise defaults to yes and enables code that isn't compatible on Windows, mainly because the feature is Unix related. @@ -15,10 +15,10 @@ Fixes #36 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 8a0f79c..2258bb5 100644 +index 4c172f9..4690132 100644 --- a/configure.ac +++ b/configure.ac -@@ -5030,11 +5030,14 @@ AC_MSG_RESULT([$with_freelists]) +@@ -5257,11 +5257,14 @@ AC_MSG_RESULT([$with_freelists]) AC_MSG_CHECKING([for --with-c-locale-coercion]) AC_ARG_WITH( [c-locale-coercion], diff --git a/mingw-w64-python/0054-tests-Fix-some-failing-tests.patch b/mingw-w64-python/0054-tests-Fix-some-failing-tests.patch new file mode 100644 index 0000000000000..f4947b78504f5 --- /dev/null +++ b/mingw-w64-python/0054-tests-Fix-some-failing-tests.patch @@ -0,0 +1,101 @@ +From a00569162f1dc01aec917a98ab365c2ef5ac2696 Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Sun, 5 Jun 2022 20:28:53 +0530 +Subject: [PATCH 054/N] tests: Fix some failing tests + +- In `test_sysconfig`, ignore `test_sysconfig.TestSysConfig.test_user_similar` test failure. +- Copy `get_platform()` from from distutils.utils to test_importlib/test_windows.py. +- some basic fixes for test_getpath +- test_sysconfig.py: fix tests related to mingw +--- + Lib/test/test_getpath.py | 3 +++ + Lib/test/test_importlib/test_windows.py | 23 +++++++++++++++++++++++ + Lib/test/test_sysconfig.py | 6 +++++- + 3 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py +index d5dcdad..0c4ab74 100644 +--- a/Lib/test/test_getpath.py ++++ b/Lib/test/test_getpath.py +@@ -852,6 +852,7 @@ DEFAULT_NAMESPACE = dict( + ENV_PYTHONHOME="", + ENV_PYTHONEXECUTABLE="", + ENV___PYVENV_LAUNCHER__="", ++ ENV_MSYSTEM="", + argv0="", + py_setpath="", + real_executable="", +@@ -891,6 +892,7 @@ class MockNTNamespace(dict): + self.update(DEFAULT_NAMESPACE) + self["config"] = DEFAULT_CONFIG.copy() + self["os_name"] = "nt" ++ self["is_mingw"] = 0 + self["PLATLIBDIR"] = "DLLs" + self["PYWINVER"] = "9.8-XY" + self["VPATH"] = r"..\.." +@@ -1067,6 +1069,7 @@ class MockPosixNamespace(dict): + self.update(DEFAULT_NAMESPACE) + self["config"] = DEFAULT_CONFIG.copy() + self["os_name"] = "posix" ++ self["is_mingw"] = 0 + self["PLATLIBDIR"] = "lib" + self["WITH_NEXT_FRAMEWORK"] = 0 + super().__init__(*a, **kw) +diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py +index 8a9a8ff..be96884 100644 +--- a/Lib/test/test_importlib/test_windows.py ++++ b/Lib/test/test_importlib/test_windows.py +@@ -24,6 +24,29 @@ def get_platform(): + 'x64' : 'win-amd64', + 'arm' : 'win-arm32', + } ++ if os.name == 'nt': ++ if sys._is_mingw: ++ platform = "mingw" ++ if "amd64" in sys.version.lower(): ++ platform += "_x86_64" ++ elif "arm64" in sys.version.lower(): ++ platform += "_aarch64" ++ elif "arm" in sys.version.lower(): ++ platform += "_armv7" ++ else: ++ platform += "_i686" ++ ++ if "ucrt" in sys.version.lower(): ++ platform += "_ucrt" ++ else: ++ platform += "_msvcrt" ++ ++ if "clang" in sys.version.lower(): ++ platform += "_llvm" ++ else: ++ platform += "_gnu" ++ ++ return platform + if ('VSCMD_ARG_TGT_ARCH' in os.environ and + os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT): + return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']] +diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py +index 9723300..691b84f 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -208,7 +208,7 @@ class TestSysConfig(unittest.TestCase): + self.assertEqual(libpath, sysconfig.get_path('purelib', scheme='nt_venv', vars=vars)) + + def test_venv_scheme(self): +- if sys.platform == 'win32': ++ if not sys._is_mingw and sys.platform == 'win32': + self.assertEqual( + sysconfig.get_path('scripts', scheme='venv'), + sysconfig.get_path('scripts', scheme='nt_venv') +@@ -428,6 +428,10 @@ class TestSysConfig(unittest.TestCase): + if HAS_USER_BASE: + user_path = get_path(name, 'posix_user') + expected = os.path.normpath(global_path.replace(base, user, 1)) ++ if os.name == 'nt' and sys._is_mingw: ++ expected = expected.replace( ++ f'python{sysconfig.get_python_version()}', ++ f'python{sysconfig.get_python_version()}-{get_platform()}') + # bpo-44860: platlib of posix_user doesn't use sys.platlibdir, + # whereas posix_prefix does. + if name == 'platlib': diff --git a/mingw-w64-python/0075-def-VPATH-when-compiling-Python-sysmodule.c.patch b/mingw-w64-python/0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch similarity index 65% rename from mingw-w64-python/0075-def-VPATH-when-compiling-Python-sysmodule.c.patch rename to mingw-w64-python/0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch index 5056eaef5bf69..d827c620ecba2 100644 --- a/mingw-w64-python/0075-def-VPATH-when-compiling-Python-sysmodule.c.patch +++ b/mingw-w64-python/0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch @@ -1,17 +1,18 @@ -From 0aa1973ccba8810cd5a02383f7e94fcd03a46d09 Mon Sep 17 00:00:00 2001 +From 9dfb76749d0bbf76138ed6542f0c26630a335e24 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 18 Jun 2023 13:12:56 +0530 -Subject: [PATCH 075/N] def VPATH when compiling `Python/sysmodule.c` +Subject: [PATCH 055/N] build: def VPATH when compiling `Python/sysmodule.c` +it's exposed as sys._vpath there --- Makefile.pre.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 073a770..a8f3587 100644 +index 68c7c4c..816d2f0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1425,6 +1425,7 @@ Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile +@@ -1785,6 +1785,7 @@ Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h $(CC) -c $(PY_CORE_CFLAGS) \ -DABIFLAGS='"$(ABIFLAGS)"' \ diff --git a/mingw-w64-python/0055-time-fix-strftime-not-raising-for-invalid-year-value.patch b/mingw-w64-python/0055-time-fix-strftime-not-raising-for-invalid-year-value.patch deleted file mode 100644 index 9c9851a95c474..0000000000000 --- a/mingw-w64-python/0055-time-fix-strftime-not-raising-for-invalid-year-value.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fcfa06e4e11f25e039614afeefcead38fbf0b240 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Fri, 23 Jul 2021 08:52:50 +0200 -Subject: [PATCH 055/N] time: fix strftime not raising for invalid year - values - -It's crt specific and not compiler specific. -This fixes a test case in test_time ---- - Modules/timemodule.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Modules/timemodule.c b/Modules/timemodule.c -index 5907826..4946cdc 100644 ---- a/Modules/timemodule.c -+++ b/Modules/timemodule.c -@@ -905,7 +905,7 @@ time_strftime(PyObject *module, PyObject *args) - return NULL; - } - --#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__) -+#if defined(MS_WINDOWS) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__) - if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) { - PyErr_SetString(PyExc_ValueError, - "strftime() requires year in [1; 9999]"); diff --git a/mingw-w64-python/0078-correctly-find-native-python.patch b/mingw-w64-python/0056-configure-correctly-find-native-python.patch similarity index 73% rename from mingw-w64-python/0078-correctly-find-native-python.patch rename to mingw-w64-python/0056-configure-correctly-find-native-python.patch index bd190ba00fa19..0dadad5d9c5e3 100644 --- a/mingw-w64-python/0078-correctly-find-native-python.patch +++ b/mingw-w64-python/0056-configure-correctly-find-native-python.patch @@ -1,7 +1,7 @@ -From 05873e7473bd34485769d73bacd07e74f42b4812 Mon Sep 17 00:00:00 2001 +From 7ecc4954fffa69ed62f13ab85f36f8dd54bebf82 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 18 Jun 2023 14:29:50 +0530 -Subject: [PATCH 078/N] correctly find native python +Subject: [PATCH 056/N] configure: correctly find native python it's required for regen-modules --- @@ -9,7 +9,7 @@ it's required for regen-modules 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 01344fe..56bd3c1 100644 +index 4690132..4c322b0 100644 --- a/configure.ac +++ b/configure.ac @@ -204,9 +204,11 @@ AC_SUBST([FREEZE_MODULE]) @@ -18,7 +18,7 @@ index 01344fe..56bd3c1 100644 +NATIVE_PYTHON_SEARCH_PATH_MINGW=`echo $host | grep -Eq 'mingw*' && echo "$MINGW_PREFIX/bin" || echo $PATH` AC_CHECK_PROGS([PYTHON_FOR_REGEN], - [python$PACKAGE_VERSION python3.12 python3.11 python3.10 python3 python], + [python$PACKAGE_VERSION python3.13 python3.12 python3.11 python3.10 python3 python], - [python3]) + [python3], + [$NATIVE_PYTHON_SEARCH_PATH_MINGW]) diff --git a/mingw-w64-python/0056-ctypes-find_library-c-should-return-None-with-ucrt.patch b/mingw-w64-python/0056-ctypes-find_library-c-should-return-None-with-ucrt.patch deleted file mode 100644 index cd29c77fb9ed6..0000000000000 --- a/mingw-w64-python/0056-ctypes-find_library-c-should-return-None-with-ucrt.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 5e7f059b5d94cb624764a6b0b42c1186a27e6a80 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Fri, 23 Jul 2021 18:23:58 +0200 -Subject: [PATCH 056/N] ctypes: find_library('c') should return None with - ucrt - -Just like with MSVC. This fixes a test in test_ctypes. ---- - Lib/ctypes/util.py | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index c550883..a5a2a3f 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -31,6 +31,12 @@ if os.name == "nt": - # else we don't know what version of the compiler this is - return None - -+ def find_msvcrt_mingw(): -+ is_ucrt = 'clang' in sys.version.lower() or 'ucrt' in sys.version.lower() -+ if is_ucrt: -+ return None -+ return 'msvcrt.dll' -+ - def find_msvcrt(): - """Return the name of the VC runtime dll""" - version = _get_build_version() -@@ -54,6 +60,9 @@ if os.name == "nt": - - def find_library(name): - if name in ('c', 'm'): -+ import sysconfig -+ if sysconfig.get_platform().startswith('mingw'): -+ return find_msvcrt_mingw() - return find_msvcrt() - # See MSDN for the REAL search order. - for directory in os.environ['PATH'].split(os.pathsep): diff --git a/mingw-w64-python/0079-Add-extra-flags-for-_bootstrap_python.patch b/mingw-w64-python/0057-build-Add-extra-flags-for-_bootstrap_python.patch similarity index 77% rename from mingw-w64-python/0079-Add-extra-flags-for-_bootstrap_python.patch rename to mingw-w64-python/0057-build-Add-extra-flags-for-_bootstrap_python.patch index 73090cfbcc14f..89b3ddbbfb402 100644 --- a/mingw-w64-python/0079-Add-extra-flags-for-_bootstrap_python.patch +++ b/mingw-w64-python/0057-build-Add-extra-flags-for-_bootstrap_python.patch @@ -1,17 +1,17 @@ -From 5bf2fad675f85bb22fce74cfda951c123659061a Mon Sep 17 00:00:00 2001 +From 775445e0d7b2d8b21c1402ec3fbf3388ea95f338 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 18 Jun 2023 14:30:09 +0530 -Subject: [PATCH 079/N] Add extra flags for `_bootstrap_python` +Subject: [PATCH 057/N] build: Add extra flags for `_bootstrap_python` --- Makefile.pre.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index a8f3587..595792f 100644 +index 816d2f0..5b0ae97 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1111,7 +1111,7 @@ BOOTSTRAP_HEADERS = \ +@@ -1489,7 +1489,7 @@ BOOTSTRAP_HEADERS = \ Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS) _bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local diff --git a/mingw-w64-python/0058-Fix-install-location-of-the-import-library.patch b/mingw-w64-python/0058-Fix-install-location-of-the-import-library.patch deleted file mode 100644 index 1fc293f362774..0000000000000 --- a/mingw-w64-python/0058-Fix-install-location-of-the-import-library.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f661c24c32371a5d30291b4d50f7b3b37893ab7a Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sun, 25 Jul 2021 15:46:01 +0200 -Subject: [PATCH 058/N] Fix install location of the import library - ---- - Makefile.pre.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index e7c7b89..fc1ea7d 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -2488,7 +2488,7 @@ libainstall: all scripts - if test -d $(LIBRARY); then :; else \ - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ - if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \ -- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ -+ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ - fi; \ diff --git a/mingw-w64-python/0081-getpath.py-add-support-for-mingw.patch b/mingw-w64-python/0058-getpath-add-support-for-mingw.patch similarity index 56% rename from mingw-w64-python/0081-getpath.py-add-support-for-mingw.patch rename to mingw-w64-python/0058-getpath-add-support-for-mingw.patch index b329ead71c8cc..9c05c22760e14 100644 --- a/mingw-w64-python/0081-getpath.py-add-support-for-mingw.patch +++ b/mingw-w64-python/0058-getpath-add-support-for-mingw.patch @@ -1,20 +1,21 @@ -From f05f20c5be464efb0a7277ae68f84f5548a123e7 Mon Sep 17 00:00:00 2001 +From f7ad7b2329f6c9120013cb8cad640f56dc5c3f44 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 20 Jun 2023 18:43:59 +0530 -Subject: [PATCH 081/N] getpath.py: add support for mingw +Subject: [PATCH 058/N] getpath: add support for mingw - always normalize the PREFIX to an absolute path - use `/` when MSYSTEM is defined --- - Include/pylifecycle.h | 1 + - Modules/getpath.c | 9 ++++++++ - Modules/getpath.py | 48 +++++++++++++++++++++++++++++++------------ - Python/fileutils.c | 41 +++++++++++++++++++++--------------- - Python/pathconfig.c | 2 +- - 5 files changed, 71 insertions(+), 30 deletions(-) + Include/pylifecycle.h | 1 + + Lib/test/test_getpath.py | 6 +++ + Modules/getpath.c | 40 ++++++++++++++++++++ + Modules/getpath.py | 81 ++++++++++++++++++++++++++-------------- + Python/fileutils.c | 41 ++++++++++++-------- + Python/pathconfig.c | 2 +- + 6 files changed, 127 insertions(+), 44 deletions(-) diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h -index 50d8b76..5d29201 100644 +index 9f842cb..6eb171d 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -21,6 +21,7 @@ PyAPI_FUNC(int) Py_IsInitialized(void); @@ -25,19 +26,95 @@ index 50d8b76..5d29201 100644 PyAPI_FUNC(wchar_t) Py_GetSepW(const wchar_t *); PyAPI_FUNC(char) Py_GetSepA(const char *); +diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py +index 0c4ab74..f43877b 100644 +--- a/Lib/test/test_getpath.py ++++ b/Lib/test/test_getpath.py +@@ -928,6 +928,9 @@ class MockNTNamespace(dict): + except AttributeError: + raise KeyError(key) from None + ++ def normpath(self, path): ++ return ntpath.normpath(path) ++ + def abspath(self, path): + if self.isabs(path): + return path +@@ -1106,6 +1109,9 @@ class MockPosixNamespace(dict): + except AttributeError: + raise KeyError(key) from None + ++ def normpath(self, path): ++ return path ++ + def abspath(self, path): + if self.isabs(path): + return path diff --git a/Modules/getpath.c b/Modules/getpath.c -index 0a31000..de7efb6 100644 +index d0128b2..cf3fbdd 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c -@@ -68,6 +68,7 @@ getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args) - if (path) { - wchar_t *abs; - if (_Py_abspath((const wchar_t *)_Py_normpath(path, -1), &abs) == 0 && abs) { -+ abs = _Py_normpath(abs, -1); - r = PyUnicode_FromWideChar(abs, -1); - PyMem_RawFree((void *)abs); - } else { -@@ -881,6 +882,11 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) +@@ -57,6 +57,25 @@ + + /* HELPER FUNCTIONS for getpath.py */ + ++static PyObject * ++getpath_normpath(PyObject *Py_UNUSED(self), PyObject *args) ++{ ++ PyObject *r = NULL; ++ PyObject *pathobj; ++ wchar_t *path; ++ if (!PyArg_ParseTuple(args, "U", &pathobj)) { ++ return NULL; ++ } ++ Py_ssize_t len; ++ wchar_t *buffer = PyUnicode_AsWideCharString(pathobj, &len); ++ if (!buffer) { ++ return NULL; ++ } ++ r = PyUnicode_FromWideChar(_Py_normpath(buffer, len), -1); ++ PyMem_Free(buffer); ++ return r; ++} ++ + static PyObject * + getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args) + { +@@ -91,6 +110,12 @@ getpath_basename(PyObject *Py_UNUSED(self), PyObject *args) + } + Py_ssize_t end = PyUnicode_GET_LENGTH(path); + Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1); ++#ifdef ALTSEP ++ if (pos < 0) { ++ // try using altsep ++ pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1); ++ } ++#endif + if (pos < 0) { + return Py_NewRef(path); + } +@@ -107,6 +132,12 @@ getpath_dirname(PyObject *Py_UNUSED(self), PyObject *args) + } + Py_ssize_t end = PyUnicode_GET_LENGTH(path); + Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1); ++#ifdef ALTSEP ++ if (pos < 0) { ++ // try using altsep ++ pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1); ++ } ++#endif + if (pos < 0) { + return PyUnicode_FromStringAndSize(NULL, 0); + } +@@ -561,6 +592,7 @@ done: + + + static PyMethodDef getpath_methods[] = { ++ {"normpath", getpath_normpath, METH_VARARGS, NULL}, + {"abspath", getpath_abspath, METH_VARARGS, NULL}, + {"basename", getpath_basename, METH_VARARGS, NULL}, + {"dirname", getpath_dirname, METH_VARARGS, NULL}, +@@ -927,6 +959,11 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) #else !decode_to_dict(dict, "os_name", "posix") || #endif @@ -49,8 +126,8 @@ index 0a31000..de7efb6 100644 #ifdef WITH_NEXT_FRAMEWORK !int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 1) || #else -@@ -907,6 +913,9 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) - !funcs_to_dict(dict, config->pathconfig_warnings) || +@@ -958,6 +995,9 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) + #endif #ifndef MS_WINDOWS PyDict_SetItemString(dict, "winreg", Py_None) < 0 || +#endif @@ -60,7 +137,7 @@ index 0a31000..de7efb6 100644 PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins()) < 0 ) { diff --git a/Modules/getpath.py b/Modules/getpath.py -index 9913fcb..6867e98 100644 +index 1f1bfcb..e743161 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -30,6 +30,7 @@ @@ -71,7 +148,7 @@ index 9913fcb..6867e98 100644 # PREFIX -- [in] sysconfig.get_config_var(...) # EXEC_PREFIX -- [in] sysconfig.get_config_var(...) # PYTHONPATH -- [in] sysconfig.get_config_var(...) -@@ -51,6 +52,7 @@ +@@ -52,6 +53,7 @@ # ENV_PYTHONHOME -- [in] getenv(...) # ENV_PYTHONEXECUTABLE -- [in] getenv(...) # ENV___PYVENV_LAUNCHER__ -- [in] getenv(...) @@ -79,8 +156,8 @@ index 9913fcb..6867e98 100644 # ** Values calculated at runtime ** # config -- [in/out] dict of the PyConfig structure -@@ -185,8 +187,27 @@ if os_name == 'posix' or os_name == 'darwin': - ZIP_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}{VERSION_MINOR}.zip' +@@ -187,8 +189,27 @@ if os_name == 'posix' or os_name == 'darwin': + ZIP_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}{VERSION_MINOR}{ABI_THREAD}.zip' DELIM = ':' SEP = '/' + ALTSEP = None @@ -108,7 +185,7 @@ index 9913fcb..6867e98 100644 BUILDDIR_TXT = 'pybuilddir.txt' BUILD_LANDMARK = f'{VPATH}\\Modules\\Setup.local' DEFAULT_PROGRAM_NAME = f'python' -@@ -199,6 +220,7 @@ elif os_name == 'nt': +@@ -201,6 +222,7 @@ elif os_name == 'nt': WINREG_KEY = f'SOFTWARE\\Python\\PythonCore\\{PYWINVER}\\PythonPath' DELIM = ';' SEP = '\\' @@ -116,7 +193,16 @@ index 9913fcb..6867e98 100644 # ****************************************************************************** -@@ -263,10 +285,10 @@ if py_setpath: +@@ -213,6 +235,8 @@ def search_up(prefix, *landmarks, test=isfile): + return prefix + prefix = dirname(prefix) + ++def _normpath(p): ++ return normpath(p) if p is not None else None + + # ****************************************************************************** + # READ VARIABLES FROM config +@@ -264,10 +288,10 @@ if py_setpath: if not executable: executable = real_executable @@ -129,7 +215,7 @@ index 9913fcb..6867e98 100644 if not executable: # All platforms default to real_executable if known at this # stage. POSIX does not set this value. -@@ -497,15 +519,15 @@ if ((not home_was_set and real_executable_dir and not py_setpath) +@@ -502,15 +526,15 @@ if ((not home_was_set and real_executable_dir and not py_setpath) except (FileNotFoundError, PermissionError): if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)): build_prefix = joinpath(real_executable_dir, VPATH) @@ -148,7 +234,17 @@ index 9913fcb..6867e98 100644 build_stdlib_prefix = build_prefix else: build_stdlib_prefix = search_up(build_prefix, *BUILDSTDLIB_LANDMARKS) -@@ -597,7 +619,7 @@ else: +@@ -559,6 +583,9 @@ else: + # First try to detect prefix by looking alongside our runtime library, if known + if library and not prefix: + library_dir = dirname(library) ++ if os_name == 'nt' and is_mingw: ++ # QUIRK: On Windows, mingw Python DLLs are in the bin directory ++ library_dir = joinpath(library_dir, '..') + if ZIP_LANDMARK: + if os_name == 'nt': + # QUIRK: Windows does not search up for ZIP file +@@ -605,7 +632,7 @@ else: # Detect exec_prefix by searching from executable for the platstdlib_dir if PLATSTDLIB_LANDMARK and not exec_prefix: @@ -157,7 +253,7 @@ index 9913fcb..6867e98 100644 # QUIRK: Windows always assumed these were the same # gh-100320: Our PYDs are assumed to be relative to the Lib directory # (that is, prefix) rather than the executable (that is, executable_dir) -@@ -607,7 +629,7 @@ else: +@@ -615,7 +642,7 @@ else: if not exec_prefix and EXEC_PREFIX: exec_prefix = EXEC_PREFIX if not exec_prefix or not isdir(joinpath(exec_prefix, PLATSTDLIB_LANDMARK)): @@ -166,7 +262,16 @@ index 9913fcb..6867e98 100644 # QUIRK: If DLLs is missing on Windows, don't warn, just assume # that they're in exec_prefix if not platstdlib_dir: -@@ -660,7 +682,7 @@ elif not pythonpath_was_set: +@@ -653,7 +680,7 @@ else: + + if py_setpath: + # If Py_SetPath was called then it overrides any existing search path +- config['module_search_paths'] = py_setpath.split(DELIM) ++ config['module_search_paths'] = [_normpath(p) for p in py_setpath.split(DELIM)] + config['module_search_paths_set'] = 1 + + elif not pythonpath_was_set: +@@ -668,7 +695,7 @@ elif not pythonpath_was_set: pythonpath.append(abspath(p)) # Then add the default zip file @@ -175,7 +280,7 @@ index 9913fcb..6867e98 100644 # QUIRK: Windows uses the library directory rather than the prefix if library: library_dir = dirname(library) -@@ -673,7 +695,7 @@ elif not pythonpath_was_set: +@@ -681,7 +708,7 @@ elif not pythonpath_was_set: else: pythonpath.append(joinpath(prefix, ZIP_LANDMARK)) @@ -184,7 +289,7 @@ index 9913fcb..6867e98 100644 # QUIRK: Windows also lists paths in the registry. Paths are stored # as the default value of each subkey of # {HKCU,HKLM}\Software\Python\PythonCore\{winver}\PythonPath -@@ -714,7 +736,7 @@ elif not pythonpath_was_set: +@@ -722,7 +749,7 @@ elif not pythonpath_was_set: if not platstdlib_dir and exec_prefix: platstdlib_dir = joinpath(exec_prefix, PLATSTDLIB_LANDMARK) @@ -193,7 +298,16 @@ index 9913fcb..6867e98 100644 # QUIRK: Windows generates paths differently if platstdlib_dir: pythonpath.append(platstdlib_dir) -@@ -742,8 +764,8 @@ elif not pythonpath_was_set: +@@ -740,7 +767,7 @@ elif not pythonpath_was_set: + if platstdlib_dir: + pythonpath.append(platstdlib_dir) + +- config['module_search_paths'] = pythonpath ++ config['module_search_paths'] = [_normpath(p) for p in pythonpath] + config['module_search_paths_set'] = 1 + + +@@ -750,8 +777,8 @@ elif not pythonpath_was_set: # QUIRK: Non-Windows replaces prefix/exec_prefix with defaults when running # in build directory. This happens after pythonpath calculation. @@ -204,11 +318,47 @@ index 9913fcb..6867e98 100644 exec_prefix = config.get('exec_prefix') or EXEC_PREFIX or prefix +@@ -775,23 +802,23 @@ if pth: + warn("unsupported 'import' line in ._pth file") + else: + pythonpath.append(joinpath(pth_dir, line)) +- config['module_search_paths'] = pythonpath ++ config['module_search_paths'] = [_normpath(p) for p in pythonpath] + config['module_search_paths_set'] = 1 + + # ****************************************************************************** + # UPDATE config FROM CALCULATED VALUES + # ****************************************************************************** + +-config['program_name'] = program_name +-config['home'] = home +-config['executable'] = executable +-config['base_executable'] = base_executable +-config['prefix'] = prefix +-config['exec_prefix'] = exec_prefix +-config['base_prefix'] = base_prefix or prefix +-config['base_exec_prefix'] = base_exec_prefix or exec_prefix ++config['program_name'] = _normpath(program_name) ++config['home'] = _normpath(home) ++config['executable'] = _normpath(executable) ++config['base_executable'] = _normpath(base_executable) ++config['prefix'] = _normpath(prefix) ++config['exec_prefix'] = _normpath(exec_prefix) ++config['base_prefix'] = _normpath(base_prefix or prefix) ++config['base_exec_prefix'] = _normpath(base_exec_prefix or exec_prefix) + +-config['platlibdir'] = platlibdir ++config['platlibdir'] = _normpath(platlibdir) + # test_embed expects empty strings, not None +-config['stdlib_dir'] = stdlib_dir or '' +-config['platstdlib_dir'] = platstdlib_dir or '' ++config['stdlib_dir'] = _normpath(stdlib_dir or '') ++config['platstdlib_dir'] = _normpath(platstdlib_dir or '') diff --git a/Python/fileutils.c b/Python/fileutils.c -index 6d3b04f..50c78f1 100644 +index 0ae2a2e..a6e43e7 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c -@@ -2189,7 +2189,11 @@ _Py_abspath(const wchar_t *path, wchar_t **abspath_p) +@@ -2186,7 +2186,11 @@ _Py_abspath(const wchar_t *path, wchar_t **abspath_p) } #ifdef MS_WINDOWS @@ -221,7 +371,7 @@ index 6d3b04f..50c78f1 100644 #else wchar_t cwd[MAXPATHLEN + 1]; cwd[Py_ARRAY_LENGTH(cwd) - 1] = 0; -@@ -2401,11 +2405,16 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) +@@ -2491,11 +2495,16 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) wchar_t *minP2 = path; // the beginning of the destination range wchar_t lastC = L'\0'; // the last ljusted character, p2[-1] in most cases @@ -240,42 +390,37 @@ index 6d3b04f..50c78f1 100644 #endif #define SEP_OR_END(x) (IS_SEP(x) || IS_END(x)) -@@ -2416,7 +2425,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) - path++; +@@ -2508,15 +2517,15 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) + p2 = p1; + #else + for (; p2 < p1; ++p2) { +- if (*p2 == ALTSEP) { +- *p2 = SEP; ++ if (*p2 == altsep) { ++ *p2 = sep; + } } - p1 = p2 = minP2 = path; -- lastC = SEP; -+ lastC = sep; - } + #endif + minP2 = p2 - 1; + lastC = *minP2; #ifdef MS_WINDOWS - // Skip past drive segment and update minP2 -@@ -2430,13 +2439,13 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) - // and network paths, including the first segment. - else if (IS_SEP(&p1[0]) && IS_SEP(&p1[1])) { - int sepCount = 2; -- *p2++ = SEP; -- *p2++ = SEP; -+ *p2++ = sep; -+ *p2++ = sep; - p1 += 2; - for (; !IS_END(p1) && sepCount; ++p1) { - if (IS_SEP(p1)) { - --sepCount; -- *p2++ = lastC = SEP; -+ *p2++ = lastC = sep; - } else { - *p2++ = lastC = *p1; - } -@@ -2449,7 +2458,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) - *p2++ = *p1++; - *p2++ = *p1++; - minP2 = p2 - 1; // Absolute path has SEP at minP2 -- lastC = SEP; -+ lastC = sep; - } - #endif /* MS_WINDOWS */ - -@@ -2457,18 +2466,18 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) +- if (lastC != SEP) { ++ if (lastC != sep) { + minP2++; + } + #endif +@@ -2525,8 +2534,8 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) + // Skip leading '.\' + lastC = *++p1; + #ifdef ALTSEP +- if (lastC == ALTSEP) { +- lastC = SEP; ++ if (lastC == altsep) { ++ lastC = sep; + } + #endif + while (IS_SEP(p1)) { +@@ -2538,18 +2547,18 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) for (; !IS_END(p1); ++p1) { wchar_t c = *p1; #ifdef ALTSEP @@ -299,7 +444,7 @@ index 6d3b04f..50c78f1 100644 if (p2 == minP2 || (p3[0] == L'.' && p3[1] == L'.' && IS_SEP(&p3[2]))) { -@@ -2477,7 +2486,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) +@@ -2558,7 +2567,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) *p2++ = L'.'; *p2++ = L'.'; lastC = L'.'; @@ -308,7 +453,7 @@ index 6d3b04f..50c78f1 100644 // Absolute path, so absorb segment p2 = p3 + 1; } else { -@@ -2488,7 +2497,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) +@@ -2569,7 +2578,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) } else { *p2++ = lastC = c; } @@ -317,7 +462,7 @@ index 6d3b04f..50c78f1 100644 } else { *p2++ = lastC = c; } -@@ -2498,7 +2507,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) +@@ -2579,7 +2588,7 @@ _Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *normsize) } *p2 = L'\0'; if (p2 != minP2) { @@ -327,10 +472,10 @@ index 6d3b04f..50c78f1 100644 } } else { diff --git a/Python/pathconfig.c b/Python/pathconfig.c -index 1195a04..08a4a37 100644 +index 0033e18..8653915 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c -@@ -129,7 +129,7 @@ Py_GetSepW(const wchar_t *name) +@@ -127,7 +127,7 @@ Py_GetSepW(const wchar_t *name) return sep; } diff --git a/mingw-w64-python/0082-Don-t-build-_posixsubprocess-on-Windows.patch b/mingw-w64-python/0059-build-Don-t-build-_posixsubprocess-on-Windows.patch similarity index 68% rename from mingw-w64-python/0082-Don-t-build-_posixsubprocess-on-Windows.patch rename to mingw-w64-python/0059-build-Don-t-build-_posixsubprocess-on-Windows.patch index ff2d9e0ddf58e..5c582fc8c7bfb 100644 --- a/mingw-w64-python/0082-Don-t-build-_posixsubprocess-on-Windows.patch +++ b/mingw-w64-python/0059-build-Don-t-build-_posixsubprocess-on-Windows.patch @@ -1,17 +1,17 @@ -From 4bb41fcf9100a14fce24493cf0d28ce234fe8017 Mon Sep 17 00:00:00 2001 +From 6765f2c35286136504f59e55a831c028d23b2a72 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 20 Jun 2023 20:17:23 +0530 -Subject: [PATCH 082/N] Don't build _posixsubprocess on Windows. +Subject: [PATCH 059/N] build: Don't build _posixsubprocess on Windows. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 56bd3c1..c1188de 100644 +index 4c322b0..f26754a 100644 --- a/configure.ac +++ b/configure.ac -@@ -7879,7 +7879,6 @@ PY_STDLIB_MOD_SIMPLE([_json]) +@@ -8180,7 +8180,6 @@ PY_STDLIB_MOD_SIMPLE([_json]) PY_STDLIB_MOD_SIMPLE([_lsprof]) PY_STDLIB_MOD_SIMPLE([_opcode]) PY_STDLIB_MOD_SIMPLE([_pickle]) @@ -19,8 +19,8 @@ index 56bd3c1..c1188de 100644 PY_STDLIB_MOD_SIMPLE([_queue]) PY_STDLIB_MOD_SIMPLE([_random]) PY_STDLIB_MOD_SIMPLE([select]) -@@ -7932,6 +7931,7 @@ PY_STDLIB_MOD([_scproxy], - PY_STDLIB_MOD([spwd], [], [test "$ac_cv_func_getspent" = yes -o "$ac_cv_func_getspnam" = yes]) +@@ -8231,6 +8230,7 @@ PY_STDLIB_MOD([_scproxy], + [], [-framework SystemConfiguration -framework CoreFoundation]) PY_STDLIB_MOD([syslog], [], [test "$ac_cv_header_syslog_h" = yes]) PY_STDLIB_MOD([termios], [], [test "$ac_cv_header_termios_h" = yes]) +PY_STDLIB_MOD([_posixsubprocess], [], [test "$MACHDEP" != "win32"]) diff --git a/mingw-w64-python/0059-build-Integrate-venvlauncher-build-installation-into.patch b/mingw-w64-python/0059-build-Integrate-venvlauncher-build-installation-into.patch deleted file mode 100644 index a0b674d696dbc..0000000000000 --- a/mingw-w64-python/0059-build-Integrate-venvlauncher-build-installation-into.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 4e033763394be7fd3ffbd43c25a64118d0df4634 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sun, 25 Jul 2021 16:53:35 +0200 -Subject: [PATCH 059/N] build: Integrate venvlauncher build/installation into - the Makefile - -This is required for venv creation on Windows. -Ideally this would use the venv specific launcher (PC/launcher.c), -but a copy of main binary seems to work as well for now. ---- - Makefile.pre.in | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index fc1ea7d..073a770 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -170,6 +170,7 @@ BINLIBDEST= @BINLIBDEST@ - LIBDEST= $(SCRIPTDIR)/python$(VERSION) - INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION) - CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) -+VENVLAUNCHERDIR= $(BINLIBDEST)/venv/scripts/nt - - # Symbols used for using shared libraries - SHLIB_SUFFIX= @SHLIB_SUFFIX@ -@@ -290,6 +291,8 @@ LIBOBJS= @LIBOBJS@ - PYTHON= python$(EXE) - BUILDPYTHON= python$(BUILDEXE) - BUILDPYTHONW= pythonw$(BUILDEXE) -+BUILDVENVLAUNCHER= venvlauncher$(BUILDEXE) -+BUILDVENVWLAUNCHER= venvwlauncher$(BUILDEXE) - - HOSTRUNNER= @HOSTRUNNER@ - -@@ -630,7 +633,7 @@ all: @DEF_MAKE_ALL_RULE@ - .PHONY: all - - .PHONY: build_all --build_all: check-clean-src $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \ -+build_all: check-clean-src $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \ - gdbhooks Programs/_testembed scripts checksharedmods rundsymutil - - .PHONY: build_wasm -@@ -813,6 +816,14 @@ $(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw - $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o - $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o - -+# FIXME: build these from PC/launcher.c instead -+$(BUILDVENVLAUNCHER): $(BUILDPYTHON) -+ cp $(BUILDPYTHON) $(BUILDVENVLAUNCHER) -+ -+# FIXME: build these from PC/launcher.c instead -+$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) -+ cp $(BUILDPYTHONW) $(BUILDVENVWLAUNCHER) -+ - platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt - $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform - -@@ -1988,7 +1999,7 @@ sharedinstall: all - # This goes into $(exec_prefix) - .PHONY: altbininstall - altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ -- @for i in $(BINDIR) $(LIBDIR); \ -+ @for i in $(BINDIR) $(LIBDIR) $(VENVLAUNCHERDIR); \ - do \ - if test ! -d $(DESTDIR)$$i; then \ - echo "Creating directory $$i"; \ -@@ -1999,6 +2010,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ - if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ - $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ - $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \ -+ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(EXE); \ -+ $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(EXE); \ - else \ - $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ - fi diff --git a/mingw-w64-python/0060-ssl-module-add-MINGW-support.patch b/mingw-w64-python/0060-ssl-module-add-MINGW-support.patch new file mode 100644 index 0000000000000..2f162aeb7fc2e --- /dev/null +++ b/mingw-w64-python/0060-ssl-module-add-MINGW-support.patch @@ -0,0 +1,80 @@ +From 0798476d66127c0f40fae537226f4d5542951b5c Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Tue, 20 Jun 2023 20:35:27 +0530 +Subject: [PATCH 060/N] ssl module: add MINGW support + +--- + Modules/_ssl.c | 4 ++-- + Modules/clinic/_ssl.c.h | 8 ++++---- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index 64b6af4..a7489b5 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -5889,7 +5889,7 @@ _ssl_nid2obj_impl(PyObject *module, int nid) + return result; + } + +-#ifdef _MSC_VER ++#ifdef _WIN32 + + static PyObject* + certEncodingType(DWORD encodingType) +@@ -6208,7 +6208,7 @@ _ssl_enum_crls_impl(PyObject *module, const char *store_name) + } + } + +-#endif /* _MSC_VER */ ++#endif /* _WIN32 */ + + /* List of functions exported by this module. */ + static PyMethodDef PySSL_methods[] = { +diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h +index 628bd87..875b7ec 100644 +--- a/Modules/clinic/_ssl.c.h ++++ b/Modules/clinic/_ssl.c.h +@@ -2706,7 +2706,7 @@ exit: + return return_value; + } + +-#if defined(_MSC_VER) ++#if defined(_WIN32) + + PyDoc_STRVAR(_ssl_enum_certificates__doc__, + "enum_certificates($module, /, store_name)\n" +@@ -2783,9 +2783,9 @@ exit: + return return_value; + } + +-#endif /* defined(_MSC_VER) */ ++#endif /* defined(_WIN32) */ + +-#if defined(_MSC_VER) ++#if defined(_WIN32) + + PyDoc_STRVAR(_ssl_enum_crls__doc__, + "enum_crls($module, /, store_name)\n" +@@ -2861,7 +2861,7 @@ exit: + return return_value; + } + +-#endif /* defined(_MSC_VER) */ ++#endif /* defined(_WIN32) */ + + #ifndef _SSL_ENUM_CERTIFICATES_METHODDEF + #define _SSL_ENUM_CERTIFICATES_METHODDEF +diff --git a/configure.ac b/configure.ac +index f26754a..416b0fe 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -8308,7 +8308,7 @@ PY_STDLIB_MOD([_lzma], [], [test "$have_liblzma" = yes], + + dnl OpenSSL bindings + PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_working_openssl_ssl" = yes], +- [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS]) ++ [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS -lws2_32 -lcrypt32]) + PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes], + [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS]) + diff --git a/mingw-w64-python/0061-configure-Include-winsock.h-when-checking-for-netdb-.patch b/mingw-w64-python/0061-configure-Include-winsock.h-when-checking-for-netdb-.patch new file mode 100644 index 0000000000000..33b9c9062dc7f --- /dev/null +++ b/mingw-w64-python/0061-configure-Include-winsock.h-when-checking-for-netdb-.patch @@ -0,0 +1,58 @@ +From 35cbc599098d1483d71aec5f342aec9a3cf81487 Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Wed, 21 Jun 2023 15:42:39 +0530 +Subject: [PATCH 061/N] configure: Include `winsock.h` when checking for + netdb function + +Also move `gethostname` and `shutdown` to that check as they +depend on winsock.h. +--- + configure.ac | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 416b0fe..ab7d601 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5478,7 +5478,7 @@ AC_CHECK_FUNCS([ \ + faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \ + fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \ + gai_strerror getegid geteuid getgid getgrent getgrgid getgrgid_r \ +- getgrnam_r getgrouplist gethostname getitimer getloadavg getlogin getlogin_r \ ++ getgrnam_r getgrouplist getitimer getloadavg getlogin getlogin_r \ + getpeername getpgid getpid getppid getpriority _getpty \ + getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \ + getspnam getuid getwd grantpt if_nameindex initgroups kill killpg lchown linkat \ +@@ -5492,7 +5492,7 @@ AC_CHECK_FUNCS([ \ + sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \ + sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \ + setitimer setlocale setpgid setpgrp setpriority setregid setresgid \ +- setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \ ++ setresuid setreuid setsid setuid setvbuf sigaction sigaltstack \ + sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \ + sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \ + sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \ +@@ -5721,7 +5721,13 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [ + ]) + + dnl PY_CHECK_NETDB_FUNC(FUNCTION) +-AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [@%:@include ])]) ++AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [ ++#ifdef _WIN32 ++ #include ++#else ++ #include ++#endif ++])]) + + PY_CHECK_NETDB_FUNC([hstrerror]) + dnl not available in WASI yet +@@ -5730,6 +5736,8 @@ PY_CHECK_NETDB_FUNC([getservbyport]) + PY_CHECK_NETDB_FUNC([gethostbyname]) + PY_CHECK_NETDB_FUNC([gethostbyaddr]) + PY_CHECK_NETDB_FUNC([getprotobyname]) ++PY_CHECK_NETDB_FUNC([gethostname]) ++PY_CHECK_NETDB_FUNC([shutdown]) + + dnl PY_CHECK_SOCKET_FUNC(FUNCTION) + AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [ diff --git a/mingw-w64-python/0086-include-_multiprocessing-semaphore.c-on-win32.patch b/mingw-w64-python/0062-configure-always-build-_multiprocessing-on-Windows.patch similarity index 63% rename from mingw-w64-python/0086-include-_multiprocessing-semaphore.c-on-win32.patch rename to mingw-w64-python/0062-configure-always-build-_multiprocessing-on-Windows.patch index 2afa7954af7e7..1de20c0c97a91 100644 --- a/mingw-w64-python/0086-include-_multiprocessing-semaphore.c-on-win32.patch +++ b/mingw-w64-python/0062-configure-always-build-_multiprocessing-on-Windows.patch @@ -1,19 +1,18 @@ -From 2888fff678ba7e44f9e8bbbb0a0d3bbb9e67c761 Mon Sep 17 00:00:00 2001 +From 1e7a9a0dafa271149a2122a6b8161c0a3a227b8d Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Fri, 23 Jun 2023 20:13:23 +0530 -Subject: [PATCH 086/N] include `_multiprocessing/semaphore.c` on win32 +Subject: [PATCH 062/N] configure: always build _multiprocessing on Windows -while building `_multiprocessing` extension -also, always build that module on win32 +sem_unlink is not needed on Windows for the module. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 5a59971..8462adb 100644 +index ab7d601..8e92b5d 100644 --- a/configure.ac +++ b/configure.ac -@@ -7897,7 +7897,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo]) +@@ -8200,7 +8200,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo]) dnl multiprocessing modules PY_STDLIB_MOD([_multiprocessing], diff --git a/mingw-w64-python/0062-expanduser-normpath-paths-coming-from-env-vars.patch b/mingw-w64-python/0062-expanduser-normpath-paths-coming-from-env-vars.patch deleted file mode 100644 index 2541c12332207..0000000000000 --- a/mingw-w64-python/0062-expanduser-normpath-paths-coming-from-env-vars.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f23f3fc51cd51509dd46f27852b5464972943b7c Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sun, 8 Aug 2021 10:17:35 +0200 -Subject: [PATCH 062/N] expanduser: normpath paths coming from env vars - -This makes sure we get the same paths as with related functions in pathlib. ---- - Lib/ntpath.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Lib/ntpath.py b/Lib/ntpath.py -index c4855ae..f1d3333 100644 ---- a/Lib/ntpath.py -+++ b/Lib/ntpath.py -@@ -380,7 +380,7 @@ def expanduser(path): - if 'USERPROFILE' in os.environ: - userhome = os.environ['USERPROFILE'] - elif not 'HOMEPATH' in os.environ: -- return path -+ return os.path.normpath(path) - else: - try: - drive = os.environ['HOMEDRIVE'] -@@ -407,7 +407,7 @@ def expanduser(path): - if isinstance(path, bytes): - userhome = os.fsencode(userhome) - -- return userhome + path[i:] -+ return os.path.normpath(userhome) + path[i:] - - - # Expand paths containing shell variable substitutions. diff --git a/mingw-w64-python/0087-configure-build-mmap-module-on-win32.patch b/mingw-w64-python/0063-configure-build-mmap-module-on-win32.patch similarity index 79% rename from mingw-w64-python/0087-configure-build-mmap-module-on-win32.patch rename to mingw-w64-python/0063-configure-build-mmap-module-on-win32.patch index d8f4ac738d8ec..5da2563f4ceff 100644 --- a/mingw-w64-python/0087-configure-build-mmap-module-on-win32.patch +++ b/mingw-w64-python/0063-configure-build-mmap-module-on-win32.patch @@ -1,17 +1,17 @@ -From a778e3ff80ce714a42aa2280b600c844f916e4f8 Mon Sep 17 00:00:00 2001 +From 07bb7f749bd060d58dc6b3c0a4e12723264808c8 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Fri, 23 Jun 2023 20:15:38 +0530 -Subject: [PATCH 087/N] configure: build `mmap` module on win32 +Subject: [PATCH 063/N] configure: build `mmap` module on win32 --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 8462adb..f1947af 100644 +index 8e92b5d..1b9f229 100644 --- a/configure.ac +++ b/configure.ac -@@ -7917,7 +7917,9 @@ PY_STDLIB_MOD([fcntl], +@@ -8219,7 +8219,9 @@ PY_STDLIB_MOD([fcntl], [], [test "$ac_cv_header_sys_ioctl_h" = "yes" -a "$ac_cv_header_fcntl_h" = "yes"], [], [$FCNTL_LIBS]) PY_STDLIB_MOD([mmap], diff --git a/mingw-w64-python/0064-Define-PY3_DLLNAME-to-fix-build.patch b/mingw-w64-python/0064-Define-PY3_DLLNAME-to-fix-build.patch deleted file mode 100644 index d0b8ef1968225..0000000000000 --- a/mingw-w64-python/0064-Define-PY3_DLLNAME-to-fix-build.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 04d4ccfa737631413f3c5de013718f909f459c0b Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 12 Oct 2021 18:35:21 +0530 -Subject: [PATCH 064/N] Define PY3_DLLNAME to fix build - -PY3_DLLNAME is used in Python/pathconfig.c but isn't -defined. I guess it is useless but it will fix the build. - -Co-authored-by: jeremyd2019 ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index e884431..2b37fe3 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5143,7 +5143,7 @@ then - *-*-mingw*) - DYNLOADFILE="dynload_win.o" - extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" -- CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"'" -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"' -DPY3_DLLNAME='L\"$DLLLIBRARY\"'" - ;; - esac - fi diff --git a/mingw-w64-python/0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch b/mingw-w64-python/0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch similarity index 70% rename from mingw-w64-python/0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch rename to mingw-w64-python/0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch index 797157ccd12d4..7bb302119467c 100644 --- a/mingw-w64-python/0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch +++ b/mingw-w64-python/0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch @@ -1,17 +1,17 @@ -From 672b0b08c964fd164ce94f305d9276f10b8b16fa Mon Sep 17 00:00:00 2001 +From ea59902b7623ac07f02bcdf2be59f6127a19c5fb Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 23 Jun 2023 21:47:32 +0200 -Subject: [PATCH 090/N] configure.ac: set BUILDEXEEXT and EXEEXT +Subject: [PATCH 064/N] configure: set BUILDEXEEXT and EXEEXT --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac -index 305a401..b3c3ab0 100644 +index 1b9f229..c18baf5 100644 --- a/configure.ac +++ b/configure.ac -@@ -1409,6 +1409,7 @@ AC_ARG_WITH([suffix], +@@ -1424,6 +1424,7 @@ AC_ARG_WITH([suffix], [Emscripten/browser*], [EXEEXT=.js], [Emscripten/node*], [EXEEXT=.js], [WASI/*], [EXEEXT=.wasm], @@ -19,7 +19,7 @@ index 305a401..b3c3ab0 100644 [EXEEXT=] ) ]) -@@ -1435,6 +1436,10 @@ else +@@ -1450,6 +1451,10 @@ else fi rmdir CaseSensitiveTestDir diff --git a/mingw-w64-python/0065-_testconsole.c-Fix-casing-path-sep.patch b/mingw-w64-python/0065-_testconsole.c-Fix-casing-path-sep.patch deleted file mode 100644 index e2b636fe0df81..0000000000000 --- a/mingw-w64-python/0065-_testconsole.c-Fix-casing-path-sep.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e6ce651ac8a32677e26f6f019948293b4d89bf85 Mon Sep 17 00:00:00 2001 -From: Long Nguyen -Date: Sun, 14 Nov 2021 14:55:35 +0700 -Subject: [PATCH 065/N] _testconsole.c: Fix casing & path sep - ---- - PC/_testconsole.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/PC/_testconsole.c b/PC/_testconsole.c -index 3221b98..47fbe6f 100644 ---- a/PC/_testconsole.c -+++ b/PC/_testconsole.c -@@ -116,7 +116,7 @@ _testconsole_read_output_impl(PyObject *module, PyObject *file) - Py_RETURN_NONE; - } - --#include "clinic\_testconsole.c.h" -+#include "clinic/_testconsole.c.h" - - PyMethodDef testconsole_methods[] = { - _TESTCONSOLE_WRITE_INPUT_METHODDEF diff --git a/mingw-w64-python/0091-configure.ac-fix-building-some-test-modules.patch b/mingw-w64-python/0065-configure-fix-building-some-test-modules.patch similarity index 62% rename from mingw-w64-python/0091-configure.ac-fix-building-some-test-modules.patch rename to mingw-w64-python/0065-configure-fix-building-some-test-modules.patch index 7a41788527eab..95b0c5902016f 100644 --- a/mingw-w64-python/0091-configure.ac-fix-building-some-test-modules.patch +++ b/mingw-w64-python/0065-configure-fix-building-some-test-modules.patch @@ -1,19 +1,19 @@ -From 21653df04700f5026f805373ceef81ec5867004e Mon Sep 17 00:00:00 2001 +From f1002ab0520ee913abaf1de11876ce4f18156719 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 23 Jun 2023 23:42:39 +0200 -Subject: [PATCH 091/N] configure.ac: fix building some test modules +Subject: [PATCH 065/N] configure: fix building some test modules they are guarded by dlopen being present, but if module loading is enabled is more correct. --- - configure.ac | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) + configure.ac | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac -index b3c3ab0..172c673 100644 +index c18baf5..b6ea5de 100644 --- a/configure.ac +++ b/configure.ac -@@ -5174,8 +5174,11 @@ fi +@@ -5403,8 +5403,11 @@ fi AC_MSG_RESULT([$DYNLOADFILE]) if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -24,15 +24,18 @@ index b3c3ab0..172c673 100644 + have_dynamic_loading=no fi - # MACHDEP_OBJS can be set to platform-specific object files needed by Python -@@ -8047,20 +8050,20 @@ PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes]) - PY_STDLIB_MOD([_testclinic], [test "$TEST_MODULES" = yes]) - PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes], [], [-DPY3_DLLNAME="\"$DLLLIBRARY\""], []) + # MS_DLL_ID is used for sys.winver and Windows registry keys. +@@ -8346,21 +8349,21 @@ PY_STDLIB_MOD([_testclinic_limited], [test "$TEST_MODULES" = yes]) + PY_STDLIB_MOD([_testlimitedcapi], [test "$TEST_MODULES" = yes]) + PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes]) -PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) -PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +-PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes]) +PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes]) ++PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes]) + PY_STDLIB_MOD([_testexternalinspection], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([xxsubtype], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"]) @@ -42,12 +45,11 @@ index b3c3ab0..172c673 100644 [], [$LIBM]) dnl Limited API template modules. - dnl The limited C API is not compatible with the Py_TRACE_REFS macro. dnl Emscripten does not support shared libraries yet. --PY_STDLIB_MOD([xxlimited], [test "$with_trace_refs" = "no"], [test "$ac_cv_func_dlopen" = yes]) --PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_func_dlopen" = yes]) -+PY_STDLIB_MOD([xxlimited], [test "$with_trace_refs" = "no"], [test "$have_dynamic_loading" = yes]) -+PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$have_dynamic_loading" = yes]) +-PY_STDLIB_MOD([xxlimited], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +-PY_STDLIB_MOD([xxlimited_35], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) ++PY_STDLIB_MOD([xxlimited], [test "$TEST_MODULES" = "yes"], [test "$have_dynamic_loading" = yes]) ++PY_STDLIB_MOD([xxlimited_35], [test "$TEST_MODULES" = "yes"], [test "$have_dynamic_loading" = yes]) # substitute multiline block, must come after last PY_STDLIB_MOD() AC_SUBST([MODULE_BLOCK]) diff --git a/mingw-w64-python/0093-Always-convert-to-before-passing-though-pathcch-func.patch b/mingw-w64-python/0066-Always-convert-to-before-passing-though-pathcch-func.patch similarity index 88% rename from mingw-w64-python/0093-Always-convert-to-before-passing-though-pathcch-func.patch rename to mingw-w64-python/0066-Always-convert-to-before-passing-though-pathcch-func.patch index 3364e53e3890e..6f0330f0966bb 100644 --- a/mingw-w64-python/0093-Always-convert-to-before-passing-though-pathcch-func.patch +++ b/mingw-w64-python/0066-Always-convert-to-before-passing-though-pathcch-func.patch @@ -1,7 +1,7 @@ -From ac3e6cf2a90c822e7e0b8a3f9bc52966ba123133 Mon Sep 17 00:00:00 2001 +From 92e36836625fe369891a48b02010a28bb861365d Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 25 Jun 2023 17:24:11 +0530 -Subject: [PATCH 093/N] Always convert `/` to `\\` before passing though +Subject: [PATCH 066/N] Always convert `/` to `\\` before passing though pathcch functions they don't seems to handle `/` as path separator correctly @@ -12,7 +12,7 @@ they don't seems to handle `/` as path separator correctly 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h -index 5d29201..21346ba 100644 +index 6eb171d..2963239 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -28,6 +28,8 @@ PyAPI_FUNC(char) Py_GetSepA(const char *); @@ -25,10 +25,10 @@ index 5d29201..21346ba 100644 /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level * exit functions. diff --git a/Python/fileutils.c b/Python/fileutils.c -index 50c78f1..aae4143 100644 +index a6e43e7..00f1e6a 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c -@@ -2144,19 +2144,31 @@ int +@@ -2141,19 +2141,31 @@ int _Py_isabs(const wchar_t *path) { #ifdef MS_WINDOWS @@ -64,7 +64,7 @@ index 50c78f1..aae4143 100644 return 1; #else return (path[0] == SEP); -@@ -2303,6 +2315,8 @@ join_relfile(wchar_t *buffer, size_t bufsize, +@@ -2393,6 +2405,8 @@ join_relfile(wchar_t *buffer, size_t bufsize, const wchar_t *dirname, const wchar_t *relfile) { #ifdef MS_WINDOWS @@ -74,10 +74,10 @@ index 50c78f1..aae4143 100644 PATHCCH_ALLOW_LONG_PATHS))) { return -1; diff --git a/Python/pathconfig.c b/Python/pathconfig.c -index 08a4a37..8053b91 100644 +index 8653915..dc36dde 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c -@@ -155,6 +155,22 @@ Py_NormalizeSepsW(wchar_t *name) +@@ -153,6 +153,22 @@ Py_NormalizeSepsW(wchar_t *name) } } diff --git a/mingw-w64-python/0066-Return-consistent-architecture-markers-for-python-on.patch b/mingw-w64-python/0066-Return-consistent-architecture-markers-for-python-on.patch deleted file mode 100644 index 52d5d57471769..0000000000000 --- a/mingw-w64-python/0066-Return-consistent-architecture-markers-for-python-on.patch +++ /dev/null @@ -1,52 +0,0 @@ -From d8f8e18cf11fbf9d5374b15644dd388228959e79 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Storsj=C3=B6?= -Date: Fri, 19 Nov 2021 12:18:06 +0200 -Subject: [PATCH 066/N] Return consistent architecture markers for python on - mingw/armv7 - ---- - Lib/sysconfig.py | 2 ++ - Python/getcompiler.c | 2 ++ - configure.ac | 3 +++ - 3 files changed, 7 insertions(+) - -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 2a67b84..0150c18 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -823,6 +823,8 @@ def get_platform(): - return 'mingw_x86_64_clang' - if 'arm64' in sys.version.lower(): - return 'mingw_aarch64' -+ if 'arm' in sys.version.lower(): -+ return 'mingw_armv7' - return 'mingw_i686_clang' - if 'amd64' in sys.version.lower(): - return 'mingw_x86_64' -diff --git a/Python/getcompiler.c b/Python/getcompiler.c -index 275f799..4b0b9b3 100644 ---- a/Python/getcompiler.c -+++ b/Python/getcompiler.c -@@ -20,6 +20,8 @@ - #define ARCH_SUFFIX " 64 bit (AMD64)" - #elif defined(__aarch64__) - #define ARCH_SUFFIX " 64 bit (ARM64)" -+#elif defined(__arm__) -+#define ARCH_SUFFIX " 32 bit (ARM)" - #else - #define ARCH_SUFFIX " 32 bit" - #endif -diff --git a/configure.ac b/configure.ac -index 2b37fe3..4c757d8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6332,6 +6332,9 @@ case $host_os in - aarch64-*-mingw*) - PYD_PLATFORM_TAG+="mingw_aarch64" - ;; -+ armv7-*-mingw*) -+ PYD_PLATFORM_TAG+="mingw_armv7" -+ ;; - esac - AC_MSG_RESULT($PYD_PLATFORM_TAG) - esac diff --git a/mingw-w64-python/0067-handle-ncursesw-pkg-config-when-cross-compiling.patch b/mingw-w64-python/0067-handle-ncursesw-pkg-config-when-cross-compiling.patch deleted file mode 100644 index 527b5e1cc1b92..0000000000000 --- a/mingw-w64-python/0067-handle-ncursesw-pkg-config-when-cross-compiling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 01ea756b774c7ae2eacf705a132427e3b84c7803 Mon Sep 17 00:00:00 2001 -From: jeremyd2019 -Date: Mon, 22 Nov 2021 16:04:41 -0800 -Subject: [PATCH 067/N] handle ncursesw pkg-config when cross-compiling - -strip extra args from pkg-config --cflags-only-I, setup.py is only expecting a single path. - -Use pkg-config ncursesw include dir even if cross-compiling (PKG_CONFIG_PATH should be set in that case). ---- - configure.ac | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 4c757d8..ec3962e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6929,7 +6929,7 @@ AS_VAR_IF([have_panel], [no], [ - ]) - - if test -n "$PKG_CONFIG"; then -- NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`" -+ NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ .*$//'`" - else - NCURSESW_INCLUDEDIR="" - fi -@@ -6937,9 +6937,7 @@ AC_SUBST(NCURSESW_INCLUDEDIR) - - # first curses header check - ac_save_cppflags="$CPPFLAGS" --if test "$cross_compiling" = no; then -- CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR" --fi -+CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR" - - # On Solaris, term.h requires curses.h - AC_CHECK_HEADERS([term.h], [], [], [ diff --git a/mingw-w64-python/0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch b/mingw-w64-python/0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch new file mode 100644 index 0000000000000..7429cd5e07176 --- /dev/null +++ b/mingw-w64-python/0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch @@ -0,0 +1,25 @@ +From c8ca1c30b1cf305d57654c5b154b06434a632484 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 1 Jan 2026 18:38:30 +0100 +Subject: [PATCH 067/N] pylifecycle.h: remove conflicting _Py_CheckPython3 + declaration + +_Py_CheckPython3 is a static function +--- + Include/pylifecycle.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h +index 2963239..026d98f 100644 +--- a/Include/pylifecycle.h ++++ b/Include/pylifecycle.h +@@ -53,9 +53,6 @@ Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); + Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); + Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); + Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPath(void); +-#ifdef MS_WINDOWS +-int _Py_CheckPython3(void); +-#endif + + /* In their own files */ + PyAPI_FUNC(const char *) Py_GetVersion(void); diff --git a/mingw-w64-python/0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch b/mingw-w64-python/0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch similarity index 64% rename from mingw-w64-python/0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch rename to mingw-w64-python/0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch index 561ca639d99ab..11c4794694637 100644 --- a/mingw-w64-python/0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch +++ b/mingw-w64-python/0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch @@ -1,25 +1,23 @@ -From 480b3a1ff99558ce4bec2c61a792a47ee43637e7 Mon Sep 17 00:00:00 2001 +From 98a1456e37a36ebbf0ef5bd115ef7e14702bdd13 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sat, 5 Aug 2023 14:10:27 +0530 -Subject: [PATCH 099/N] Search DLLs only on paths added using - `add_dll_directory()`. +Subject: [PATCH 068/N] dynload_win: add env var for reverting the legacy DLL + loading paths -This is the default behavior on upstream Python. We previously -reverted this behavior because it broke some use cases. +PYTHONLEGACYWINDOWSDLLLOADING makes Python use LOAD_WITH_ALTERED_SEARCH_PATH +again when loading DLLs. We currently need this with an uninstalled Python +and for code which does not use add_dll_directory(), or doesn't have a way +to use it. -The old behavior can be restored by setting the environment variable -PYTHONLEGACYWINDOWSDLLLOADING to 1. - -Fixes https://github.com/msys2-contrib/cpython-mingw/issues/48 -Also fixes https://github.com/msys2-contrib/cpython-mingw/issues/141 +Ideally it should be removed at some point. Signed-off-by: Naveen M K --- Lib/test/__main__.py | 8 ++++++++ - Python/dynload_win.c | 16 ++++++++++++++-- + Python/dynload_win.c | 17 ++++++++++++++--- Tools/build/check_extension_modules.py | 4 ++++ mingw_smoketests.py | 3 +++ - 4 files changed, 29 insertions(+), 2 deletions(-) + 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py index 82b50ad..25bac39 100644 @@ -37,7 +35,7 @@ index 82b50ad..25bac39 100644 + main(_add_python_opts=True) diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index 1f90e21..db79687 100644 +index a0ac31c..a46ddfd 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -4,6 +4,7 @@ @@ -46,11 +44,11 @@ index 1f90e21..db79687 100644 #include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_initconfig.h" - #ifdef HAVE_DIRECT_H - #include -@@ -225,6 +226,18 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, - dl_funcptr p; - char funcname[258], *import_python; + #include "pycore_importdl.h" // dl_funcptr + #include "patchlevel.h" // PY_MAJOR_VERSION +@@ -211,6 +212,18 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, + _Py_CheckPython3(); + #endif /* Py_ENABLE_SHARED */ + int use_legacy = 0; + DWORD load_library_flags = 0; @@ -64,24 +62,25 @@ index 1f90e21..db79687 100644 + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR; + } + - #ifdef _MSC_VER - _Py_CheckPython3(); - #endif /* _MSC_VER */ -@@ -249,8 +262,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, + wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL); + if (wpathname == NULL) + return NULL; +@@ -231,9 +244,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, AddDllDirectory function. We add SEARCH_DLL_LOAD_DIR to ensure DLLs adjacent to the PYD are preferred. */ Py_BEGIN_ALLOW_THREADS - hDLL = LoadLibraryExW(wpathname, NULL, -- LOAD_WITH_ALTERED_SEARCH_PATH); +- LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | +- LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); + hDLL = LoadLibraryExW(wpathname, NULL, load_library_flags); Py_END_ALLOW_THREADS PyMem_Free(wpathname); diff --git a/Tools/build/check_extension_modules.py b/Tools/build/check_extension_modules.py -index aa1ade7..7ded0f4 100644 +index e0c7a92..fab01cf 100644 --- a/Tools/build/check_extension_modules.py +++ b/Tools/build/check_extension_modules.py -@@ -61,6 +61,10 @@ WINDOWS_MODULES = { +@@ -64,6 +64,10 @@ WINDOWS_MODULES = { "winsound", } @@ -93,16 +92,16 @@ index aa1ade7..7ded0f4 100644 logger = logging.getLogger(__name__) diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 516005c..ca1f652 100644 +index 7aff2d4..bbaaaeb 100644 --- a/mingw_smoketests.py +++ b/mingw_smoketests.py -@@ -34,6 +34,9 @@ if os.environ.get("MSYSTEM", ""): +@@ -35,6 +35,9 @@ if sys._use_alt_sep: else: SEP = "\\" +if sysconfig.is_python_build(): + os.environ["PYTHONLEGACYWINDOWSDLLLOADING"] = "1" + - _UCRT = sysconfig.get_platform() not in ('mingw_x86_64', 'mingw_i686') + _UCRT = 'ucrt' in sysconfig.get_platform() diff --git a/mingw-w64-python/0068-mingw_smoketests-fix-_UCRT-condition.patch b/mingw-w64-python/0068-mingw_smoketests-fix-_UCRT-condition.patch deleted file mode 100644 index c286daae3205f..0000000000000 --- a/mingw-w64-python/0068-mingw_smoketests-fix-_UCRT-condition.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 99dbe205f23c2e8cd35d0cf5d9e9062490d10282 Mon Sep 17 00:00:00 2001 -From: jeremyd2019 -Date: Sat, 22 Jan 2022 11:33:00 -0800 -Subject: [PATCH 068/N] mingw_smoketests: fix _UCRT condition - -The prior detection missed ARM (32 and 64) being UCRT. Since there are fewer non-UCRT platforms, list those two instead of trying to extend the list of UCRT. ---- - mingw_smoketests.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index d92c74a..ce95846 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -34,7 +34,7 @@ if "MSYSTEM" in os.environ: - else: - SEP = "\\" - --_UCRT = "clang" in sysconfig.get_platform() or "ucrt" in sysconfig.get_platform() -+_UCRT = sysconfig.get_platform() not in ('mingw_x86_64', 'mingw_i686') - - - class Tests(unittest.TestCase): diff --git a/mingw-w64-python/0069-Modify-sys.winver-to-match-upstream.patch b/mingw-w64-python/0069-Modify-sys.winver-to-match-upstream.patch deleted file mode 100644 index bc113a5c9d04e..0000000000000 --- a/mingw-w64-python/0069-Modify-sys.winver-to-match-upstream.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 12dd8cedd47e2147df10a7b9bb222743b0d82458 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Wed, 19 Jan 2022 19:39:20 +0530 -Subject: [PATCH 069/N] Modify `sys.winver` to match upstream - -With this change `sys.winver` will add the Arch for which -python was compiled on, for example in 32-bits, `sys.winver` -will be `3.10-32`, for arm32 it would be `3.10-arm32` and -so on. - -See https://github.com/msys2-contrib/cpython-mingw/issues/40 ---- - configure.ac | 22 ++++++++++++++++++---- - mingw_smoketests.py | 9 ++++++++- - 2 files changed, 26 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index ec3962e..e8d63cd 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5141,10 +5141,24 @@ then - esac - case $host in - *-*-mingw*) -- DYNLOADFILE="dynload_win.o" -- extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" -- CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"' -DPY3_DLLNAME='L\"$DLLLIBRARY\"'" -- ;; -+ DYNLOADFILE="dynload_win.o" -+ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" -+ CFLAGS_NODIST="$CFLAGS_NODIST -DPY3_DLLNAME='L\"$DLLLIBRARY\"'" -+ case $host in -+ i686*) -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-32\"'" -+ ;; -+ armv7*) -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm32\"'" -+ ;; -+ aarch64*) -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm64\"'" -+ ;; -+ *) -+ CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"'" -+ ;; -+ esac -+ ;; - esac - fi - AC_MSG_RESULT([$DYNLOADFILE]) -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index ce95846..aa76659 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -214,7 +214,14 @@ class Tests(unittest.TestCase): - ext_suffixes = importlib.machinery.EXTENSION_SUFFIXES - self.assertTrue(ext_suffix in ext_suffixes) - self.assertTrue(".pyd" in ext_suffixes) -- self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2]))) -+ if sysconfig.get_platform().startswith('mingw_i686'): -+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-32') -+ elif sysconfig.get_platform().startswith('mingw_aarch64'): -+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm64') -+ elif sysconfig.get_platform().startswith('mingw_armv7'): -+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm32') -+ else: -+ self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2]))) - self.assertEqual(platform.python_implementation(), "CPython") - self.assertEqual(platform.system(), "Windows") - self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0) diff --git a/mingw-w64-python/0101-Port-GetPythonImport-to-mingw.patch b/mingw-w64-python/0069-dynload_win-Port-GetPythonImport-to-MINGW.patch similarity index 85% rename from mingw-w64-python/0101-Port-GetPythonImport-to-mingw.patch rename to mingw-w64-python/0069-dynload_win-Port-GetPythonImport-to-MINGW.patch index bd2dd31bfff7f..bf921298b3080 100644 --- a/mingw-w64-python/0101-Port-GetPythonImport-to-mingw.patch +++ b/mingw-w64-python/0069-dynload_win-Port-GetPythonImport-to-MINGW.patch @@ -1,7 +1,7 @@ -From f72f52c9d19124e4f87b0023578719061a6ff079 Mon Sep 17 00:00:00 2001 +From ee8669aed98aae63d3e1ada0be830e6f24b0cc1e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 27 Aug 2023 15:00:32 +0200 -Subject: [PATCH 101/N] Port GetPythonImport() to mingw +Subject: [PATCH 069/N] dynload_win: Port GetPythonImport() to MINGW This looks for DLL names in the import table but while with MSVC the DLL is named python311.dll in our case it is named libpython3.11.dll. @@ -11,10 +11,10 @@ Adjust the strings and lengths accordingly. 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index db79687..36d1c7a 100644 +index a46ddfd..71e8c4b 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c -@@ -56,6 +56,16 @@ const char *_PyImport_DynLoadFiletab[] = { +@@ -37,6 +37,16 @@ const char *_PyImport_DynLoadFiletab[] = { #define DWORD_AT(mem) (*(DWORD *)(mem)) #define WORD_AT(mem) (*(WORD *)(mem)) @@ -31,7 +31,7 @@ index db79687..36d1c7a 100644 static char *GetPythonImport (HINSTANCE hModule) { unsigned char *dllbase, *import_data, *import_name; -@@ -122,15 +132,15 @@ static char *GetPythonImport (HINSTANCE hModule) +@@ -103,15 +113,15 @@ static char *GetPythonImport (HINSTANCE hModule) import_off); while (DWORD_AT(import_data)) { import_name = dllbase + DWORD_AT(import_data+12); @@ -51,7 +51,7 @@ index db79687..36d1c7a 100644 #endif import_data += 20; continue; -@@ -138,7 +148,7 @@ static char *GetPythonImport (HINSTANCE hModule) +@@ -119,7 +129,7 @@ static char *GetPythonImport (HINSTANCE hModule) /* Ensure python prefix is followed only by numbers to the end of the basename */ @@ -60,7 +60,7 @@ index db79687..36d1c7a 100644 #ifdef _DEBUG while (*pch && pch[0] != '_' && pch[1] != 'd' && pch[2] != '.') { #else -@@ -329,9 +339,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, +@@ -311,9 +321,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, PyOS_snprintf(buffer, sizeof(buffer), #ifdef _DEBUG diff --git a/mingw-w64-python/0070-Change-user-site-packages-path-to-include-the-enviro.patch b/mingw-w64-python/0070-Change-user-site-packages-path-to-include-the-enviro.patch deleted file mode 100644 index 165de901c71e6..0000000000000 --- a/mingw-w64-python/0070-Change-user-site-packages-path-to-include-the-enviro.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 5e148853344f2640abbebb81916f64be369f902c Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Wed, 19 Jan 2022 20:01:45 +0530 -Subject: [PATCH 070/N] Change user site-packages path to include the - environment info - -This should avoid mixing of user site-packages between python -from various environments. Previously, the user site-packages -should be located at `~/.local/lib/python3.10` for all environment -including 32-bits variants which caused problems with 64-bit trying to -load 32-bit extensions. Now this path will be changed to -`~/.local/lib/python3.10-`, for example, in -CLANG64 this would be `~/.local/lib/python3.10-mingw_x86_64_clang`. - -Fixes https://github.com/msys2-contrib/cpython-mingw/issues/40 ---- - Lib/site.py | 28 +++++++++++++++++++++++++--- - Lib/sysconfig.py | 26 +++++++++++++++----------- - 2 files changed, 40 insertions(+), 14 deletions(-) - -diff --git a/Lib/site.py b/Lib/site.py -index 938b0a2..c1ecd6e 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -310,14 +310,36 @@ def _getuserbase(): - - return joinuser("~", ".local") - -+# Copy of sysconfig.get_platform() but only for MinGW -+def _get_platform(): -+ if os.name == 'nt': -+ if 'gcc' in sys.version.lower(): -+ if 'ucrt' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_ucrt' -+ return 'mingw_i686_ucrt' -+ if 'clang' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_clang' -+ if 'arm64' in sys.version.lower(): -+ return 'mingw_aarch64' -+ if 'arm' in sys.version.lower(): -+ return 'mingw_armv7' -+ return 'mingw_i686_clang' -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64' -+ return 'mingw_i686' -+ return sys.platform - - # Same to sysconfig.get_path('purelib', os.name+'_user') - def _get_path(userbase): - version = sys.version_info - -- if os.name == 'nt' and not _POSIX_BUILD: -- ver_nodot = sys.winver.replace('.', '') -- return f'{userbase}\\Python{ver_nodot}\\site-packages' -+ if os.name == 'nt': -+ if not _POSIX_BUILD: -+ ver_nodot = sys.winver.replace('.', '') -+ return f'{userbase}\\Python{ver_nodot}\\site-packages' -+ return f'{userbase}/lib/python{version[0]}.{version[1]}-{_get_platform()}/site-packages' - - if sys.platform == 'darwin' and sys._framework: - return f'{userbase}/lib/python/site-packages' -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 0150c18..916c1e8 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -141,20 +141,20 @@ if _HAS_USER_BASE: - _INSTALL_SCHEMES |= { - # NOTE: When modifying "purelib" scheme, update site._get_path() too. - 'nt_user': { -- 'stdlib': '{userbase}/lib/python{py_version_short}', -- 'platstdlib': '{userbase}/lib/python{py_version_short}', -- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', -- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', -- 'include': '{userbase}/include/python{py_version_short}', -+ 'stdlib': '{userbase}/lib/python{py_version_short_plat}', -+ 'platstdlib': '{userbase}/lib/python{py_version_short_plat}', -+ 'purelib': '{userbase}/lib/python{py_version_short_plat}/site-packages', -+ 'platlib': '{userbase}/lib/python{py_version_short_plat}/site-packages', -+ 'include': '{userbase}/include/python{py_version_short_plat}', - 'scripts': '{userbase}/bin', - 'data': '{userbase}', - }, - 'posix_user': { -- 'stdlib': '{userbase}/{platlibdir}/python{py_version_short}', -- 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}', -- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', -- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', -- 'include': '{userbase}/include/python{py_version_short}', -+ 'stdlib': '{userbase}/{platlibdir}/python{py_version_short_plat}', -+ 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short_plat}', -+ 'purelib': '{userbase}/lib/python{py_version_short_plat}/site-packages', -+ 'platlib': '{userbase}/lib/python{py_version_short_plat}/site-packages', -+ 'include': '{userbase}/include/python{py_version_short_plat}', - 'scripts': '{userbase}/bin', - 'data': '{userbase}', - }, -@@ -702,6 +702,10 @@ def _init_config_vars(): - _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '') - except AttributeError: - _CONFIG_VARS['py_version_nodot_plat'] = '' -+ if os.name == 'nt' and _POSIX_BUILD: -+ _CONFIG_VARS['py_version_short_plat'] = f'{_PY_VERSION_SHORT}-{get_platform()}' -+ else: -+ _CONFIG_VARS['py_version_short_plat'] = _PY_VERSION_SHORT - - if os.name == 'nt' and not _POSIX_BUILD: - _init_non_posix(_CONFIG_VARS) -@@ -789,7 +793,7 @@ def get_config_var(name): - """ - return get_config_vars().get(name) - -- -+# make sure to change site._get_platform() while changing this function - def get_platform(): - """Return a string that identifies the current platform. - diff --git a/mingw-w64-python/0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch b/mingw-w64-python/0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch similarity index 67% rename from mingw-w64-python/0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch rename to mingw-w64-python/0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch index 612cace9db4f0..3ffc0e717bd39 100644 --- a/mingw-w64-python/0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch +++ b/mingw-w64-python/0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch @@ -1,8 +1,8 @@ -From 4538f351001dbed681093df085c068e2cff4d8f6 Mon Sep 17 00:00:00 2001 +From 83234c52af73eea1c648e5ef87107c26f03523ad Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 27 Aug 2023 16:04:50 +0200 -Subject: [PATCH 102/N] LoadLibraryExW: make sure to only use backslashes for - paths +Subject: [PATCH 070/N] dynload_win: make sure to only use backslashes for + paths with LoadLibraryExW It seems like in case the path passed to it is absolute, but contains forward slashes then LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR does not work @@ -15,21 +15,14 @@ Normalize everything to backslashes again before passing it to LoadLibraryExW. Fixes #151 --- - Python/dynload_win.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) + Python/dynload_win.c | 9 +++++++++ + 1 file changed, 9 insertions(+) diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index 36d1c7a..caa4968 100644 +index 71e8c4b..d575592 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c -@@ -252,10 +252,22 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, - _Py_CheckPython3(); - #endif /* _MSC_VER */ - -+// So we can adjust the separators in the path below -+#define USE_UNICODE_WCHAR_CACHE 0 -+ - wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL); +@@ -238,6 +238,15 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, if (wpathname == NULL) return NULL; diff --git a/mingw-w64-python/0071-configure-Include-a-header-in-the-check-for-_beginth.patch b/mingw-w64-python/0071-configure-Include-a-header-in-the-check-for-_beginth.patch deleted file mode 100644 index 40211d517a066..0000000000000 --- a/mingw-w64-python/0071-configure-Include-a-header-in-the-check-for-_beginth.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 077f7447d50d418f35d96e1269e5eed8bc0b51a7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Storsj=C3=B6?= -Date: Thu, 21 Apr 2022 14:25:51 +0300 -Subject: [PATCH 071/N] configure: Include a header in the check for - _beginthread - -Previously, the test tried compiling a call to the -_beginthread function without either declaring the function -(and its parameters) or including the corresponding header. - -Since Clang 15 (which still is under development, so this may -still change before it's released) [1], implicit function -declarations are a hard error by default, when building code -in C99 mode (or newer). - -[1] https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626 ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index e8d63cd..8a0f79c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2870,7 +2870,7 @@ AC_MSG_RESULT([$with_nt_threads]) - if test $with_nt_threads = yes ; then - AC_MSG_CHECKING([whether linking with nt-threads work]) - AC_LINK_IFELSE([ -- AC_LANG_PROGRAM([[]],[[_beginthread(0, 0, 0);]]) -+ AC_LANG_PROGRAM([[#include ]],[[_beginthread(0, 0, 0);]]) - ], - [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([failed to link with nt-threads])]) diff --git a/mingw-w64-python/0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch b/mingw-w64-python/0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch new file mode 100644 index 0000000000000..d94786d9fc9ca --- /dev/null +++ b/mingw-w64-python/0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch @@ -0,0 +1,26 @@ +From c4f101b2fe3f2de6a3dbfd6b50eb62d164cc5e4f Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 1 Jan 2026 18:40:13 +0100 +Subject: [PATCH 071/N] dynload_win: don't run _Py_CheckPython3 for MINGW + builds + +--- + Python/dynload_win.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Python/dynload_win.c b/Python/dynload_win.c +index d575592..d3aa513 100644 +--- a/Python/dynload_win.c ++++ b/Python/dynload_win.c +@@ -218,9 +218,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, + dl_funcptr p; + char funcname[258], *import_python; + +-#ifdef Py_ENABLE_SHARED ++#if defined(Py_ENABLE_SHARED) && defined(_MSC_VER) + _Py_CheckPython3(); +-#endif /* Py_ENABLE_SHARED */ ++#endif /* defined(Py_ENABLE_SHARED) && defined(_MSC_VER) */ + + int use_legacy = 0; + DWORD load_library_flags = 0; diff --git a/mingw-w64-python/0100-Build-and-install-libpython3.dll.patch b/mingw-w64-python/0072-build-Build-and-install-libpython3.dll-stable-ABI.patch similarity index 79% rename from mingw-w64-python/0100-Build-and-install-libpython3.dll.patch rename to mingw-w64-python/0072-build-Build-and-install-libpython3.dll-stable-ABI.patch index 0a032db3e9d8d..18e2468d5eaff 100644 --- a/mingw-w64-python/0100-Build-and-install-libpython3.dll.patch +++ b/mingw-w64-python/0072-build-Build-and-install-libpython3.dll-stable-ABI.patch @@ -1,7 +1,7 @@ -From 016327ca53842e76a7105f02220b987411f44d6d Mon Sep 17 00:00:00 2001 +From a419526f9c9f3de5daabe32e6764020430623d87 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 21 Aug 2023 08:19:28 +0200 -Subject: [PATCH 100/N] Build and install libpython3.dll +Subject: [PATCH 072/N] build: Build and install libpython3.dll (stable ABI) This provides the limited ABI as a separate DLL, forwarding to the real one. This makes linking with "-lpython3" work. @@ -13,28 +13,28 @@ Fixes #147 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 2d2a64f..e9ded19 100644 +index 5b0ae97..409dc65 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -273,6 +273,8 @@ LIBRARY_DEPS= @LIBRARY_DEPS@ +@@ -288,6 +288,8 @@ LIBRARY_DEPS= @LIBRARY_DEPS@ LINK_PYTHON_DEPS=@LINK_PYTHON_DEPS@ PY_ENABLE_SHARED= @PY_ENABLE_SHARED@ STATIC_LIBPYTHON= @STATIC_LIBPYTHON@ -+ABI3DLLLIBRARY= libpython3.dll -+ABI3LDLIBRARY= libpython3.dll.a ++ABI3DLLLIBRARY= libpython3$(ABIFLAGS).dll ++ABI3LDLIBRARY= libpython3$(ABIFLAGS).dll.a LIBS= @LIBS@ -@@ -633,7 +635,7 @@ all: @DEF_MAKE_ALL_RULE@ +@@ -710,7 +712,7 @@ list-targets: .PHONY: build_all - build_all: check-clean-src $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \ + build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \ - gdbhooks Programs/_testembed scripts checksharedmods rundsymutil + gdbhooks Programs/_testembed scripts checksharedmods rundsymutil $(ABI3DLLLIBRARY) $(ABI3LDLIBRARY) .PHONY: build_wasm build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \ -@@ -808,6 +810,9 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.rc +@@ -899,6 +901,9 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.rc python_nt.o: $(srcdir)/PC/python_nt.rc $(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@ @@ -44,7 +44,7 @@ index 2d2a64f..e9ded19 100644 venvlauncher.o: $(srcdir)/PC/pylauncher.rc $(WINDRES) $(RCFLAGS) -DPY_ICON -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pylauncher.rc $@ -@@ -921,6 +926,10 @@ $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o +@@ -1029,6 +1034,10 @@ $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o else true; \ fi @@ -55,7 +55,7 @@ index 2d2a64f..e9ded19 100644 # wasm32-emscripten browser build # wasm assets directory is relative to current build dir, e.g. "./usr/local". # --preload-file turns a relative asset path into an absolute path. -@@ -2029,6 +2038,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ +@@ -2258,6 +2267,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ if test -n "$(DLLLIBRARY)" ; then \ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ @@ -63,7 +63,7 @@ index 2d2a64f..e9ded19 100644 else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ -@@ -2506,6 +2516,7 @@ libainstall: all scripts +@@ -2746,6 +2756,7 @@ libainstall: all scripts if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \ @@ -71,17 +71,17 @@ index 2d2a64f..e9ded19 100644 else \ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ fi; \ -@@ -2759,7 +2770,7 @@ clean: clean-retain-profile clean-bolt +@@ -3054,7 +3065,7 @@ clean: clean-retain-profile clean-bolt .PHONY: clobber clobber: clean - -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ -+ -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY)$(ABI3LDLIBRARY) $(ABI3DLLLIBRARY) \ ++ -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) $(ABI3LDLIBRARY) $(ABI3DLLLIBRARY) \ tags TAGS \ config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform diff --git a/PC/python3dll.c b/PC/python3dll.c -index 505feef..ee9380c 100755 +index eb077df..453e8cb 100755 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -2,6 +2,7 @@ diff --git a/mingw-w64-python/0073-Fix-failing-tests.patch b/mingw-w64-python/0073-Fix-failing-tests.patch deleted file mode 100644 index 0433991bcd99e..0000000000000 --- a/mingw-w64-python/0073-Fix-failing-tests.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 10be5ee7595ba0bf8011b8de375ede06b963d105 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 5 Jun 2022 20:28:53 +0530 -Subject: [PATCH 073/N] Fix failing tests - -- In `test_sysconfig`, ignore `test_sysconfig.TestSysConfig.test_user_similar` test failure. -- Copy `get_platform()` from from distutils.utils to test_importlib/test_windows.py. -- In `test_tcl`, ignore `test_tcl.TclTest.testLoadWithUNC` test failure. -- Disable `test.test_asynchat.TestAsynchat.test_line_terminator2`, seems flaky. -- skip some more flaky tests -- some basic fixes for test_getpath -- test_sysconfig.py: fix tests related to mingw ---- - Lib/test/test_getpath.py | 3 +++ - Lib/test/test_importlib/test_windows.py | 17 +++++++++++++++++ - Lib/test/test_sysconfig.py | 8 ++++++-- - mingw_ignorefile.txt | 13 +++++++++++-- - 4 files changed, 37 insertions(+), 4 deletions(-) - -diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py -index 3b613a5..4dc2d30 100644 ---- a/Lib/test/test_getpath.py -+++ b/Lib/test/test_getpath.py -@@ -837,6 +837,7 @@ DEFAULT_NAMESPACE = dict( - ENV_PYTHONHOME="", - ENV_PYTHONEXECUTABLE="", - ENV___PYVENV_LAUNCHER__="", -+ ENV_MSYSTEM="", - argv0="", - py_setpath="", - real_executable="", -@@ -876,6 +877,7 @@ class MockNTNamespace(dict): - self.update(DEFAULT_NAMESPACE) - self["config"] = DEFAULT_CONFIG.copy() - self["os_name"] = "nt" -+ self["is_mingw"] = 0 - self["PLATLIBDIR"] = "DLLs" - self["PYWINVER"] = "9.8-XY" - self["VPATH"] = r"..\.." -@@ -1052,6 +1054,7 @@ class MockPosixNamespace(dict): - self.update(DEFAULT_NAMESPACE) - self["config"] = DEFAULT_CONFIG.copy() - self["os_name"] = "posix" -+ self["is_mingw"] = 0 - self["PLATLIBDIR"] = "lib" - self["WITH_NEXT_FRAMEWORK"] = 0 - super().__init__(*a, **kw) -diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py -index 40b8aa1..03b5a98 100644 ---- a/Lib/test/test_importlib/test_windows.py -+++ b/Lib/test/test_importlib/test_windows.py -@@ -24,6 +24,23 @@ def get_platform(): - 'x64' : 'win-amd64', - 'arm' : 'win-arm32', - } -+ if os.name == 'nt': -+ if 'gcc' in sys.version.lower(): -+ if 'ucrt' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_ucrt' -+ return 'mingw_i686_ucrt' -+ if 'clang' in sys.version.lower(): -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64_clang' -+ if 'arm64' in sys.version.lower(): -+ return 'mingw_aarch64' -+ if 'arm' in sys.version.lower(): -+ return 'mingw_armv7' -+ return 'mingw_i686_clang' -+ if 'amd64' in sys.version.lower(): -+ return 'mingw_x86_64' -+ return 'mingw_i686' - if ('VSCMD_ARG_TGT_ARCH' in os.environ and - os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT): - return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']] -diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 67647e1..a883037 100644 ---- a/Lib/test/test_sysconfig.py -+++ b/Lib/test/test_sysconfig.py -@@ -19,7 +19,7 @@ import sysconfig - from sysconfig import (get_paths, get_platform, get_config_vars, - get_path, get_path_names, _INSTALL_SCHEMES, - get_default_scheme, get_scheme_names, get_config_var, -- _expand_vars, _get_preferred_schemes, _main) -+ _expand_vars, _get_preferred_schemes, _main, _POSIX_BUILD) - import _osx_support - - -@@ -197,7 +197,7 @@ class TestSysConfig(unittest.TestCase): - self.assertEqual(libpath, sysconfig.get_path('purelib', scheme='nt_venv', vars=vars)) - - def test_venv_scheme(self): -- if sys.platform == 'win32': -+ if not _POSIX_BUILD and sys.platform == 'win32': - self.assertEqual( - sysconfig.get_path('scripts', scheme='venv'), - sysconfig.get_path('scripts', scheme='nt_venv') -@@ -388,6 +388,10 @@ class TestSysConfig(unittest.TestCase): - if HAS_USER_BASE: - user_path = get_path(name, 'posix_user') - expected = os.path.normpath(global_path.replace(base, user, 1)) -+ if os.name == 'nt' and _POSIX_BUILD: -+ expected = expected.replace( -+ f'python{sysconfig.get_python_version()}', -+ f'python{sysconfig.get_python_version()}-{get_platform()}') - # bpo-44860: platlib of posix_user doesn't use sys.platlibdir, - # whereas posix_prefix does. - if name == 'platlib': -diff --git a/mingw_ignorefile.txt b/mingw_ignorefile.txt -index dc3802e..e692d7f 100644 ---- a/mingw_ignorefile.txt -+++ b/mingw_ignorefile.txt -@@ -1,4 +1,4 @@ --ctypes.test.test_loading.LoaderTest.test_load_dll_with_flags -+test.test_ctypes.test_loading.LoaderTest.test_load_dll_with_flags - distutils.tests.test_bdist_dumb.BuildDumbTestCase.test_simple_built - distutils.tests.test_cygwinccompiler.CygwinCCompilerTestCase.test_get_versions - distutils.tests.test_util.UtilTestCase.test_change_root -@@ -29,6 +29,15 @@ test.test_strptime.TimeRETests.test_compile - test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date - test.test_venv.BasicTest.* - test.test_venv.EnsurePipTest.* -+test.test_sysconfig.TestSysConfig.test_user_similar -+test.test_tcl.TclTest.testLoadWithUNC -+test.test_wmi - # flaky - test.test__xxsubinterpreters.* --test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe -\ No newline at end of file -+test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe -+test.test_asynchat.TestAsynchat.test_line_terminator2 -+test.test_asyncgen.AsyncGenAsyncioTest.test_async_gen_asyncio_gc_aclose_09 -+test.test_concurrent_futures.ThreadPoolShutdownTest.test_interpreter_shutdown -+test.test_asynchat.TestNotConnected.test_disallow_negative_terminator -+test.test_logging.SysLogHandlerTest.* -+test.test_logging.IPv6SysLogHandlerTest.* diff --git a/mingw-w64-python/0073-configure-define-_DEBUG-for-a-debug-build.patch b/mingw-w64-python/0073-configure-define-_DEBUG-for-a-debug-build.patch new file mode 100644 index 0000000000000..05310b5ee0103 --- /dev/null +++ b/mingw-w64-python/0073-configure-define-_DEBUG-for-a-debug-build.patch @@ -0,0 +1,61 @@ +From e3d22cd2d009ff684c1f59bdd80ac2ec7b64fa84 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 29 Aug 2025 08:50:31 +0300 +Subject: [PATCH 073/N] configure: define _DEBUG for a debug build + +The Windows code expects it in some places for a debug build + +Skip some things which fail to link with _DEBUG +--- + Modules/_winapi.c | 2 +- + PC/clinic/msvcrtmodule.c.h | 4 ++-- + configure.ac | 1 + + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Modules/_winapi.c b/Modules/_winapi.c +index 3c2eb81..8d29c46 100644 +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c +@@ -1491,7 +1491,7 @@ static PyObject * + _winapi_ExitProcess_impl(PyObject *module, UINT ExitCode) + /*[clinic end generated code: output=a387deb651175301 input=4f05466a9406c558]*/ + { +- #if defined(Py_DEBUG) ++ #if defined(Py_DEBUG) && defined(_MSC_VER) + #ifdef MS_WINDOWS_DESKTOP + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT| + SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); +diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h +index e3f7ea4..f425fb1 100644 +--- a/PC/clinic/msvcrtmodule.c.h ++++ b/PC/clinic/msvcrtmodule.c.h +@@ -483,7 +483,7 @@ exit: + + #endif /* defined(MS_WINDOWS_DESKTOP) */ + +-#if defined(_DEBUG) ++#if defined(_DEBUG) && defined(_MSC_VER) + + PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__, + "CrtSetReportFile($module, type, file, /)\n" +@@ -530,7 +530,7 @@ exit: + + #endif /* defined(_DEBUG) */ + +-#if defined(_DEBUG) ++#if defined(_DEBUG) && defined(_MSC_VER) + + PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__, + "CrtSetReportMode($module, type, mode, /)\n" +diff --git a/configure.ac b/configure.ac +index b6ea5de..0e4a937 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2469,6 +2469,7 @@ _RESTORE_VAR([CFLAGS]) + PYDEBUG_CFLAGS="-O0" + AS_VAR_IF([ac_cv_cc_supports_og], [yes], + [PYDEBUG_CFLAGS="-Og"]) ++PYDEBUG_CFLAGS="-D_DEBUG $PYDEBUG_CFLAGS" + + # tweak OPT based on compiler and platform, only if the user didn't set + # it on the command line diff --git a/mingw-w64-python/0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch b/mingw-w64-python/0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch deleted file mode 100644 index 76ca1d440d89a..0000000000000 --- a/mingw-w64-python/0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 7f17ffbeccd24a89830ec34250b8930bda3163d8 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Thu, 22 Sep 2022 17:51:33 +0200 -Subject: [PATCH 074/N] Don't change os.sep with an empty MSYSTEM env var, - not just a missing one - -Up until now this didn't really happen when calling from cygwin -because empty env vars were removed before Python would run. - -But https://github.com/msys2/msys2-runtime/pull/101 changed that. - -To avoid breaking users that did something like - -MSYSTEM= python ... - -not only check that MSYSTEM isn't set but also that it isn't empty -when deciding if os.sep/os.altsep should be switched. - -Also, guard the msystem env check to execute only on MINGW - -Co-authored-by: Naveen M K ---- - Lib/importlib/_bootstrap_external.py | 2 +- - Lib/ntpath.py | 2 +- - Python/pathconfig.c | 20 +++++++++++--------- - mingw_smoketests.py | 2 +- - 4 files changed, 14 insertions(+), 12 deletions(-) - -diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py -index 1fbbc55..a177fa7 100644 ---- a/Lib/importlib/_bootstrap_external.py -+++ b/Lib/importlib/_bootstrap_external.py -@@ -43,7 +43,7 @@ if _MS_WINDOWS: - else: - path_separators = ['/'] - --if 'MSYSTEM' in _os.environ: -+if _os.environ.get('MSYSTEM', ''): - path_separators = path_separators[::-1] - - # Assumption made in _path_join() -diff --git a/Lib/ntpath.py b/Lib/ntpath.py -index f1d3333..1323ac2 100644 ---- a/Lib/ntpath.py -+++ b/Lib/ntpath.py -@@ -21,7 +21,7 @@ import stat - import genericpath - from genericpath import * - --if sys.platform == "win32" and "MSYSTEM" in os.environ: -+if sys.platform == "win32" and os.environ.get("MSYSTEM", ""): - sep = '/' - altsep = '\\' - else: -diff --git a/Python/pathconfig.c b/Python/pathconfig.c -index 3d684d6..1195a04 100644 ---- a/Python/pathconfig.c -+++ b/Python/pathconfig.c -@@ -2,7 +2,7 @@ - - #include "Python.h" - #include "marshal.h" // PyMarshal_ReadObjectFromString --#include "osdefs.h" // DELIM -+#include "osdefs.h" // DELIM, SEP - #include "pycore_initconfig.h" - #include "pycore_fileutils.h" - #include "pycore_pathconfig.h" -@@ -50,7 +50,6 @@ Py_StartsWithW(const wchar_t * str, const wchar_t * prefix) - char - Py_GetSepA(const char *name) - { -- char* msystem = (char*)2; /* So that non Windows use / as sep */ - static char sep = '\0'; - #ifdef _WIN32 - /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx -@@ -65,12 +64,14 @@ Py_GetSepA(const char *name) - if (sep != '\0') - return sep; - #if defined(__MINGW32__) -- msystem = Py_GETENV("MSYSTEM"); --#endif -- if (msystem != NULL) -+ char* msystem = getenv("MSYSTEM"); -+ if (msystem != NULL && strcmp(msystem, "") != 0) - sep = '/'; - else - sep = '\\'; -+#else -+ sep = SEP; -+#endif - return sep; - } - -@@ -103,7 +104,6 @@ Py_NormalizeSepsA(char *name) - wchar_t - Py_GetSepW(const wchar_t *name) - { -- char* msystem = (char*)2; /* So that non Windows use / as sep */ - static wchar_t sep = L'\0'; - #ifdef _WIN32 - /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx -@@ -118,12 +118,14 @@ Py_GetSepW(const wchar_t *name) - if (sep != L'\0') - return sep; - #if defined(__MINGW32__) -- msystem = Py_GETENV("MSYSTEM"); --#endif -- if (msystem != NULL) -+ char* msystem = getenv("MSYSTEM"); -+ if (msystem != NULL && strcmp(msystem, "") != 0) - sep = L'/'; - else - sep = L'\\'; -+#else -+ sep = SEP; -+#endif - return sep; - } - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index aa76659..2a8bd16 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -29,7 +29,7 @@ import os - import unittest - import sysconfig - --if "MSYSTEM" in os.environ: -+if os.environ.get("MSYSTEM", ""): - SEP = "/" - else: - SEP = "\\" diff --git a/mingw-w64-python/0104-Add-missing-library-for-multiprocessing-module.patch b/mingw-w64-python/0074-configure-fix-multiprocessing-module.patch similarity index 78% rename from mingw-w64-python/0104-Add-missing-library-for-multiprocessing-module.patch rename to mingw-w64-python/0074-configure-fix-multiprocessing-module.patch index 5a8fae87395bf..fdf3590dedad3 100644 --- a/mingw-w64-python/0104-Add-missing-library-for-multiprocessing-module.patch +++ b/mingw-w64-python/0074-configure-fix-multiprocessing-module.patch @@ -1,7 +1,7 @@ -From 23c180a7c8baa6c73a50f9f3366705cfb84e397b Mon Sep 17 00:00:00 2001 +From 5a0c4f1933af8aabdb605e08f298465df9a85482 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Mon, 1 Jan 2024 13:42:01 +0530 -Subject: [PATCH 104/N] Add missing library for multiprocessing module +Subject: [PATCH 074/N] configure: fix multiprocessing module `ws2_32` is required when building that module --- @@ -9,10 +9,10 @@ Subject: [PATCH 104/N] Add missing library for multiprocessing module 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 9671d72..0a82add 100644 +index 0e4a937..50b6e88 100644 --- a/configure.ac +++ b/configure.ac -@@ -4282,6 +4282,13 @@ AS_CASE([$MACHDEP], +@@ -4491,6 +4491,13 @@ AS_CASE([$MACHDEP], [SOCKET_LIBS=""] ) @@ -26,7 +26,7 @@ index 9671d72..0a82add 100644 dnl detect sqlite3 from Emscripten emport PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3]) -@@ -7899,7 +7906,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo]) +@@ -8210,7 +8217,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo]) dnl multiprocessing modules PY_STDLIB_MOD([_multiprocessing], [], [test "$ac_cv_func_sem_unlink" = "yes" -o "$MACHDEP" = "win32"], diff --git a/mingw-w64-python/0105-selectmodule-add-support-for-MINGW.patch b/mingw-w64-python/0075-build-add-MINGW-support-for-selectmodule.patch similarity index 77% rename from mingw-w64-python/0105-selectmodule-add-support-for-MINGW.patch rename to mingw-w64-python/0075-build-add-MINGW-support-for-selectmodule.patch index 95814aedfb5f3..498dfaa6632d7 100644 --- a/mingw-w64-python/0105-selectmodule-add-support-for-MINGW.patch +++ b/mingw-w64-python/0075-build-add-MINGW-support-for-selectmodule.patch @@ -1,7 +1,7 @@ -From aaee576929e1baa4259c69a6655c1527dff49655 Mon Sep 17 00:00:00 2001 +From 8e1d7d97e461474107d796dac070cabe9162ac14 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Mon, 1 Jan 2024 14:14:45 +0530 -Subject: [PATCH 105/N] selectmodule: add support for MINGW +Subject: [PATCH 075/N] build: add MINGW support for selectmodule --- Modules/selectmodule.c | 6 +++--- @@ -9,10 +9,10 @@ Subject: [PATCH 105/N] selectmodule: add support for MINGW 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c -index 50788e5..89396f3 100644 +index 5bd9b77..11ba70d 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c -@@ -169,9 +169,9 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) +@@ -168,9 +168,9 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) v = PyObject_AsFileDescriptor( o ); if (v == -1) goto finally; @@ -24,7 +24,7 @@ index 50788e5..89396f3 100644 if (!_PyIsSelectable_fd(v)) { PyErr_SetString(PyExc_ValueError, "filedescriptor out of range in select()"); -@@ -179,7 +179,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) +@@ -178,7 +178,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) } if (v > max) max = v; @@ -34,10 +34,10 @@ index 50788e5..89396f3 100644 /* add object and its file descriptor to the list */ diff --git a/configure.ac b/configure.ac -index 0a82add..353ff02 100644 +index 50b6e88..65960d9 100644 --- a/configure.ac +++ b/configure.ac -@@ -4288,6 +4288,11 @@ AS_CASE([$MACHDEP], +@@ -4497,6 +4497,11 @@ AS_CASE([$MACHDEP], [MULTIPROCESSING_LIBS=""] ) @@ -49,7 +49,7 @@ index 0a82add..353ff02 100644 dnl detect sqlite3 from Emscripten emport PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3]) -@@ -7896,7 +7901,7 @@ PY_STDLIB_MOD_SIMPLE([_opcode]) +@@ -8206,7 +8211,7 @@ PY_STDLIB_MOD_SIMPLE([_opcode]) PY_STDLIB_MOD_SIMPLE([_pickle]) PY_STDLIB_MOD_SIMPLE([_queue]) PY_STDLIB_MOD_SIMPLE([_random]) @@ -57,4 +57,4 @@ index 0a82add..353ff02 100644 +PY_STDLIB_MOD_SIMPLE([select], [], [$SELECTMODULE_LIBS]) PY_STDLIB_MOD_SIMPLE([_struct]) PY_STDLIB_MOD_SIMPLE([_typing]) - PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters]) + PY_STDLIB_MOD_SIMPLE([_interpreters]) diff --git a/mingw-w64-python/0076-Make-_Py_CheckPython3-extern.patch b/mingw-w64-python/0076-Make-_Py_CheckPython3-extern.patch deleted file mode 100644 index 7b9f7d8aa8e3e..0000000000000 --- a/mingw-w64-python/0076-Make-_Py_CheckPython3-extern.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 2837bc7be6480ce403564055043cb36c5e620b35 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 18 Jun 2023 13:17:48 +0530 -Subject: [PATCH 076/N] Make `_Py_CheckPython3` extern - -it's declared in headers but defined as static here, remove it -also run `_Py_CheckPython3` only when using MSVC ---- - Python/dynload_win.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/Python/dynload_win.c b/Python/dynload_win.c -index 26d6036..1f90e21 100644 ---- a/Python/dynload_win.c -+++ b/Python/dynload_win.c -@@ -171,8 +171,7 @@ static char *GetPythonImport (HINSTANCE hModule) - Return whether the DLL was found. - */ - extern HMODULE PyWin_DLLhModule; --static int --_Py_CheckPython3(void) -+int _Py_CheckPython3(void) - { - static int python3_checked = 0; - static HANDLE hPython3; -@@ -226,9 +225,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, - dl_funcptr p; - char funcname[258], *import_python; - --#ifdef Py_ENABLE_SHARED -- _Py_CheckPython3(); --#endif /* Py_ENABLE_SHARED */ -+#ifdef _MSC_VER -+ _Py_CheckPython3(); -+#endif /* _MSC_VER */ - - wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL); - if (wpathname == NULL) diff --git a/mingw-w64-python/0076-configure-disable-various-modules-on-MINGW.patch b/mingw-w64-python/0076-configure-disable-various-modules-on-MINGW.patch new file mode 100644 index 0000000000000..403124d30f323 --- /dev/null +++ b/mingw-w64-python/0076-configure-disable-various-modules-on-MINGW.patch @@ -0,0 +1,34 @@ +From 2d4d696d0cb839958a788ef60ce71f1712b269ed Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Mon, 1 Jan 2024 14:19:41 +0530 +Subject: [PATCH 076/N] configure: disable various modules on MINGW + +--- + configure.ac | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 65960d9..35b94f8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -8072,6 +8072,20 @@ AS_CASE([$ac_sys_system], + ) + ], + [CYGWIN*], [PY_STDLIB_MOD_SET_NA([_scproxy])], ++ [MINGW*], [ ++ PY_STDLIB_MOD_SET_NA( ++ [readline], ++ [_posixshmem], ++ [_posixsubprocess], ++ [fcntl], ++ [grp], ++ [pwd], ++ [resource], ++ [syslog], ++ [termios], ++ [_scproxy], ++ ) ++ ], + [QNX*], [PY_STDLIB_MOD_SET_NA([_scproxy])], + [FreeBSD*], [PY_STDLIB_MOD_SET_NA([_scproxy])], + [Emscripten|WASI], [ diff --git a/mingw-w64-python/0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch b/mingw-w64-python/0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch similarity index 71% rename from mingw-w64-python/0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch rename to mingw-w64-python/0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch index fedc79b560d2f..841ec46f4de79 100644 --- a/mingw-w64-python/0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch +++ b/mingw-w64-python/0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch @@ -1,17 +1,17 @@ -From aba641db02f42ee4dc11613788391515a5f97de7 Mon Sep 17 00:00:00 2001 +From e6b73ecf50b707bbbe4aebff50e054fbaa405d48 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Mon, 1 Jan 2024 14:25:11 +0530 -Subject: [PATCH 107/N] Add libraries to fix compile of ctypes on MINGW +Subject: [PATCH 077/N] configure: Add libraries to fix ctypes on MINGW --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index e15e19a..159d4fe 100644 +index 35b94f8..e626fab 100644 --- a/configure.ac +++ b/configure.ac -@@ -4294,6 +4294,12 @@ AS_CASE([$MACHDEP], +@@ -4503,6 +4503,12 @@ AS_CASE([$MACHDEP], [SELECTMODULE_LIBS=""] ) @@ -24,16 +24,16 @@ index e15e19a..159d4fe 100644 dnl detect sqlite3 from Emscripten emport PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3]) -@@ -7991,7 +7997,7 @@ PY_STDLIB_MOD([_crypt], - [$LIBCRYPT_CFLAGS], [$LIBCRYPT_LIBS]) +@@ -8309,7 +8315,7 @@ PY_STDLIB_MOD([_blake2], + PY_STDLIB_MOD([_ctypes], [], [test "$have_libffi" = yes], - [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS]) + [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS $CTYPES_LIBS]) PY_STDLIB_MOD([_curses], - [], [test "$have_curses" != "no"], + [], [test "$have_curses" = "yes"], [$CURSES_CFLAGS], [$CURSES_LIBS] -@@ -8062,7 +8068,7 @@ PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) +@@ -8385,7 +8391,7 @@ PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"]) PY_STDLIB_MOD([_ctypes_test], [test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$have_dynamic_loading" = yes], @@ -41,4 +41,4 @@ index e15e19a..159d4fe 100644 + [], [$LIBM $CTYPES_LIBS]) dnl Limited API template modules. - dnl The limited C API is not compatible with the Py_TRACE_REFS macro. + dnl Emscripten does not support shared libraries yet. diff --git a/mingw-w64-python/0077-link-with-bcrypt.patch b/mingw-w64-python/0077-link-with-bcrypt.patch deleted file mode 100644 index bdca5c06682a0..0000000000000 --- a/mingw-w64-python/0077-link-with-bcrypt.patch +++ /dev/null @@ -1,22 +0,0 @@ -From aa75fc6c4398f67bec02ed7632aca083eaec7457 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 18 Jun 2023 14:20:44 +0530 -Subject: [PATCH 077/N] link with bcrypt - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 2258bb5..01344fe 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7231,7 +7231,7 @@ AC_MSG_RESULT([done]) - # For mingw build need additional library for linking - case $host in - *-*-mingw*) -- LIBS="$LIBS -lversion -lshlwapi -lpathcch" -+ LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt" - AC_PROG_AWK - if test "$AWK" = "gawk"; then - awk_extra_flag="--non-decimal-data" diff --git a/mingw-w64-python/0109-Enable-_uuid-on-MINGW.patch b/mingw-w64-python/0078-configure-Enable-_uuid-on-MINGW.patch similarity index 78% rename from mingw-w64-python/0109-Enable-_uuid-on-MINGW.patch rename to mingw-w64-python/0078-configure-Enable-_uuid-on-MINGW.patch index ebffbc01dedf0..8151abcba27e5 100644 --- a/mingw-w64-python/0109-Enable-_uuid-on-MINGW.patch +++ b/mingw-w64-python/0078-configure-Enable-_uuid-on-MINGW.patch @@ -1,17 +1,17 @@ -From b2eab751414b439d440d3d29ea4c4fd2dc29984a Mon Sep 17 00:00:00 2001 +From 815cf3b2af97c2fc8dfccefcf405d34a51fb3ea1 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Mon, 1 Jan 2024 15:04:43 +0530 -Subject: [PATCH 109/N] Enable `_uuid` on MINGW +Subject: [PATCH 078/N] configure: Enable `_uuid` on MINGW --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 159d4fe..2575149 100644 +index e626fab..62ff78c 100644 --- a/configure.ac +++ b/configure.ac -@@ -4300,6 +4300,12 @@ AS_CASE([$MACHDEP], +@@ -4509,6 +4509,12 @@ AS_CASE([$MACHDEP], [CTYPES_LIBS=""] ) @@ -24,7 +24,7 @@ index 159d4fe..2575149 100644 dnl detect sqlite3 from Emscripten emport PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3]) -@@ -8027,8 +8033,8 @@ PY_STDLIB_MOD([_tkinter], +@@ -8344,8 +8350,8 @@ PY_STDLIB_MOD([_tkinter], [], [test "$have_tcltk" = "yes"], [$TCLTK_CFLAGS], [$TCLTK_LIBS]) PY_STDLIB_MOD([_uuid], diff --git a/mingw-w64-python/0114-gcc-make-incompatible-pointer-types-as-warning.patch b/mingw-w64-python/0079-configure-make-incompatible-pointer-types-a-warning.patch similarity index 80% rename from mingw-w64-python/0114-gcc-make-incompatible-pointer-types-as-warning.patch rename to mingw-w64-python/0079-configure-make-incompatible-pointer-types-a-warning.patch index 53b17db8009ba..8950ccf9904c5 100644 --- a/mingw-w64-python/0114-gcc-make-incompatible-pointer-types-as-warning.patch +++ b/mingw-w64-python/0079-configure-make-incompatible-pointer-types-a-warning.patch @@ -1,7 +1,8 @@ -From 9638204b854adedbeca465d1dc9f8e8a8b27d443 Mon Sep 17 00:00:00 2001 +From a034490464c36cf2909649204b3281a0b9cd0531 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Thu, 11 Jul 2024 13:58:20 +0530 -Subject: [PATCH 114/N] gcc: make `incompatible-pointer-types` as warning +Subject: [PATCH 079/N] configure: make `incompatible-pointer-types` a + warning gcc 14 changed `incompatible-pointer-types` from warning to error for now, make it as warning to avoid build failure @@ -10,10 +11,10 @@ for now, make it as warning to avoid build failure 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac -index fe4d39f..5d1b6e2 100644 +index 62ff78c..966bf41 100644 --- a/configure.ac +++ b/configure.ac -@@ -2528,6 +2528,14 @@ case $GCC in +@@ -2632,6 +2632,14 @@ case $GCC in yes) CFLAGS_NODIST="$CFLAGS_NODIST -std=c11" diff --git a/mingw-w64-python/0080-posixmodule-undefine-HAVE_OPENDIR.patch b/mingw-w64-python/0080-posixmodule-undefine-HAVE_OPENDIR.patch deleted file mode 100644 index d1983c94745d1..0000000000000 --- a/mingw-w64-python/0080-posixmodule-undefine-HAVE_OPENDIR.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0732ca86b6fc2de88743f8d80c310f38a8c11347 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 20 Jun 2023 18:32:58 +0530 -Subject: [PATCH 080/N] posixmodule: undefine `HAVE_OPENDIR` - -opendir is detected by configure on mingw-w64, and for some reason -things don't work as expected. For example, os.listdir always returns -the cwd's directory listing instead of the one specified. By -un-defining, this, os.listdir will use the one which uses native -windows API. ---- - Modules/posixmodule.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index b326a14..53b93d2 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -373,6 +373,12 @@ corresponding Unix manual entries for more information on calls."); - #elif defined(__MINGW32__) /* GCC for windows hosts */ - /* getlogin is detected by configure on mingw-w64 */ - # undef HAVE_GETLOGIN -+/* opendir is detected by configure on mingw-w64, and for some reason -+things don't work as expected. For example, os.listdir always returns -+the cwd's directory listing instead of the one specified. By -+un-defining, this, os.listdir will use the one which uses native -+windows API. */ -+# undef HAVE_OPENDIR - /*# define HAVE_GETCWD 1 - detected by configure*/ - # define HAVE_GETPPID 1 - # define HAVE_GETLOGIN 1 diff --git a/mingw-w64-python/0115-test_makefile-normalize-path.patch b/mingw-w64-python/0080-tests-test_makefile-normalize-path.patch similarity index 72% rename from mingw-w64-python/0115-test_makefile-normalize-path.patch rename to mingw-w64-python/0080-tests-test_makefile-normalize-path.patch index 2cbcff8fcc166..696339e9a3eef 100644 --- a/mingw-w64-python/0115-test_makefile-normalize-path.patch +++ b/mingw-w64-python/0080-tests-test_makefile-normalize-path.patch @@ -1,7 +1,7 @@ -From 613d98133c785e4ff8fcae249e51956df7da93bf Mon Sep 17 00:00:00 2001 +From 0dc019500820a9fb722933721b6a73818a0254b7 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 8 Sep 2024 15:04:42 +0530 -Subject: [PATCH 115/N] test_makefile: normalize path +Subject: [PATCH 080/N] tests: test_makefile: normalize path so that it passes on mingw --- @@ -9,20 +9,21 @@ so that it passes on mingw 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_tools/test_makefile.py b/Lib/test/test_tools/test_makefile.py -index f1f0cd8..596e50d 100644 +index 4c7588d..4d54e6e 100644 --- a/Lib/test/test_tools/test_makefile.py +++ b/Lib/test/test_tools/test_makefile.py -@@ -33,11 +33,12 @@ class TestMakefile(unittest.TestCase): +@@ -33,12 +33,13 @@ class TestMakefile(unittest.TestCase): if '\t' not in line: break result.append(line.replace('\\', '').strip()) + result = [os.path.normpath(d) for d in result if d] return result + @unittest.skipUnless(support.TEST_MODULES_ENABLED, "requires test modules") def test_makefile_test_folders(self): test_dirs = self.list_test_dirs() - idle_test = 'idlelib/idle_test' + idle_test = os.path.join('idlelib', 'idle_test') self.assertIn(idle_test, test_dirs) - used = [idle_test] + used = set([idle_test]) diff --git a/mingw-w64-python/0081-Fix-include-naming-for-cross-build.patch b/mingw-w64-python/0081-Fix-include-naming-for-cross-build.patch new file mode 100644 index 0000000000000..8c17dc409e995 --- /dev/null +++ b/mingw-w64-python/0081-Fix-include-naming-for-cross-build.patch @@ -0,0 +1,69 @@ +From b63dbb5f6c06bebfb03e351262cc96f478ebc967 Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Sat, 2 Nov 2024 11:30:54 +0530 +Subject: [PATCH 081/N] Fix include naming for cross build + +The casing and pathseps have to match, so a cross compiler +on Linux find the files. +--- + Modules/posixmodule.c | 2 +- + Modules/socketmodule.c | 2 +- + PC/_testconsole.c | 2 +- + PC/_wmimodule.cpp | 4 ++-- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index b1e23c2..dcc1f4c 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -9345,7 +9345,7 @@ os_setpgrp_impl(PyObject *module) + + #ifdef MS_WINDOWS + #include +-#include ++#include + + // The structure definition in winternl.h may be incomplete. + // This structure is the full version from the MSDN documentation. +diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c +index 687594a..bf43175 100644 +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -279,7 +279,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\ + # endif + + /* Helpers needed for AF_HYPERV */ +-# include ++# include + + /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */ + #ifdef _MSC_VER +diff --git a/PC/_testconsole.c b/PC/_testconsole.c +index 0dcea86..c38378a 100644 +--- a/PC/_testconsole.c ++++ b/PC/_testconsole.c +@@ -140,7 +140,7 @@ _testconsole_read_output_impl(PyObject *module, PyObject *file) + } + + +-#include "clinic\_testconsole.c.h" ++#include "clinic/_testconsole.c.h" + + PyMethodDef testconsole_methods[] = { + _TESTCONSOLE_WRITE_INPUT_METHODDEF +diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp +index 58cb9a8..9296d33 100644 +--- a/PC/_wmimodule.cpp ++++ b/PC/_wmimodule.cpp +@@ -14,9 +14,9 @@ + #endif + + #define _WIN32_DCOM +-#include ++#include + #include +-#include ++#include + #include + + #include diff --git a/mingw-w64-python/0082-Fix-format-warning.patch b/mingw-w64-python/0082-Fix-format-warning.patch new file mode 100644 index 0000000000000..0b073d8bff56f --- /dev/null +++ b/mingw-w64-python/0082-Fix-format-warning.patch @@ -0,0 +1,22 @@ +From 38c84773a5e71ea245b5261de7f3b51928650013 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Thu, 28 Aug 2025 22:51:52 +0300 +Subject: [PATCH 082/N] Fix format warning + +--- + Modules/_ctypes/_ctypes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c +index bb1846b..f229d73 100644 +--- a/Modules/_ctypes/_ctypes.c ++++ b/Modules/_ctypes/_ctypes.c +@@ -5018,7 +5018,7 @@ PyCArrayType_from_ctype(ctypes_state *st, PyObject *itemtype, Py_ssize_t length) + return NULL; + } + #ifdef MS_WIN64 +- sprintf(name, "%.200s_Array_%Id", ++ sprintf(name, "%.200s_Array_%lld", + ((PyTypeObject *)itemtype)->tp_name, length); + #else + sprintf(name, "%.200s_Array_%ld", diff --git a/mingw-w64-python/0083-Fix-pragma-warnings.patch b/mingw-w64-python/0083-Fix-pragma-warnings.patch new file mode 100644 index 0000000000000..7b9468c20e7af --- /dev/null +++ b/mingw-w64-python/0083-Fix-pragma-warnings.patch @@ -0,0 +1,58 @@ +From 49e142ce98f7a92fc2629442d27caf6369b4a36c Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Mon, 1 Sep 2025 13:23:23 +0300 +Subject: [PATCH 083/N] Fix pragma warnings + +--- + Modules/_winapi.c | 4 ++++ + Python/sysmodule.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/Modules/_winapi.c b/Modules/_winapi.c +index 8d29c46..edcaae7 100644 +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c +@@ -1713,14 +1713,18 @@ _winapi_GetVersion_impl(PyObject *module) + /* Disable deprecation warnings about GetVersionEx as the result is + being passed straight through to the caller, who is responsible for + using it correctly. */ ++#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable:4996) ++#endif + + { + return GetVersion(); + } + ++#ifdef _MSC_VER + #pragma warning(pop) ++#endif + + /*[clinic input] + _winapi.MapViewOfFile -> LPVOID +diff --git a/Python/sysmodule.c b/Python/sysmodule.c +index 5b62b52..b3d6e58 100644 +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -1745,8 +1745,10 @@ _sys_getwindowsversion_from_kernel32(void) + /* Disable deprecation warnings about GetVersionEx as the result is + being passed straight through to the caller, who is responsible for + using it correctly. */ ++#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable:4996) ++#endif + + /*[clinic input] + sys.getwindowsversion +@@ -1840,7 +1842,9 @@ error: + return NULL; + } + ++#ifdef _MSC_VER + #pragma warning(pop) ++#endif + + /*[clinic input] + sys._enablelegacywindowsfsencoding diff --git a/mingw-w64-python/0083-_ssl-link-with-ws2_32.patch b/mingw-w64-python/0083-_ssl-link-with-ws2_32.patch deleted file mode 100644 index 2e55aee9f315e..0000000000000 --- a/mingw-w64-python/0083-_ssl-link-with-ws2_32.patch +++ /dev/null @@ -1,22 +0,0 @@ -From a94b38e4741f0db36c1a7fb6254b0187947f2993 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 20 Jun 2023 20:35:27 +0530 -Subject: [PATCH 083/N] `_ssl`: link with `ws2_32` - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index c1188de..e05eb8f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -8013,7 +8013,7 @@ PY_STDLIB_MOD([_lzma], [], [test "$have_liblzma" = yes], - - dnl OpenSSL bindings - PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_working_openssl_ssl" = yes], -- [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS]) -+ [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS -lws2_32]) - PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes], - [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS]) - diff --git a/mingw-w64-python/0084-Always-normalize-path-in-abspath.patch b/mingw-w64-python/0084-Always-normalize-path-in-abspath.patch deleted file mode 100644 index c1465ec542de2..0000000000000 --- a/mingw-w64-python/0084-Always-normalize-path-in-abspath.patch +++ /dev/null @@ -1,22 +0,0 @@ -From a0da3ca2051c657b058f913a613c5f55efcabaef Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 20 Jun 2023 23:00:43 +0530 -Subject: [PATCH 084/N] Always normalize path in abspath - ---- - Lib/ntpath.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Lib/ntpath.py b/Lib/ntpath.py -index 1323ac2..15830f9 100644 ---- a/Lib/ntpath.py -+++ b/Lib/ntpath.py -@@ -594,7 +594,7 @@ else: # use native Windows method on Windows - def abspath(path): - """Return the absolute version of a path.""" - try: -- return _getfullpathname(normpath(path)) -+ return normpath(_getfullpathname(normpath(path))) - except (OSError, ValueError): - # See gh-75230, handle outside for cleaner traceback - pass diff --git a/mingw-w64-python/0084-math-pyhash-MINGW-support.patch b/mingw-w64-python/0084-math-pyhash-MINGW-support.patch new file mode 100644 index 0000000000000..a2b0bf5d0fbc4 --- /dev/null +++ b/mingw-w64-python/0084-math-pyhash-MINGW-support.patch @@ -0,0 +1,45 @@ +From fae0dd31a9ed86d398a349adcab75333fb7761c9 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Mon, 1 Sep 2025 13:26:35 +0300 +Subject: [PATCH 084/N] math, pyhash: MINGW support + +--- + Modules/mathmodule.c | 4 ++-- + Python/pyhash.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c +index aee1b17..08783f3 100644 +--- a/Modules/mathmodule.c ++++ b/Modules/mathmodule.c +@@ -2166,7 +2166,7 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i) + } else { + errno = 0; + r = ldexp(x, (int)exp); +-#ifdef _MSC_VER ++#ifdef _WIN32 + if (DBL_MIN > r && r > -DBL_MIN) { + /* Denormal (or zero) results can be incorrectly rounded here (rather, + truncated). Fixed in newer versions of the C runtime, included +@@ -2404,7 +2404,7 @@ math_fmod_impl(PyObject *module, double x, double y) + return PyFloat_FromDouble(x); + errno = 0; + r = fmod(x, y); +-#ifdef _MSC_VER ++#ifdef _WIN32 + /* Windows (e.g. Windows 10 with MSC v.1916) loose sign + for zero result. But C99+ says: "if y is nonzero, the result + has the same sign as x". +diff --git a/Python/pyhash.c b/Python/pyhash.c +index 5263622..ccf5258 100644 +--- a/Python/pyhash.c ++++ b/Python/pyhash.c +@@ -215,7 +215,7 @@ PyHash_GetFuncDef(void) + } + + /* Optimized memcpy() for Windows */ +-#ifdef _MSC_VER ++#ifdef _WIN32 + # if SIZEOF_PY_UHASH_T == 4 + # define PY_UHASH_CPY(dst, src) do { \ + dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \ diff --git a/mingw-w64-python/0085-Include-winsock.h-when-checking-for-netdb-function.patch b/mingw-w64-python/0085-Include-winsock.h-when-checking-for-netdb-function.patch deleted file mode 100644 index 4a986535484b2..0000000000000 --- a/mingw-w64-python/0085-Include-winsock.h-when-checking-for-netdb-function.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ec73278098a041a371462e3b33b0353a23e9e5ff Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Wed, 21 Jun 2023 15:42:39 +0530 -Subject: [PATCH 085/N] Include `winsock.h` when checking for netdb function - -also move `gethostname` to that check ---- - configure.ac | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e05eb8f..5a59971 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5205,7 +5205,7 @@ AC_CHECK_FUNCS([ \ - faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \ - fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \ - gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \ -- getgrnam_r getgrouplist getgroups gethostname getitimer getloadavg getlogin \ -+ getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \ - getpeername getpgid getpid getppid getpriority _getpty \ - getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \ - getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \ -@@ -5432,7 +5432,13 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [ - ]) - - dnl PY_CHECK_NETDB_FUNC(FUNCTION) --AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [@%:@include ])]) -+AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [ -+#ifdef _WIN32 -+ #include -+#else -+ #include -+#endif -+])]) - - PY_CHECK_NETDB_FUNC([hstrerror]) - dnl not available in WASI yet -@@ -5441,6 +5447,7 @@ PY_CHECK_NETDB_FUNC([getservbyport]) - PY_CHECK_NETDB_FUNC([gethostbyname]) - PY_CHECK_NETDB_FUNC([gethostbyaddr]) - PY_CHECK_NETDB_FUNC([getprotobyname]) -+PY_CHECK_NETDB_FUNC([gethostname]) - - dnl PY_CHECK_SOCKET_FUNC(FUNCTION) - AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [ diff --git a/mingw-w64-python/0085-tests-Fix-test-for-library-name.patch b/mingw-w64-python/0085-tests-Fix-test-for-library-name.patch new file mode 100644 index 0000000000000..cb71f6a0d0390 --- /dev/null +++ b/mingw-w64-python/0085-tests-Fix-test-for-library-name.patch @@ -0,0 +1,30 @@ +From bcc2f8580a9d1c95a91878d1e1a011ca484a3972 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Tue, 2 Sep 2025 16:07:14 +0300 +Subject: [PATCH 085/N] tests: Fix test for library name + +--- + Lib/test/test_sysconfig.py | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py +index 691b84f..ddc138c 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -466,9 +466,13 @@ class TestSysConfig(unittest.TestCase): + ldlibrary = sysconfig.get_config_var('LDLIBRARY') + major, minor = sys.version_info[:2] + if sys.platform == 'win32': +- self.assertTrue(library.startswith(f'python{major}{minor}')) +- self.assertTrue(library.endswith('.dll')) +- self.assertEqual(library, ldlibrary) ++ if sys._is_mingw: ++ self.assertTrue(library.startswith(f'libpython{major}.{minor}')) ++ self.assertTrue(ldlibrary.endswith('.dll.a')) ++ else: ++ self.assertTrue(library.startswith(f'python{major}{minor}')) ++ self.assertTrue(library.endswith('.dll')) ++ self.assertEqual(library, ldlibrary) + elif is_apple_mobile: + framework = sysconfig.get_config_var('PYTHONFRAMEWORK') + self.assertEqual(ldlibrary, f"{framework}.framework/{framework}") diff --git a/mingw-w64-python/0086-dictobject-MINGW-support.patch b/mingw-w64-python/0086-dictobject-MINGW-support.patch new file mode 100644 index 0000000000000..991396e2b3d47 --- /dev/null +++ b/mingw-w64-python/0086-dictobject-MINGW-support.patch @@ -0,0 +1,22 @@ +From 57af595718c45f7d3e6f33cb1af5c51d1f888e32 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Wed, 3 Sep 2025 00:03:20 +0300 +Subject: [PATCH 086/N] dictobject: MINGW support + +--- + Objects/dictobject.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Objects/dictobject.c b/Objects/dictobject.c +index c987af3..fae3526 100644 +--- a/Objects/dictobject.c ++++ b/Objects/dictobject.c +@@ -582,7 +582,7 @@ calculate_log2_keysize(Py_ssize_t minsize) + #if SIZEOF_LONG == SIZEOF_SIZE_T + minsize = Py_MAX(minsize, PyDict_MINSIZE); + return _Py_bit_length(minsize - 1); +-#elif defined(_MSC_VER) ++#elif defined(MS_WINDOWS) + // On 64bit Windows, sizeof(long) == 4. We cannot use _Py_bit_length. + minsize = Py_MAX(minsize, PyDict_MINSIZE); + unsigned long msb; diff --git a/mingw-w64-python/0087-build-Fix-export-Py_GetBuildInfo-symbol.patch b/mingw-w64-python/0087-build-Fix-export-Py_GetBuildInfo-symbol.patch new file mode 100644 index 0000000000000..3f5a856c42e41 --- /dev/null +++ b/mingw-w64-python/0087-build-Fix-export-Py_GetBuildInfo-symbol.patch @@ -0,0 +1,25 @@ +From 8a038f8aa38e3363691186a22368afd98a094caa Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Wed, 3 Sep 2025 00:03:55 +0300 +Subject: [PATCH 087/N] build: Fix export Py_GetBuildInfo symbol + +--- + Makefile.pre.in | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 409dc65..e640e25 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1730,8 +1730,9 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ + $(MODULE_OBJS) \ + $(MODOBJS) \ + $(DTRACE_OBJS) \ +- $(srcdir)/Modules/getbuildinfo.c +- $(CC) -c $(PY_CORE_CFLAGS) \ ++ $(srcdir)/Modules/getbuildinfo.c \ ++ $(PYTHON_HEADERS) ++ $(CC) -c $(PY_BUILTIN_MODULE_CFLAGS) \ + -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ + -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ + -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ diff --git a/mingw-w64-python/0088-build-Allow-profile-tests-failure.patch b/mingw-w64-python/0088-build-Allow-profile-tests-failure.patch new file mode 100644 index 0000000000000..9226f853644ab --- /dev/null +++ b/mingw-w64-python/0088-build-Allow-profile-tests-failure.patch @@ -0,0 +1,31 @@ +From 838987593def5fedc0077ab92f50f9b8c970b577 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Wed, 3 Sep 2025 08:16:32 +0300 +Subject: [PATCH 088/N] build: Allow profile tests failure + +--- + Makefile.pre.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index e640e25..14bf765 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -768,7 +768,7 @@ profile-run-stamp: + $(MAKE) profile-gen-stamp + # Next, run the profile task to generate the profile information. + @ # FIXME: can't run for a cross build +- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) ++ $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + $(LLVM_PROF_MERGER) + # Remove profile generation binary since we are done with it. + $(MAKE) clean-retain-profile +@@ -817,7 +817,7 @@ profile-bolt-stamp: $(BUILDPYTHON) + mv "$${bin}.bolt_inst" "$${bin}"; \ + done + # Run instrumented binaries to collect data. +- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) ++ $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + # Merge all the data files together. + for bin in $(BOLT_BINARIES); do \ + @MERGE_FDATA@ $${bin}.*.fdata > "$${bin}.fdata"; \ diff --git a/mingw-w64-python/0088-venv-creation-fixes.patch b/mingw-w64-python/0088-venv-creation-fixes.patch deleted file mode 100644 index f426c9efbbe24..0000000000000 --- a/mingw-w64-python/0088-venv-creation-fixes.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 6c6ab847e6acfc9924ef905fc100404914dcbf6f Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Fri, 23 Jun 2023 20:49:15 +0530 -Subject: [PATCH 088/N] venv creation fixes - ---- - Lib/venv/__init__.py | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py -index aeb522c..7266f83 100644 ---- a/Lib/venv/__init__.py -+++ b/Lib/venv/__init__.py -@@ -13,6 +13,7 @@ import sysconfig - import types - import shlex - -+from sysconfig import _POSIX_BUILD - - CORE_VENV_DEPS = ('pip',) - logger = logging.getLogger(__name__) -@@ -330,7 +331,7 @@ class EnvBuilder: - if not os.path.islink(path): - os.chmod(path, 0o755) - else: -- if self.symlinks: -+ if self.symlinks and not _POSIX_BUILD: - # For symlinking, we need a complete copy of the root directory - # If symlinks fail, you'll get unnecessary copies of files, but - # we assume that if you've opted into symlinks on Windows then -@@ -354,6 +355,12 @@ class EnvBuilder: - if os.path.lexists(src): - copier(src, os.path.join(binpath, suffix)) - -+ if _POSIX_BUILD: -+ # copy from python/pythonw so the venvlauncher magic in symlink_or_copy triggers -+ copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python3.exe')) -+ copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python%d.%d.exe' % sys.version_info[:2])) -+ copier(os.path.join(dirname, 'pythonw.exe'), os.path.join(binpath, 'python3w.exe')) -+ - if sysconfig.is_python_build(): - # copy init.tcl - for root, dirs, files in os.walk(context.python_dir): -@@ -378,6 +385,7 @@ class EnvBuilder: - env['VIRTUAL_ENV'] = context.env_dir - env.pop('PYTHONHOME', None) - env.pop('PYTHONPATH', None) -+ env.pop("MSYSTEM", None) - kwargs['cwd'] = context.env_dir - kwargs['executable'] = context.env_exec_cmd - subprocess.check_output(args, **kwargs) diff --git a/mingw-w64-python/0089-build-add-support-for-building-C-modules.patch b/mingw-w64-python/0089-build-add-support-for-building-C-modules.patch new file mode 100644 index 0000000000000..b20bf7dcebf38 --- /dev/null +++ b/mingw-w64-python/0089-build-add-support-for-building-C-modules.patch @@ -0,0 +1,85 @@ +From a4930ab5b583058ba4466fa30352830488241ea4 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Wed, 3 Sep 2025 12:25:03 +0300 +Subject: [PATCH 089/N] build: add support for building C++ modules. + +for example the wmi module +--- + Makefile.pre.in | 5 ++++- + Modules/makesetup | 18 +++++++++--------- + 2 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 14bf765..5fa7138 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -104,6 +104,7 @@ CONFIGURE_LDFLAGS= @LDFLAGS@ + # values. + PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) + PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal -I$(srcdir)/Include/internal/mimalloc ++PY_CXXFLAGS_NODIST=$(filter-out -std=c11,$(PY_CFLAGS_NODIST)) -std=c++20 + # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to + # be able to build extension modules using the directories specified in the + # environment variables +@@ -121,7 +122,9 @@ ARFLAGS= @ARFLAGS@ + CFLAGSFORSHARED=@CFLAGSFORSHARED@ + # C flags used for building the interpreter object files + PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) ++PY_STDMODULE_CXXFLAGS= $(PY_CFLAGS) $(PY_CXXFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) + PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN ++PY_BUILTIN_MODULE_CXXFLAGS= $(PY_STDMODULE_CXXFLAGS) -DPy_BUILD_CORE_BUILTIN + PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE + # Linker flags used for building the interpreter object files + PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) +@@ -178,7 +181,7 @@ EXT_SUFFIX= @EXT_SUFFIX@ + PYD_PLATFORM_TAG = @PYD_PLATFORM_TAG@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) + BLDSHARED= @BLDSHARED@ $(PY_CORE_LDFLAGS) +-LDCXXSHARED= @LDCXXSHARED@ $(PY_LDFLAGS) ++LDCXXSHARED= @LDCXXSHARED@ $(PY_CORE_LDFLAGS) + DESTSHARED= $(BINLIBDEST)/lib-dynload + + # List of exported symbols for AIX +diff --git a/Modules/makesetup b/Modules/makesetup +index 8bb971b..544d1d2 100755 +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -228,13 +228,13 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + for src in $srcs + do + case $src in +- *.c) obj=`basename $src .c`.o; cc='$(CC)';; +- *.cc) obj=`basename $src .cc`.o; cc='$(CXX)';; +- *.c++) obj=`basename $src .c++`.o; cc='$(CXX)';; +- *.C) obj=`basename $src .C`.o; cc='$(CXX)';; +- *.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)';; +- *.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)';; +- *.m) obj=`basename $src .m`.o; cc='$(CC)';; # Obj-C ++ *.c) obj=`basename $src .c`.o; cc='$(CC)'; ccld='$(BLDSHARED)'; ccflags='$(PY_STDMODULE_CFLAGS)';; ++ *.cc) obj=`basename $src .cc`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';; ++ *.c++) obj=`basename $src .c++`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';; ++ *.C) obj=`basename $src .C`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';; ++ *.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';; ++ *.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';; ++ *.m) obj=`basename $src .m`.o; cc='$(CC)'; ccld='$(BLDSHARED)'; ccflags='$(PY_STDMODULE_CFLAGS)';; # Obj-C + *) continue;; + esac + case $src in +@@ -251,7 +251,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + # custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec + case $doconfig in + no) +- cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)" ++ cc="$cc $cpps $ccflags \$(CCSHARED)" + rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_SHARED) \$(PYTHON_HEADERS); $cc -c $src -o $obj" + ;; + *) +@@ -274,7 +274,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + ;; + esac + rule="$file: $objs" +- rule="$rule; \$(BLDSHARED) $objs $libs \$(LIBPYTHON) -o $file" ++ rule="$rule; $ccld $objs $libs \$(LIBPYTHON) -o $file" + echo "$rule" >>$rulesf + done + done diff --git a/mingw-w64-python/0089-move-the-shutdown-function-where-winsock.h-is-includ.patch b/mingw-w64-python/0089-move-the-shutdown-function-where-winsock.h-is-includ.patch deleted file mode 100644 index 9ac9b9c96a3b0..0000000000000 --- a/mingw-w64-python/0089-move-the-shutdown-function-where-winsock.h-is-includ.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cd38b416953e377919f2e9395e04779785a90825 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Fri, 23 Jun 2023 23:34:01 +0530 -Subject: [PATCH 089/N] move the `shutdown` function where `winsock.h` is - included - ---- - configure.ac | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index f1947af..305a401 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5218,7 +5218,7 @@ AC_CHECK_FUNCS([ \ - sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \ - sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \ - setitimer setlocale setpgid setpgrp setpriority setregid setresgid \ -- setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \ -+ setresuid setreuid setsid setuid setvbuf sigaction sigaltstack \ - sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \ - sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \ - sysconf system tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \ -@@ -5448,6 +5448,7 @@ PY_CHECK_NETDB_FUNC([gethostbyname]) - PY_CHECK_NETDB_FUNC([gethostbyaddr]) - PY_CHECK_NETDB_FUNC([getprotobyname]) - PY_CHECK_NETDB_FUNC([gethostname]) -+PY_CHECK_NETDB_FUNC([shutdown]) - - dnl PY_CHECK_SOCKET_FUNC(FUNCTION) - AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [ diff --git a/mingw-w64-python/0090-build-build-fix-the-wmi-module.patch b/mingw-w64-python/0090-build-build-fix-the-wmi-module.patch new file mode 100644 index 0000000000000..fd3c09d777322 --- /dev/null +++ b/mingw-w64-python/0090-build-build-fix-the-wmi-module.patch @@ -0,0 +1,71 @@ +From dca0cf6b634ce9831f40b651f7c89f99f01436b7 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Wed, 3 Sep 2025 12:25:03 +0300 +Subject: [PATCH 090/N] build: build/fix the wmi module + +--- + Modules/Setup.stdlib.in | 1 + + PC/_wmimodule.cpp | 8 ++++++-- + configure.ac | 2 ++ + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in +index cd7c2e9..9c84aa0 100644 +--- a/Modules/Setup.stdlib.in ++++ b/Modules/Setup.stdlib.in +@@ -159,6 +159,7 @@ + # Windows specific modules + + @MODULE__OVERLAPPED_TRUE@_overlapped overlapped.c ++@MODULE__WMI_TRUE@_wmi ../PC/_wmimodule.cpp + @MODULE_WINSOUND_TRUE@winsound ../PC/winsound.c + + +diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp +index 9296d33..6cf9856 100644 +--- a/PC/_wmimodule.cpp ++++ b/PC/_wmimodule.cpp +@@ -100,10 +100,12 @@ _query_thread(LPVOID param) + hr = HRESULT_FROM_WIN32(GetLastError()); + } + if (SUCCEEDED(hr)) { ++ BSTR bstr_wql = SysAllocString(L"ROOT\\CIMV2"); + hr = locator->ConnectServer( +- bstr_t(L"ROOT\\CIMV2"), ++ bstr_wql, + NULL, NULL, 0, NULL, 0, 0, &services + ); ++ SysFreeString(bstr_wql); + } + if (SUCCEEDED(hr) && !SetEvent(data.connectEvent)) { + hr = HRESULT_FROM_WIN32(GetLastError()); +@@ -116,13 +118,15 @@ _query_thread(LPVOID param) + ); + } + if (SUCCEEDED(hr)) { ++ BSTR bstr_wql = SysAllocString(L"WQL"); + hr = services->ExecQuery( +- bstr_t("WQL"), ++ bstr_wql, + bstrQuery, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + NULL, + &enumerator + ); ++ SysFreeString(bstr_wql); + } + + // Okay, after all that, at this stage we should have an enumerator +diff --git a/configure.ac b/configure.ac +index 966bf41..d745364 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -8381,6 +8381,8 @@ dnl windows specific modules + PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"]) + PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"]) + PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"]) ++PY_STDLIB_MOD([_wmi], [test "$MACHDEP" = "win32"], [], [], ++ [-lwbemuuid -lpropsys -lole32 -loleaut32 -luuid]) + PY_STDLIB_MOD([winsound], [test "$MACHDEP" = "win32"], [], [], + [-lwinmm]) + PY_STDLIB_MOD([_overlapped], [test "$MACHDEP" = "win32"], [], [], diff --git a/mingw-w64-python/0091-Fix-exports-for-_suggestions-module.patch b/mingw-w64-python/0091-Fix-exports-for-_suggestions-module.patch new file mode 100644 index 0000000000000..cd16f06a023d1 --- /dev/null +++ b/mingw-w64-python/0091-Fix-exports-for-_suggestions-module.patch @@ -0,0 +1,21 @@ +From 7198a324be718e74752c58291a0610362b7a71fa Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 5 Sep 2025 15:14:29 +0300 +Subject: [PATCH 091/N] Fix exports for _suggestions module + +--- + Modules/_suggestions.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Modules/_suggestions.c b/Modules/_suggestions.c +index b8bc6db..d47294d 100644 +--- a/Modules/_suggestions.c ++++ b/Modules/_suggestions.c +@@ -1,3 +1,7 @@ ++#ifndef Py_BUILD_CORE_BUILTIN ++# define Py_BUILD_CORE_MODULE 1 ++#endif ++ + #include "Python.h" + #include "pycore_pyerrors.h" + #include "clinic/_suggestions.c.h" diff --git a/mingw-w64-python/0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch b/mingw-w64-python/0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch deleted file mode 100644 index 2c1b383b88369..0000000000000 --- a/mingw-w64-python/0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch +++ /dev/null @@ -1,53 +0,0 @@ -From bd0bf6c544738a7fca9bd8add55e84dfc51d52d4 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 25 Jun 2023 17:20:52 +0530 -Subject: [PATCH 092/N] Don't convert `sysconfig.get_config_var('VPATH')` to - an absolute path - -this is required for venv to work properly ---- - Makefile.pre.in | 1 - - configure.ac | 10 +--------- - 2 files changed, 1 insertion(+), 10 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 595792f..1b48cd2 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -146,7 +146,6 @@ datarootdir= @datarootdir@ - - # Locations needed for semi-native fixup of sysconfig. - srcdir_b2h= @srcdir_b2h@ --VPATH_b2h= @VPATH_b2h@ - abs_srcdir_b2h= @abs_srcdir_b2h@ - abs_builddir_b2h= @abs_builddir_b2h@ - prefix_b2h= @prefix_b2h@ -diff --git a/configure.ac b/configure.ac -index 172c673..9671d72 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -763,12 +763,8 @@ fi - # without setting up the same env and also that the build of Python - # itself will fail as the paths are not correct for the host tools. - # --# Also, getpath.c uses GetModuleFileNameW (replacing \ with /) and --# compares that with the define VPATH (passed in via command-line) --# to determine whether it's the build- or the installed-Python. --# - # To work around these issues a set of _b2h variables are created: --# VPATH_b2h, prefix_b2h, srcdir_b2h, abs_srcdir_b2h -+# prefix_b2h, srcdir_b2h, abs_srcdir_b2h - # and abs_builddir_b2h - # .. where b2h stands for build to host. sysconfig.py replaces path - # prefixes matching the non-b2h versions with the b2h equivalents. -@@ -795,10 +791,6 @@ AC_DEFUN([ABS_PATH_HOST], - AC_SUBST([$1]) - ]) - --AC_MSG_CHECKING(absolute host location of VPATH) --ABS_PATH_HOST([VPATH_b2h],[srcdir]) --AC_MSG_RESULT([$VPATH_b2h]) -- - AC_MSG_CHECKING(absolute host location of prefix) - ABS_PATH_HOST([prefix_b2h],[prefix]) - AC_MSG_RESULT([$prefix_b2h]) diff --git a/mingw-w64-python/0092-compileall-Normalize-paths.patch b/mingw-w64-python/0092-compileall-Normalize-paths.patch new file mode 100644 index 0000000000000..cf926a1399720 --- /dev/null +++ b/mingw-w64-python/0092-compileall-Normalize-paths.patch @@ -0,0 +1,24 @@ +From a827697e51f3c75913b4ed5653275689a0efd2c3 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 5 Sep 2025 16:15:09 +0300 +Subject: [PATCH 092/N] compileall: Normalize paths + +--- + Lib/compileall.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Lib/compileall.py b/Lib/compileall.py +index 47e2446..e5836f0 100644 +--- a/Lib/compileall.py ++++ b/Lib/compileall.py +@@ -161,8 +161,8 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, + "in combination with stripdir or prependdir")) + + success = True +- fullname = os.fspath(fullname) +- stripdir = os.fspath(stripdir) if stripdir is not None else None ++ fullname = os.path.normpath(os.fspath(fullname)) ++ stripdir = os.path.normpath(os.fspath(stripdir)) if stripdir is not None else None + name = os.path.basename(fullname) + + dfile = None diff --git a/mingw-w64-python/0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch b/mingw-w64-python/0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch new file mode 100644 index 0000000000000..b24081280a9e0 --- /dev/null +++ b/mingw-w64-python/0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch @@ -0,0 +1,28 @@ +From e5cafd86cc17629ffd76b7d5a96728f248a5e069 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 5 Sep 2025 18:51:55 +0300 +Subject: [PATCH 093/N] configure: enable 64-bit time support for 32-bit + build + +--- + configure.ac | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.ac b/configure.ac +index d745364..7365011 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1002,6 +1002,13 @@ if test -z "$CFLAGS"; then + CFLAGS= + fi + ++dnl Build 32-bit mingw-w64 platform with 64-bit time support. ++case $host in ++ i686-*-mingw*) ++ CFLAGS="$CFLAGS -D__MINGW_USE_VC2005_COMPAT" ++ ;; ++esac ++ + dnl Emscripten SDK and WASI SDK default to wasm32. + dnl On Emscripten use MEMORY64 setting to build target wasm64-emscripten. + dnl for wasm64. diff --git a/mingw-w64-python/0094-configure-Work-around-broken-pc-file.patch b/mingw-w64-python/0094-configure-Work-around-broken-pc-file.patch new file mode 100644 index 0000000000000..15dad8349119d --- /dev/null +++ b/mingw-w64-python/0094-configure-Work-around-broken-pc-file.patch @@ -0,0 +1,31 @@ +From 0d600eed1f619a7a93aa887a5e1bf44ef5b9c07f Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 11 Sep 2025 18:10:59 +0200 +Subject: [PATCH 094/N] configure: Work around broken pc file + +Invalid "Libs:" value + +Also it contains "-L." which is only used at build time by +makesetup and shouldn't be exposed. + +https://github.com/python/cpython/issues/138800 +--- + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 7365011..0c8247d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -6740,6 +6740,11 @@ LIBPYTHON='' + if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin" || test "$MACHDEP" = "win32"); then + MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)" + LIBPYTHON="\$(BLDLIBRARY)" ++ LIBPYTHON="$BLDLIBRARY" ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(LDVERSION)/$LDVERSION/g") ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(VERSION)/$VERSION/g") ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(ABIFLAGS)/$ABIFLAGS/g") ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/-L\. //g") + fi + + # On iOS the shared libraries must be linked with the Python framework diff --git a/mingw-w64-python/0095-getpath.py-fix-dirname.patch b/mingw-w64-python/0095-getpath.py-fix-dirname.patch deleted file mode 100644 index 9815b583a8611..0000000000000 --- a/mingw-w64-python/0095-getpath.py-fix-dirname.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 16a48fca4ea52fcef0e8eda8ab3c0e27428e8176 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sun, 25 Jun 2023 19:39:30 +0530 -Subject: [PATCH 095/N] getpath.py: fix `dirname` - -also, fix finding prefix when in a venv ---- - Modules/getpath.c | 12 ++++++++++++ - Modules/getpath.py | 3 +++ - 2 files changed, 15 insertions(+) - -diff --git a/Modules/getpath.c b/Modules/getpath.c -index de7efb6..099cffc 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -89,6 +89,12 @@ getpath_basename(PyObject *Py_UNUSED(self), PyObject *args) - } - Py_ssize_t end = PyUnicode_GET_LENGTH(path); - Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1); -+#ifdef ALTSEP -+ if (pos < 0) { -+ // try using altsep -+ pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1); -+ } -+#endif - if (pos < 0) { - return Py_NewRef(path); - } -@@ -105,6 +111,12 @@ getpath_dirname(PyObject *Py_UNUSED(self), PyObject *args) - } - Py_ssize_t end = PyUnicode_GET_LENGTH(path); - Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1); -+#ifdef ALTSEP -+ if (pos < 0) { -+ // try using altsep -+ pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1); -+ } -+#endif - if (pos < 0) { - return PyUnicode_FromStringAndSize(NULL, 0); - } -diff --git a/Modules/getpath.py b/Modules/getpath.py -index 6867e98..5687e4f 100644 ---- a/Modules/getpath.py -+++ b/Modules/getpath.py -@@ -574,6 +574,9 @@ else: - # First try to detect prefix by looking alongside our runtime library, if known - if library and not prefix: - library_dir = dirname(library) -+ if os_name == 'nt' and is_mingw: -+ # QUIRK: On Windows, mingw Python DLLs are in the bin directory -+ library_dir = joinpath(library_dir, '..') - if ZIP_LANDMARK: - if os_name == 'nt': - # QUIRK: Windows does not search up for ZIP file diff --git a/mingw-w64-python/0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch b/mingw-w64-python/0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch new file mode 100644 index 0000000000000..61ea7ed30c509 --- /dev/null +++ b/mingw-w64-python/0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch @@ -0,0 +1,24 @@ +From e719663e07d6655e042f9c48910c65606cc4ae5e Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Mon, 5 Jan 2026 20:28:08 +0100 +Subject: [PATCH 095/N] makesetup: make sure a library path is passed when + building modules + +This is fallout from LIBPYTHON not inluding -L. anymore +--- + Modules/makesetup | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/makesetup b/Modules/makesetup +index 544d1d2..c93beb7 100755 +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -274,7 +274,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + ;; + esac + rule="$file: $objs" +- rule="$rule; $ccld $objs $libs \$(LIBPYTHON) -o $file" ++ rule="$rule; $ccld $objs $libs \$(BLDLIBRARY) -o $file" + echo "$rule" >>$rulesf + done + done diff --git a/mingw-w64-python/0096-getpath-use-normpath-on-all-generated-paths.patch b/mingw-w64-python/0096-getpath-use-normpath-on-all-generated-paths.patch deleted file mode 100644 index b177155f6af06..0000000000000 --- a/mingw-w64-python/0096-getpath-use-normpath-on-all-generated-paths.patch +++ /dev/null @@ -1,154 +0,0 @@ -From f8523063e6d99d4d8a623825e86e3d62e47a9271 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Fri, 28 Jul 2023 20:13:58 +0200 -Subject: [PATCH 096/N] getpath: use normpath on all generated paths - -Instead of just calling normpath in abspath just call normpath -on all the config results. This makes sure we don't change getpath.py -too much and still cover all outputs. - -This fixes sys.exec_prefix not matching sys.prefix, see -https://github.com/msys2-contrib/cpython-mingw/issues/142 ---- - Lib/test/test_getpath.py | 6 ++++++ - Modules/getpath.c | 21 ++++++++++++++++++++- - Modules/getpath.py | 30 ++++++++++++++++-------------- - 3 files changed, 42 insertions(+), 15 deletions(-) - -diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py -index 4dc2d30..f63e420 100644 ---- a/Lib/test/test_getpath.py -+++ b/Lib/test/test_getpath.py -@@ -913,6 +913,9 @@ class MockNTNamespace(dict): - except AttributeError: - raise KeyError(key) from None - -+ def normpath(self, path): -+ return ntpath.normpath(path) -+ - def abspath(self, path): - if self.isabs(path): - return path -@@ -1091,6 +1094,9 @@ class MockPosixNamespace(dict): - except AttributeError: - raise KeyError(key) from None - -+ def normpath(self, path): -+ return path -+ - def abspath(self, path): - if self.isabs(path): - return path -diff --git a/Modules/getpath.c b/Modules/getpath.c -index 099cffc..47b89eb 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -54,6 +54,25 @@ - - /* HELPER FUNCTIONS for getpath.py */ - -+static PyObject * -+getpath_normpath(PyObject *Py_UNUSED(self), PyObject *args) -+{ -+ PyObject *r = NULL; -+ PyObject *pathobj; -+ wchar_t *path; -+ if (!PyArg_ParseTuple(args, "U", &pathobj)) { -+ return NULL; -+ } -+ Py_ssize_t len; -+ wchar_t *buffer = PyUnicode_AsWideCharString(pathobj, &len); -+ if (!buffer) { -+ return NULL; -+ } -+ r = PyUnicode_FromWideChar(_Py_normpath(buffer, len), -1); -+ PyMem_Free(buffer); -+ return r; -+} -+ - static PyObject * - getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args) - { -@@ -68,7 +87,6 @@ getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args) - if (path) { - wchar_t *abs; - if (_Py_abspath((const wchar_t *)_Py_normpath(path, -1), &abs) == 0 && abs) { -- abs = _Py_normpath(abs, -1); - r = PyUnicode_FromWideChar(abs, -1); - PyMem_RawFree((void *)abs); - } else { -@@ -523,6 +541,7 @@ done: - - - static PyMethodDef getpath_methods[] = { -+ {"normpath", getpath_normpath, METH_VARARGS, NULL}, - {"abspath", getpath_abspath, METH_VARARGS, NULL}, - {"basename", getpath_basename, METH_VARARGS, NULL}, - {"dirname", getpath_dirname, METH_VARARGS, NULL}, -diff --git a/Modules/getpath.py b/Modules/getpath.py -index 5687e4f..d143f97 100644 ---- a/Modules/getpath.py -+++ b/Modules/getpath.py -@@ -233,6 +233,8 @@ def search_up(prefix, *landmarks, test=isfile): - return prefix - prefix = dirname(prefix) - -+def _normpath(p): -+ return normpath(p) if p is not None else None - - # ****************************************************************************** - # READ VARIABLES FROM config -@@ -670,7 +672,7 @@ else: - - if py_setpath: - # If Py_SetPath was called then it overrides any existing search path -- config['module_search_paths'] = py_setpath.split(DELIM) -+ config['module_search_paths'] = [_normpath(p) for p in py_setpath.split(DELIM)] - config['module_search_paths_set'] = 1 - - elif not pythonpath_was_set: -@@ -757,7 +759,7 @@ elif not pythonpath_was_set: - if platstdlib_dir: - pythonpath.append(platstdlib_dir) - -- config['module_search_paths'] = pythonpath -+ config['module_search_paths'] = [_normpath(p) for p in pythonpath] - config['module_search_paths_set'] = 1 - - -@@ -792,23 +794,23 @@ if pth: - warn("unsupported 'import' line in ._pth file") - else: - pythonpath.append(joinpath(pth_dir, line)) -- config['module_search_paths'] = pythonpath -+ config['module_search_paths'] = [_normpath(p) for p in pythonpath] - config['module_search_paths_set'] = 1 - - # ****************************************************************************** - # UPDATE config FROM CALCULATED VALUES - # ****************************************************************************** - --config['program_name'] = program_name --config['home'] = home --config['executable'] = executable --config['base_executable'] = base_executable --config['prefix'] = prefix --config['exec_prefix'] = exec_prefix --config['base_prefix'] = base_prefix or prefix --config['base_exec_prefix'] = base_exec_prefix or exec_prefix -+config['program_name'] = _normpath(program_name) -+config['home'] = _normpath(home) -+config['executable'] = _normpath(executable) -+config['base_executable'] = _normpath(base_executable) -+config['prefix'] = _normpath(prefix) -+config['exec_prefix'] = _normpath(exec_prefix) -+config['base_prefix'] = _normpath(base_prefix or prefix) -+config['base_exec_prefix'] = _normpath(base_exec_prefix or exec_prefix) - --config['platlibdir'] = platlibdir -+config['platlibdir'] = _normpath(platlibdir) - # test_embed expects empty strings, not None --config['stdlib_dir'] = stdlib_dir or '' --config['platstdlib_dir'] = platstdlib_dir or '' -+config['stdlib_dir'] = _normpath(stdlib_dir or '') -+config['platstdlib_dir'] = _normpath(platstdlib_dir or '') diff --git a/mingw-w64-python/0096-venv-also-install-the-versioned-launchers.patch b/mingw-w64-python/0096-venv-also-install-the-versioned-launchers.patch new file mode 100644 index 0000000000000..b992e7c6e767e --- /dev/null +++ b/mingw-w64-python/0096-venv-also-install-the-versioned-launchers.patch @@ -0,0 +1,36 @@ +From e3afbc9615899bc5ec37612aa4dcd4b801108905 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 13 Sep 2025 15:27:31 +0200 +Subject: [PATCH 096/N] venv: also install the versioned launchers + +Like on Linux we provide python3.x globally, so make +sure those also exist in the venv, so when python3.x is run +the venv version is launched and not the global one. +--- + Lib/venv/__init__.py | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py +index f7a6d26..211438d 100644 +--- a/Lib/venv/__init__.py ++++ b/Lib/venv/__init__.py +@@ -376,8 +376,18 @@ class EnvBuilder: + f'pythonw{exe_t}{exe_d}.exe': pythonw_exe, + } + ++ if sys._is_mingw: ++ for key, value in list(link_sources.items()): ++ if key.startswith('python'): ++ link_sources[key.replace('python', 'python3')] = value ++ link_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value ++ for key, value in list(copy_sources.items()): ++ if key.startswith('python'): ++ copy_sources[key.replace('python', 'python3')] = value ++ copy_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value ++ + do_copies = True +- if self.symlinks: ++ if self.symlinks and not sys._is_mingw: + do_copies = False + # For symlinking, we need all the DLLs to be available alongside + # the executables. diff --git a/mingw-w64-python/0060-configure.ac-set-_WIN32_WINNT-version.patch b/mingw-w64-python/0097-configure-set-_WIN32_WINNT-version.patch similarity index 56% rename from mingw-w64-python/0060-configure.ac-set-_WIN32_WINNT-version.patch rename to mingw-w64-python/0097-configure-set-_WIN32_WINNT-version.patch index 3690a750a84da..f1abdfef6bfe5 100644 --- a/mingw-w64-python/0060-configure.ac-set-_WIN32_WINNT-version.patch +++ b/mingw-w64-python/0097-configure-set-_WIN32_WINNT-version.patch @@ -1,17 +1,17 @@ -From 9ec9f0c5a7bc9d63913414430187ae56344c954b Mon Sep 17 00:00:00 2001 +From e729588ae183e44e8cdb103bea859c357556259f Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 1 Aug 2021 15:18:50 +0200 -Subject: [PATCH 060/N] configure.ac: set _WIN32_WINNT version +Subject: [PATCH 097/N] configure: set _WIN32_WINNT version --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac -index d3b8dbf..d6e8604 100644 +index 0c8247d..7fb8704 100644 --- a/configure.ac +++ b/configure.ac -@@ -4597,6 +4597,11 @@ done +@@ -4844,6 +4844,11 @@ done IFS=$as_save_IFS AC_MSG_RESULT([$DBM_CFLAGS $DBM_LIBS]) @@ -20,6 +20,6 @@ index d3b8dbf..d6e8604 100644 + CFLAGS_NODIST="$CFLAGS_NODIST -D_WIN32_WINNT=0x0602";; +esac + - # Determine if windows modules should be used. - AC_SUBST(USE_WIN32_MODULE) - USE_WIN32_MODULE='#' + # Templates for things AC_DEFINEd more than once. + # For a single AC_DEFINE, no template is needed. + AH_TEMPLATE([_REENTRANT], diff --git a/mingw-w64-python/0097-pathconfig-normpath-sys.path-0.patch b/mingw-w64-python/0097-pathconfig-normpath-sys.path-0.patch deleted file mode 100644 index 2defe846208a3..0000000000000 --- a/mingw-w64-python/0097-pathconfig-normpath-sys.path-0.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 00d11588b95d175ecdaa641d3c90c955912c42dd Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Fri, 28 Jul 2023 20:14:38 +0200 -Subject: [PATCH 097/N] pathconfig: normpath sys.path[0] - -this gets added as first element in sys.path. -use normpath to make sure it uses the right path separator ---- - Python/pathconfig.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Python/pathconfig.c b/Python/pathconfig.c -index 8053b91..7eb9006 100644 ---- a/Python/pathconfig.c -+++ b/Python/pathconfig.c -@@ -662,7 +662,7 @@ _PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p) - } - #endif /* All others */ - -- PyObject *path0_obj = PyUnicode_FromWideChar(path0, n); -+ PyObject *path0_obj = PyUnicode_FromWideChar(_Py_normpath(path0, -1), n); - if (path0_obj == NULL) { - return -1; - } diff --git a/mingw-w64-python/0098-smoketests-add-some-tests-for-sys-site-paths.patch b/mingw-w64-python/0098-smoketests-add-some-tests-for-sys-site-paths.patch deleted file mode 100644 index 89afd5dc9b9f5..0000000000000 --- a/mingw-w64-python/0098-smoketests-add-some-tests-for-sys-site-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 99d67c56451bfad7961e7a06d8fc16a21d3f65e6 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Fri, 28 Jul 2023 20:15:01 +0200 -Subject: [PATCH 098/N] smoketests: add some tests for sys/site paths - ---- - mingw_smoketests.py | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 00601f9..516005c 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -238,6 +238,29 @@ class Tests(unittest.TestCase): - self.assertEqual(platform.system(), "Windows") - self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0) - -+ def test_sys_getpath(self): -+ # everything sourced from getpath.py -+ import sys -+ -+ def assertNormpath(path): -+ self.assertEqual(path, os.path.normpath(path)) -+ -+ assertNormpath(sys.executable) -+ assertNormpath(sys._base_executable) -+ assertNormpath(sys.prefix) -+ assertNormpath(sys.base_prefix) -+ assertNormpath(sys.exec_prefix) -+ assertNormpath(sys.base_exec_prefix) -+ assertNormpath(sys.platlibdir) -+ assertNormpath(sys._stdlib_dir) -+ for p in sys.path: -+ assertNormpath(p) -+ -+ def test_site(self): -+ import site -+ -+ self.assertEqual(len(site.getsitepackages()), 1) -+ - def test_c_ext_build(self): - import tempfile - import sys diff --git a/mingw-w64-python/0098-tests-fix-sysconfig.test_get_platform.patch b/mingw-w64-python/0098-tests-fix-sysconfig.test_get_platform.patch new file mode 100644 index 0000000000000..f3318ff0b7164 --- /dev/null +++ b/mingw-w64-python/0098-tests-fix-sysconfig.test_get_platform.patch @@ -0,0 +1,32 @@ +From 4fb15685f49def001af0fe860469a0499fd7ea51 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Mon, 29 Dec 2025 17:21:36 +0100 +Subject: [PATCH 098/N] tests: fix sysconfig.test_get_platform + +--- + Lib/test/test_sysconfig.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py +index ddc138c..fd5568c 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -251,14 +251,16 @@ class TestSysConfig(unittest.TestCase): + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Intel)]') + sys.platform = 'win32' +- self.assertEqual(get_platform(), 'win32') ++ if not sys._is_mingw: ++ self.assertEqual(get_platform(), 'win32') + + # windows XP, amd64 + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Amd64)]') + sys.platform = 'win32' +- self.assertEqual(get_platform(), 'win-amd64') ++ if not sys._is_mingw: ++ self.assertEqual(get_platform(), 'win-amd64') + + # macbook + os.name = 'posix' diff --git a/mingw-w64-python/0099-pycore_time-fix-missing-timeval.patch b/mingw-w64-python/0099-pycore_time-fix-missing-timeval.patch new file mode 100644 index 0000000000000..d7108a03f96cb --- /dev/null +++ b/mingw-w64-python/0099-pycore_time-fix-missing-timeval.patch @@ -0,0 +1,23 @@ +From 268ba6f99af748aca0660078e525bd375d36ab97 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 3 Jan 2026 10:47:49 +0100 +Subject: [PATCH 099/N] pycore_time: fix missing timeval + +https://github.com/python/cpython/issues/82863 +--- + Include/internal/pycore_time.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h +index 205ac5d..95a52d8 100644 +--- a/Include/internal/pycore_time.h ++++ b/Include/internal/pycore_time.h +@@ -58,7 +58,7 @@ extern "C" { + #endif + + +-#ifdef __clang__ ++#ifdef MS_WINDOWS + struct timeval; + #endif + diff --git a/mingw-w64-python/0100-mmapmodule-define-DONT_USE_SEH.patch b/mingw-w64-python/0100-mmapmodule-define-DONT_USE_SEH.patch new file mode 100644 index 0000000000000..20feefcd22567 --- /dev/null +++ b/mingw-w64-python/0100-mmapmodule-define-DONT_USE_SEH.patch @@ -0,0 +1,28 @@ +From e39e0ebdf470416f51c37716fbb6b3fa9a8dc435 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 3 Jan 2026 16:39:43 +0100 +Subject: [PATCH 100/N] mmapmodule: define DONT_USE_SEH + +copy the logic from callproc.c +--- + Modules/mmapmodule.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c +index 0e1a709..c6c1978 100644 +--- a/Modules/mmapmodule.c ++++ b/Modules/mmapmodule.c +@@ -62,6 +62,13 @@ my_getallocationgranularity (void) + + #endif + ++#if defined(_DEBUG) || defined(__MINGW32__) ++/* Don't use structured exception handling on Windows if this is defined. ++ MingW, AFAIK, doesn't support it. ++*/ ++#define DONT_USE_SEH ++#endif ++ + #ifdef UNIX + #include + #include diff --git a/mingw-w64-python/0101-build-Add-ABIFLAGS-to-targets-when-needed.patch b/mingw-w64-python/0101-build-Add-ABIFLAGS-to-targets-when-needed.patch new file mode 100644 index 0000000000000..63292be2a0e24 --- /dev/null +++ b/mingw-w64-python/0101-build-Add-ABIFLAGS-to-targets-when-needed.patch @@ -0,0 +1,40 @@ +From 27bd52a3c844f02573db9dcf35043ee2dec7d7a4 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlov +Date: Fri, 29 Aug 2025 11:15:33 +0300 +Subject: [PATCH 101/N] build: Add ABIFLAGS to targets when needed + +So we get different names for debug and free threaded builds +--- + Makefile.pre.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 5fa7138..0c27299 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -307,11 +307,11 @@ MACHDEP_OBJS= @MACHDEP_OBJS@ + LIBOBJDIR= Python/ + LIBOBJS= @LIBOBJS@ + +-PYTHON= python$(EXE) +-BUILDPYTHON= python$(BUILDEXE) +-BUILDPYTHONW= pythonw$(BUILDEXE) +-BUILDVENVLAUNCHER= venvlauncher$(BUILDEXE) +-BUILDVENVWLAUNCHER= venvwlauncher$(BUILDEXE) ++PYTHON= python$(ABIFLAGS)$(EXE) ++BUILDPYTHON= python$(ABIFLAGS)$(BUILDEXE) ++BUILDPYTHONW= pythonw$(ABIFLAGS)$(BUILDEXE) ++BUILDVENVLAUNCHER= venvlauncher$(ABIFLAGS)$(BUILDEXE) ++BUILDVENVWLAUNCHER= venvwlauncher$(ABIFLAGS)$(BUILDEXE) + + HOSTRUNNER= @HOSTRUNNER@ + +@@ -2254,7 +2254,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ + done + if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ + $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ +- $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \ ++ $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(ABIFLAGS)$(EXE); \ + $(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \ + $(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVLAUNCHER); \ + $(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVWLAUNCHER); \ diff --git a/mingw-w64-python/0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch b/mingw-w64-python/0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch deleted file mode 100644 index 6755ad68d892c..0000000000000 --- a/mingw-w64-python/0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch +++ /dev/null @@ -1,46 +0,0 @@ -From c7e9b9f4c5c6aa86598a2a5a845784bebdbbac11 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Wed, 8 Nov 2023 19:44:22 +0530 -Subject: [PATCH 103/N] mingw_smoketests: add a test to check if sysconfig - returns correct values for `LIBDIR` - ---- - mingw_smoketests.py | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index ca1f652..4f81c68 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -218,6 +218,9 @@ class Tests(unittest.TestCase): - import sysconfig - import platform - import importlib.machinery -+ import tempfile -+ import venv -+ import subprocess - self.assertEqual(sys.implementation.name, "cpython") - self.assertEqual(sys.platform, "win32") - self.assertTrue(sysconfig.get_platform().startswith("mingw")) -@@ -241,6 +244,21 @@ class Tests(unittest.TestCase): - self.assertEqual(platform.system(), "Windows") - self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0) - -+ with tempfile.TemporaryDirectory() as tmp: -+ builder = venv.EnvBuilder() -+ builder.create(tmp) -+ # This will not work in in-tree build -+ if not sysconfig.is_python_build(): -+ op = subprocess.check_output( -+ [ -+ os.path.join(tmp, "bin", "python.exe"), -+ "-c", -+ "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))" -+ ], -+ cwd=tmp, -+ ) -+ self.assertTrue(op.decode().strip().startswith(sys.base_prefix)) -+ - def test_sys_getpath(self): - # everything sourced from getpath.py - import sys diff --git a/mingw-w64-python/0106-readline-disable-on-MINGW.patch b/mingw-w64-python/0106-readline-disable-on-MINGW.patch deleted file mode 100644 index e44d7969fe94e..0000000000000 --- a/mingw-w64-python/0106-readline-disable-on-MINGW.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 31f7d79691b610e2043ae9dc583ffa23d86b749e Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Mon, 1 Jan 2024 14:19:41 +0530 -Subject: [PATCH 106/N] readline: disable on MINGW - ---- - configure.ac | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configure.ac b/configure.ac -index 353ff02..e15e19a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7760,6 +7760,7 @@ AS_CASE([$ac_sys_system], - [VxWorks*], [PY_STDLIB_MOD_SET_NA([_scproxy], [_crypt], [termios], [grp])], - [Darwin], [PY_STDLIB_MOD_SET_NA([ossaudiodev], [spwd])], - [CYGWIN*], [PY_STDLIB_MOD_SET_NA([_scproxy], [nis])], -+ [MINGW*], [PY_STDLIB_MOD_SET_NA([readline])], - [QNX*], [PY_STDLIB_MOD_SET_NA([_scproxy], [nis])], - [FreeBSD*], [PY_STDLIB_MOD_SET_NA([_scproxy], [spwd])], - [Emscripten|WASI], [ diff --git a/mingw-w64-python/0108-Add-lpython-version-while-linking-stdlib.patch b/mingw-w64-python/0108-Add-lpython-version-while-linking-stdlib.patch deleted file mode 100644 index 019ff9f3897ec..0000000000000 --- a/mingw-w64-python/0108-Add-lpython-version-while-linking-stdlib.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f95f4f4f0be70909eef94a07890681be00b061be Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Mon, 1 Jan 2024 14:48:28 +0530 -Subject: [PATCH 108/N] Add `-lpython` while linking stdlib - -Generalize the `MINGW` case. -In theory, it should be correct for other system too -and would fix cross-compilation ---- - Modules/makesetup | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/Modules/makesetup b/Modules/makesetup -index f000c9c..5e2ada0 100755 ---- a/Modules/makesetup -+++ b/Modules/makesetup -@@ -88,7 +88,7 @@ NL='\ - ' - - # Setup to link with extra libraries when making shared extensions. --# Currently, only Cygwin needs this baggage. -+# Currently, only Cygwin and MINGW needs this baggage. - case `uname -s` in - CYGWIN*) if test $libdir = . - then -@@ -97,6 +97,9 @@ CYGWIN*) if test $libdir = . - ExtraLibDir='$(LIBPL)' - fi - ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";; -+*) -+ ExtraLibs='$(BLDLIBRARY)' -+ ExtraLibDepends='$(LIBRARY_DEPS)';; - esac - - # Main loop -@@ -285,7 +288,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | - BUILT_SHARED="$BUILT_SHARED $mod" - ;; - esac -- rule="$file: $objs" -+ rule="$file: $objs $ExtraLibDepends" - rule="$rule; \$(BLDSHARED) $objs $libs $ExtraLibs -o $file" - echo "$rule" >>$rulesf - done diff --git a/mingw-w64-python/0110-Enable-curses-library-on-MINGW.patch b/mingw-w64-python/0110-Enable-curses-library-on-MINGW.patch deleted file mode 100644 index ff44f0f15183b..0000000000000 --- a/mingw-w64-python/0110-Enable-curses-library-on-MINGW.patch +++ /dev/null @@ -1,28 +0,0 @@ -From dceead90dec13e4bb730f28e300b891e60102793 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Mon, 1 Jan 2024 16:43:41 +0530 -Subject: [PATCH 110/N] Enable curses library on MINGW - ---- - configure.ac | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 2575149..c4dfe3b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6868,6 +6868,14 @@ dnl have_panel=[no, panelw, panel] - have_curses=no - have_panel=no - -+case "$host_os" in -+ mingw*) -+ # On Mingw, include directory is different, so just assume -+ # it's there. -+ ac_cv_header_ncurses_h=yes -+ ;; -+esac -+ - AH_TEMPLATE([HAVE_NCURSESW], [Define to 1 if you have the `ncursesw' library.]) - AC_CHECK_HEADERS([curses.h ncurses.h]) - diff --git a/mingw-w64-python/0111-mingw_smoketests-disable-distutils-related-tests.patch b/mingw-w64-python/0111-mingw_smoketests-disable-distutils-related-tests.patch deleted file mode 100644 index 4604b5bccdc94..0000000000000 --- a/mingw-w64-python/0111-mingw_smoketests-disable-distutils-related-tests.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 62ef1e650f63f53894c5acb55ab8828fff8a0c4c Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Fri, 2 Feb 2024 14:43:29 +0530 -Subject: [PATCH 111/N] mingw_smoketests: disable distutils related tests - ---- - mingw_smoketests.py | 36 ++++++++++++++++++------------------ - 1 file changed, 18 insertions(+), 18 deletions(-) - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 4f81c68..0ab5d3b 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -61,24 +61,24 @@ class Tests(unittest.TestCase): - self.assertEqual(str(Path("~").expanduser()), expanduser("~")) - self.assertEqual(str(Path.home()), expanduser("~")) - -- def test_sysconfig_schemes(self): -- # https://github.com/msys2/MINGW-packages/issues/9319 -- import sysconfig -- from distutils.dist import Distribution -- from distutils.command.install import install -- -- names = ['scripts', 'purelib', 'platlib', 'data', 'include'] -- for scheme in ["nt", "nt_user"]: -- for name in names: -- c = install(Distribution({"name": "foobar"})) -- c.user = (scheme == "nt_user") -- c.finalize_options() -- if name == "include": -- dist_path = os.path.dirname(getattr(c, "install_" + "headers")) -- else: -- dist_path = getattr(c, "install_" + name) -- sys_path = sysconfig.get_path(name, scheme) -- self.assertEqual(dist_path, sys_path, (scheme, name)) -+ # def test_sysconfig_schemes(self): -+ # # https://github.com/msys2/MINGW-packages/issues/9319 -+ # import sysconfig -+ # from distutils.dist import Distribution -+ # from distutils.command.install import install -+ -+ # names = ['scripts', 'purelib', 'platlib', 'data', 'include'] -+ # for scheme in ["nt", "nt_user"]: -+ # for name in names: -+ # c = install(Distribution({"name": "foobar"})) -+ # c.user = (scheme == "nt_user") -+ # c.finalize_options() -+ # if name == "include": -+ # dist_path = os.path.dirname(getattr(c, "install_" + "headers")) -+ # else: -+ # dist_path = getattr(c, "install_" + name) -+ # sys_path = sysconfig.get_path(name, scheme) -+ # self.assertEqual(dist_path, sys_path, (scheme, name)) - - def test_ctypes_find_library(self): - from ctypes.util import find_library diff --git a/mingw-w64-python/0112-configure.ac-use-autoconf-2.69.patch b/mingw-w64-python/0112-configure.ac-use-autoconf-2.69.patch deleted file mode 100644 index 9d57856ce78c8..0000000000000 --- a/mingw-w64-python/0112-configure.ac-use-autoconf-2.69.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 9e56012dda86ade3274903360ecf5847b3d178d4 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Mon, 19 Feb 2024 22:09:25 +0530 -Subject: [PATCH 112/N] configure.ac: use autoconf 2.69 - -llvm-mingw only has autoconf 2.69 ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index c4dfe3b..fe4d39f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -12,7 +12,7 @@ dnl - # Set VERSION so we only need to edit in one place (i.e., here) - m4_define([PYTHON_VERSION], [3.12]) - --AC_PREREQ([2.71]) -+AC_PREREQ([2.69]) - - AC_INIT([python],[PYTHON_VERSION],[https://github.com/python/cpython/issues/]) - diff --git a/mingw-w64-python/0113-CI-clean-up-ignored-tests.patch b/mingw-w64-python/0113-CI-clean-up-ignored-tests.patch deleted file mode 100644 index 6f9edf9dd353b..0000000000000 --- a/mingw-w64-python/0113-CI-clean-up-ignored-tests.patch +++ /dev/null @@ -1,87 +0,0 @@ -From b67e3c67e65e22bf2ee8cf2d2f11b720dfca012e Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Tue, 20 Feb 2024 11:04:39 +0530 -Subject: [PATCH 113/N] CI: clean up ignored tests - -Remove tests which are passing now, or no longer exist, and -move tests which only fail with msvcrt into a separate file. ---- - Lib/test/test_wmi.py | 2 +- - mingw_ignorefile.txt | 24 +++--------------------- - mingw_ignorefile_msvcrt.txt | 8 ++++++++ - 3 files changed, 12 insertions(+), 22 deletions(-) - create mode 100644 mingw_ignorefile_msvcrt.txt - -diff --git a/Lib/test/test_wmi.py b/Lib/test/test_wmi.py -index 111f990..3dc452e 100644 ---- a/Lib/test/test_wmi.py -+++ b/Lib/test/test_wmi.py -@@ -8,7 +8,7 @@ from test.support import import_helper - - - # Do this first so test will be skipped if module doesn't exist --_wmi = import_helper.import_module('_wmi', required_on=['win']) -+_wmi = import_helper.import_module('_wmi') - - - def wmi_exec_query(query): -diff --git a/mingw_ignorefile.txt b/mingw_ignorefile.txt -index e692d7f..550e724 100644 ---- a/mingw_ignorefile.txt -+++ b/mingw_ignorefile.txt -@@ -2,16 +2,11 @@ test.test_ctypes.test_loading.LoaderTest.test_load_dll_with_flags - distutils.tests.test_bdist_dumb.BuildDumbTestCase.test_simple_built - distutils.tests.test_cygwinccompiler.CygwinCCompilerTestCase.test_get_versions - distutils.tests.test_util.UtilTestCase.test_change_root --test.datetimetester.TestLocalTimeDisambiguation_Fast.* --test.datetimetester.TestLocalTimeDisambiguation_Pure.* --test.test_cmath.CMathTests.test_specific_values --test.test_cmd_line_script.CmdLineTest.test_consistent_sys_path_for_direct_execution - test.test_compileall.CommandLineTestsNoSourceEpoch.* - test.test_compileall.CommandLineTestsWithSourceEpoch.* - test.test_compileall.CompileallTestsWithoutSourceEpoch.* - test.test_compileall.CompileallTestsWithSourceEpoch.* - test.test_import.ImportTests.test_dll_dependency_import --test.test_math.MathTests.* - test.test_ntpath.NtCommonTest.test_import - test.test_os.StatAttributeTests.test_stat_block_device - test.test_os.TestScandir.test_attributes -@@ -23,21 +18,8 @@ test.test_site._pthFileTests.* - test.test_site.HelperFunctionsTests.* - test.test_site.StartupImportTests.* - test.test_ssl.* --test.test_strptime.CalculationTests.* --test.test_strptime.StrptimeTests.test_weekday --test.test_strptime.TimeRETests.test_compile --test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date - test.test_venv.BasicTest.* - test.test_venv.EnsurePipTest.* --test.test_sysconfig.TestSysConfig.test_user_similar --test.test_tcl.TclTest.testLoadWithUNC --test.test_wmi --# flaky --test.test__xxsubinterpreters.* --test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe --test.test_asynchat.TestAsynchat.test_line_terminator2 --test.test_asyncgen.AsyncGenAsyncioTest.test_async_gen_asyncio_gc_aclose_09 --test.test_concurrent_futures.ThreadPoolShutdownTest.test_interpreter_shutdown --test.test_asynchat.TestNotConnected.test_disallow_negative_terminator --test.test_logging.SysLogHandlerTest.* --test.test_logging.IPv6SysLogHandlerTest.* -+ -+test.test_dict.DictTest.test_splittable_to_generic_combinedtable -+test.test_capi.test_run.CAPITest.test_run_fileexflags -diff --git a/mingw_ignorefile_msvcrt.txt b/mingw_ignorefile_msvcrt.txt -new file mode 100644 -index 0000000..be363bd ---- /dev/null -+++ b/mingw_ignorefile_msvcrt.txt -@@ -0,0 +1,8 @@ -+test.datetimetester.TestLocalTimeDisambiguation_Fast.* -+test.datetimetester.TestLocalTimeDisambiguation_Pure.* -+test.test_cmath.CMathTests.test_specific_values -+test.test_math.MathTests.* -+test.test_strptime.CalculationTests.* -+test.test_strptime.StrptimeTests.test_weekday -+test.test_strptime.TimeRETests.test_compile -+test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date diff --git a/mingw-w64-python/0116-sysconfig.get_platform-use-consistent-naming.patch b/mingw-w64-python/0116-sysconfig.get_platform-use-consistent-naming.patch deleted file mode 100644 index b4b8201aba649..0000000000000 --- a/mingw-w64-python/0116-sysconfig.get_platform-use-consistent-naming.patch +++ /dev/null @@ -1,255 +0,0 @@ -From c4e2de6cd7e3e139cfc5016256970e876b89a1c9 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Thu, 12 Sep 2024 17:42:31 +0530 -Subject: [PATCH 116/N] `sysconfig.get_platform()`: use consistent naming - -Currently, the platform names are hardcoded in many places, -and are not named consistently. This commit fixes it by -standardizing the names to be returned by `sysconfig.get_platform`. -The naming is based on https://github.com/msys2-contrib/cpython-mingw/issues/167#issuecomment-1952215164 - -Similarly, `EXT_SUFFIX` is also standardized to be consistent with the platform names. - -Signed-off-by: Naveen M K ---- - Lib/site.py | 32 +++++++++------ - Lib/sysconfig.py | 32 +++++++++------ - Lib/test/test_importlib/test_windows.py | 38 +++++++++-------- - configure.ac | 54 ++++++++++--------------- - mingw_smoketests.py | 2 +- - 5 files changed, 83 insertions(+), 75 deletions(-) - -diff --git a/Lib/site.py b/Lib/site.py -index c1ecd6e..16c7c41 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -314,21 +314,27 @@ def _getuserbase(): - def _get_platform(): - if os.name == 'nt': - if 'gcc' in sys.version.lower(): -+ platform = 'mingw' -+ if 'amd64' in sys.version.lower(): -+ platform += '_x86_64' -+ elif 'arm64' in sys.version.lower(): -+ platform += '_aarch64' -+ elif 'arm' in sys.version.lower(): -+ platform += '_armv7' -+ else: -+ platform += '_i686' -+ - if 'ucrt' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_ucrt' -- return 'mingw_i686_ucrt' -+ platform += '_ucrt' -+ else: -+ platform += "_msvcrt" -+ - if 'clang' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_clang' -- if 'arm64' in sys.version.lower(): -- return 'mingw_aarch64' -- if 'arm' in sys.version.lower(): -- return 'mingw_armv7' -- return 'mingw_i686_clang' -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64' -- return 'mingw_i686' -+ platform += "_llvm" -+ else: -+ platform += "_gnu" -+ -+ return platform - return sys.platform - - # Same to sysconfig.get_path('purelib', os.name+'_user') -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 916c1e8..c12ce38 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -818,21 +818,27 @@ def get_platform(): - """ - if os.name == 'nt': - if 'gcc' in sys.version.lower(): -+ platform = 'mingw' -+ if 'amd64' in sys.version.lower(): -+ platform += '_x86_64' -+ elif 'arm64' in sys.version.lower(): -+ platform += '_aarch64' -+ elif 'arm' in sys.version.lower(): -+ platform += '_armv7' -+ else: -+ platform += '_i686' -+ - if 'ucrt' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_ucrt' -- return 'mingw_i686_ucrt' -+ platform += '_ucrt' -+ else: -+ platform += "_msvcrt" -+ - if 'clang' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_clang' -- if 'arm64' in sys.version.lower(): -- return 'mingw_aarch64' -- if 'arm' in sys.version.lower(): -- return 'mingw_armv7' -- return 'mingw_i686_clang' -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64' -- return 'mingw_i686' -+ platform += "_llvm" -+ else: -+ platform += "_gnu" -+ -+ return platform - if 'amd64' in sys.version.lower(): - return 'win-amd64' - if '(arm)' in sys.version.lower(): -diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py -index 03b5a98..0b1254c 100644 ---- a/Lib/test/test_importlib/test_windows.py -+++ b/Lib/test/test_importlib/test_windows.py -@@ -25,22 +25,28 @@ def get_platform(): - 'arm' : 'win-arm32', - } - if os.name == 'nt': -- if 'gcc' in sys.version.lower(): -- if 'ucrt' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_ucrt' -- return 'mingw_i686_ucrt' -- if 'clang' in sys.version.lower(): -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64_clang' -- if 'arm64' in sys.version.lower(): -- return 'mingw_aarch64' -- if 'arm' in sys.version.lower(): -- return 'mingw_armv7' -- return 'mingw_i686_clang' -- if 'amd64' in sys.version.lower(): -- return 'mingw_x86_64' -- return 'mingw_i686' -+ if "gcc" in sys.version.lower(): -+ platform = "mingw" -+ if "amd64" in sys.version.lower(): -+ platform += "_x86_64" -+ elif "arm64" in sys.version.lower(): -+ platform += "_aarch64" -+ elif "arm" in sys.version.lower(): -+ platform += "_armv7" -+ else: -+ platform += "_i686" -+ -+ if "ucrt" in sys.version.lower(): -+ platform += "_ucrt" -+ else: -+ platform += "_msvcrt" -+ -+ if "clang" in sys.version.lower(): -+ platform += "_llvm" -+ else: -+ platform += "_gnu" -+ -+ return platform - if ('VSCMD_ARG_TGT_ARCH' in os.environ and - os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT): - return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']] -diff --git a/configure.ac b/configure.ac -index 5d1b6e2..264bae6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6335,16 +6335,12 @@ AC_C_BIGENDIAN - - AC_SUBST(PYD_PLATFORM_TAG) - # Special case of PYD_PLATFORM_TAG with python build with mingw. --# Python can with compiled with clang or gcc and linked --# to msvcrt or ucrt. To avoid conflicts between them --# we are selecting the extension as based on the compiler --# and the runtime they link to --# gcc + x86_64 + msvcrt = cp{version number}-x86_64 --# gcc + i686 + msvcrt = cp{version number}-i686 --# gcc + x86_64 + ucrt = cp{version number}-x86_64-ucrt --# clang + x86_64 + ucrt = cp{version number}-x86_64-clang --# clang + i686 + ucrt = cp{version number}-i686-clang -- -+# Python can with different cpu arch and c runtime as well as different -+# toolchain. We follow this`mingw___` -+# convention for PYD_PLATFORM_TAG. Where: -+# `cpu_arch` = `x86_64`, `aarch64` or `i686` -+# `c_runtime` = `msvcrt` or `ucrt` -+# `toolchain` = `gnu` or `llvm` - PYD_PLATFORM_TAG="" - case $host in - *-*-mingw*) -@@ -6363,38 +6359,32 @@ esac - case $host_os in - mingw*) - AC_MSG_CHECKING(PYD_PLATFORM_TAG) -+ PYD_PLATFORM_TAG="mingw" - case $host in - i686-*-mingw*) -- if test -n "${cc_is_clang}"; then -- # it is CLANG32 -- PYD_PLATFORM_TAG="mingw_i686_clang" -- else -- if test $linking_to_ucrt = no; then -- PYD_PLATFORM_TAG="mingw_i686" -- else -- PYD_PLATFORM_TAG="mingw_i686_ucrt" -- fi -- fi -+ PYD_PLATFORM_TAG+="_i686" - ;; - x86_64-*-mingw*) -- if test -n "${cc_is_clang}"; then -- # it is CLANG64 -- PYD_PLATFORM_TAG="mingw_x86_64_clang" -- else -- if test $linking_to_ucrt = no; then -- PYD_PLATFORM_TAG="mingw_x86_64" -- else -- PYD_PLATFORM_TAG="mingw_x86_64_ucrt" -- fi -- fi -+ PYD_PLATFORM_TAG+="_x86_64" - ;; - aarch64-*-mingw*) -- PYD_PLATFORM_TAG+="mingw_aarch64" -+ PYD_PLATFORM_TAG+="_aarch64" - ;; - armv7-*-mingw*) -- PYD_PLATFORM_TAG+="mingw_armv7" -+ PYD_PLATFORM_TAG+="_armv7" - ;; - esac -+ if test $linking_to_ucrt = no; then -+ PYD_PLATFORM_TAG+="_msvcrt" -+ else -+ PYD_PLATFORM_TAG += "_ucrt" -+ fi -+ if test -n "${cc_is_clang}"; then -+ # it is CLANG32 -+ PYD_PLATFORM_TAG+="_llvm" -+ else -+ PYD_PLATFORM_TAG+="_gnu" -+ fi - AC_MSG_RESULT($PYD_PLATFORM_TAG) - esac - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 0ab5d3b..9ad32b3 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -37,7 +37,7 @@ else: - if sysconfig.is_python_build(): - os.environ["PYTHONLEGACYWINDOWSDLLLOADING"] = "1" - --_UCRT = sysconfig.get_platform() not in ('mingw_x86_64', 'mingw_i686') -+_UCRT = 'ucrt' in sysconfig.get_platform() - - - class Tests(unittest.TestCase): diff --git a/mingw-w64-python/0117-Add-ucrt-to-version-string.patch b/mingw-w64-python/0117-Add-ucrt-to-version-string.patch deleted file mode 100644 index e3fa9896f9847..0000000000000 --- a/mingw-w64-python/0117-Add-ucrt-to-version-string.patch +++ /dev/null @@ -1,41 +0,0 @@ -From cc8c05c2720381facce6e07132a801a513971c9d Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Fri, 1 Nov 2024 11:47:01 +0530 -Subject: [PATCH 117/N] Add ucrt to version string - ---- - Python/getcompiler.c | 5 +++++ - configure.ac | 2 +- - 2 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/Python/getcompiler.c b/Python/getcompiler.c -index 4b0b9b3..dd4d3c8 100644 ---- a/Python/getcompiler.c -+++ b/Python/getcompiler.c -@@ -32,8 +32,13 @@ - #if defined(__clang__) - #define str(x) #x - #define xstr(x) str(x) -+#if defined(_UCRT) -+#define COMPILER COMP_SEP "[GCC UCRT Clang " xstr(__clang_major__) "." \ -+ xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]" -+#else - #define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \ - xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]" -+#endif - #else - #if defined(_UCRT) - #define COMPILER COMP_SEP "[GCC UCRT " __VERSION__ ARCH_SUFFIX "]" -diff --git a/configure.ac b/configure.ac -index 264bae6..10a6e84 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -6377,7 +6377,7 @@ case $host_os in - if test $linking_to_ucrt = no; then - PYD_PLATFORM_TAG+="_msvcrt" - else -- PYD_PLATFORM_TAG += "_ucrt" -+ PYD_PLATFORM_TAG+="_ucrt" - fi - if test -n "${cc_is_clang}"; then - # it is CLANG32 diff --git a/mingw-w64-python/0118-socketmodule-fix-captilization-of-headers.patch b/mingw-w64-python/0118-socketmodule-fix-captilization-of-headers.patch deleted file mode 100644 index 5e5fcec05ccba..0000000000000 --- a/mingw-w64-python/0118-socketmodule-fix-captilization-of-headers.patch +++ /dev/null @@ -1,24 +0,0 @@ -From dee2b16fa1a2713ee87c50cd18d432e54b460489 Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sat, 2 Nov 2024 11:30:54 +0530 -Subject: [PATCH 118/N] socketmodule: fix captilization of headers - -`Rpc` should be `rpc`. It error's out in -cross-compilation. ---- - Modules/socketmodule.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 7038e10..f0d84d3 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -279,7 +279,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\ - # endif - - /* Helpers needed for AF_HYPERV */ --# include -+# include - - /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */ - #ifdef _MSC_VER diff --git a/mingw-w64-python/0119-mingw_smoketests-build-extension-in-a-venv.patch b/mingw-w64-python/0119-mingw_smoketests-build-extension-in-a-venv.patch deleted file mode 100644 index fbb0c31a562b0..0000000000000 --- a/mingw-w64-python/0119-mingw_smoketests-build-extension-in-a-venv.patch +++ /dev/null @@ -1,63 +0,0 @@ -From b86949a91b27a03461e991c4606084691bf254c3 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sun, 22 Dec 2024 13:45:24 +0100 -Subject: [PATCH 119/N] mingw_smoketests: build extension in a venv - -ensurepip no longer works since we implement PEP 668, so do -everything in a venv. ---- - mingw_smoketests.py | 21 ++++++++------------- - 1 file changed, 8 insertions(+), 13 deletions(-) - -diff --git a/mingw_smoketests.py b/mingw_smoketests.py -index 9ad32b3..5af2764 100644 ---- a/mingw_smoketests.py -+++ b/mingw_smoketests.py -@@ -287,10 +287,14 @@ class Tests(unittest.TestCase): - import sys - import subprocess - import textwrap -+ import venv - from pathlib import Path - - with tempfile.TemporaryDirectory() as tmppro: -- subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"]) -+ builder = venv.EnvBuilder(with_pip=True) -+ builder.create(tmppro) -+ venv_exe = os.path.join(tmppro, "bin", os.path.basename(sys.executable)) -+ - with Path(tmppro, "setup.py").open("w") as f: - f.write( - textwrap.dedent( -@@ -342,20 +346,11 @@ class Tests(unittest.TestCase): - ) - ) - subprocess.check_call( -- [sys.executable, "-c", "import struct"], -- ) -- subprocess.check_call( -- [ -- sys.executable, -- "-m", -- "pip", -- "install", -- "wheel", -- ], -+ [venv_exe, "-c", "import struct"], - ) - subprocess.check_call( - [ -- sys.executable, -+ venv_exe, - "-m", - "pip", - "install", -@@ -363,7 +358,7 @@ class Tests(unittest.TestCase): - ], - ) - subprocess.check_call( -- [sys.executable, "-c", "import cwrapper"], -+ [venv_exe, "-c", "import cwrapper"], - ) - - diff --git a/mingw-w64-python/0121-venv-install-batch-scripts.patch b/mingw-w64-python/0121-venv-install-batch-scripts.patch deleted file mode 100644 index 705aa06632430..0000000000000 --- a/mingw-w64-python/0121-venv-install-batch-scripts.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 9e124264a09cb49751668212ded725713648f6d7 Mon Sep 17 00:00:00 2001 -From: oltolm -Date: Sun, 17 Aug 2025 12:37:07 +0200 -Subject: [PATCH 121/N] venv: install batch scripts - ---- - Makefile.pre.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 68fbe7b..db78998 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -2174,7 +2174,7 @@ LIBSUBDIRS= asyncio \ - msilib \ - unittest \ - urllib \ -- venv venv/scripts venv/scripts/common venv/scripts/posix \ -+ venv venv/scripts venv/scripts/common venv/scripts/nt venv/scripts/posix \ - wsgiref \ - $(XMLLIBSUBDIRS) \ - xmlrpc \ diff --git a/mingw-w64-python/0122-winreg-patch-cleanup.patch b/mingw-w64-python/0122-winreg-patch-cleanup.patch deleted file mode 100644 index 158374bfc0d8c..0000000000000 --- a/mingw-w64-python/0122-winreg-patch-cleanup.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 5f118e451982c9502876e07fdf384d94dfff3975 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sun, 31 Aug 2025 16:40:48 +0200 -Subject: [PATCH 122/N] winreg: patch cleanup - -* REG_LEGAL_CHANGE_FILTER is part of mingw-w64 now -* SIZEOF_HKEY is defined already -* use the same build logic as with other win32 only modules - -Needs to be merged into "Build winreg by default when compiling for MINGW" - -Fixes #181 ---- - Modules/Setup.bootstrap.in | 2 +- - PC/winreg.c | 19 ------------------- - configure.ac | 8 +------- - 3 files changed, 2 insertions(+), 27 deletions(-) - -diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in -index cec80f5..271a5b6 100644 ---- a/Modules/Setup.bootstrap.in -+++ b/Modules/Setup.bootstrap.in -@@ -36,6 +36,6 @@ _symtable symtablemodule.c - @MODULE_PWD_TRUE@pwd pwdmodule.c - - # build-in modules for windows platform: --@USE_WIN32_MODULE@winreg ../PC/winreg.c -+@MODULE_WINREG_TRUE@winreg ../PC/winreg.c - @MODULE_MSVCRT_TRUE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c - @MODULE__WINAPI_TRUE@_winapi _winapi.c -diff --git a/PC/winreg.c b/PC/winreg.c -index 33ec8ff..e8f36c1 100644 ---- a/PC/winreg.c -+++ b/PC/winreg.c -@@ -19,25 +19,6 @@ - #include "structmember.h" // PyMemberDef - #include - --#ifndef SIZEOF_HKEY --/* used only here */ --#if defined(MS_WIN64) --# define SIZEOF_HKEY 8 --#elif defined(MS_WIN32) --# define SIZEOF_HKEY 4 --#else --# error "SIZEOF_HKEY is not defined" --#endif --#endif -- --#ifndef REG_LEGAL_CHANGE_FILTER --#define REG_LEGAL_CHANGE_FILTER (\ -- REG_NOTIFY_CHANGE_NAME |\ -- REG_NOTIFY_CHANGE_ATTRIBUTES |\ -- REG_NOTIFY_CHANGE_LAST_SET |\ -- REG_NOTIFY_CHANGE_SECURITY ) --#endif -- - #if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES) - - typedef struct { -diff --git a/configure.ac b/configure.ac -index 10a6e84..5dcec81 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4633,13 +4633,6 @@ case $host in - CFLAGS_NODIST="$CFLAGS_NODIST -D_WIN32_WINNT=0x0602";; - esac - --# Determine if windows modules should be used. --AC_SUBST(USE_WIN32_MODULE) --USE_WIN32_MODULE='#' --case $host in -- *-*-mingw*) USE_WIN32_MODULE=;; --esac -- - # Templates for things AC_DEFINEd more than once. - # For a single AC_DEFINE, no template is needed. - AH_TEMPLATE([_REENTRANT], -@@ -8059,6 +8052,7 @@ PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes], - [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS]) - - dnl windows specific modules -+PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"]) - PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"]) - PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"]) - PY_STDLIB_MOD([_msi], [test "$MACHDEP" = "win32"], [], [], diff --git a/mingw-w64-python/PKGBUILD b/mingw-w64-python/PKGBUILD index 05a2f17637072..bdcc2806c9b0d 100644 --- a/mingw-w64-python/PKGBUILD +++ b/mingw-w64-python/PKGBUILD @@ -5,7 +5,7 @@ # Contributor: Frode Solheim _primary_python="yes" -_pybasever=3.12 +_pybasever=3.13 _realname=python if [[ "${_primary_python}" == "yes" ]]; then @@ -22,13 +22,14 @@ else pkgbase="mingw-w64-${_realname}${_pybasever}" pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}") fi -pkgver=${_pybasever}.12 +pkgver=${_pybasever}.11 pkgrel=1 pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') license=('spdx:PSF-2.0') url="https://www.python.org/" +msys2_repository_url="https://github.com/python/cpython" msys2_references=( "cpe: cpe:/a:python:python" "cpe: cpe:/a:python_software_foundation:python" @@ -44,6 +45,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-cc-libs" "${MINGW_PACKAGE_PREFIX}-tcl" "${MINGW_PACKAGE_PREFIX}-tk" "${MINGW_PACKAGE_PREFIX}-zlib" + "${MINGW_PACKAGE_PREFIX}-libb2" "${MINGW_PACKAGE_PREFIX}-xz" "${MINGW_PACKAGE_PREFIX}-tzdata") makedepends=( @@ -54,128 +56,107 @@ makedepends=( #options=('debug' '!strip') source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz" "EXTERNALLY-MANAGED" - 0001-sysconfig-make-_sysconfigdata.py-relocatable.patch - 0002-build-add-with-nt-threads-and-make-it-default-on-min.patch - 0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch + 0001-build-add-with-nt-threads-and-make-it-default-on-min.patch + 0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch + 0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch 0004-configure-add-MACHDEP-and-platform-on-MINGW.patch - 0005-Add-default-configuration-for-MINGW.patch + 0005-build-Add-default-cross-configuration-for-MINGW.patch 0006-configure-enable-largefile-support-by-default-for-Mi.patch - 0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch - 0008-posixmodule.c-Define-necessary-headers-for-compiling.patch - 0009-Build-winreg-by-default-when-compiling-for-MINGW.patch - 0010-pyport.h-Add-support-for-MINGW.patch - 0011-configure-add-options-so-that-shared-build-is-possib.patch - 0012-Add-dynamic-loading-support-for-MINGW.patch - 0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch - 0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch - 0015-Enable-some-windows-specific-modules.patch - 0016-sysconfig-MINGW-build-extensions-with-GCC.patch - 0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch - 0018-Add-support-for-stdcall-without-underscore.patch - 0019-Customize-site-for-MINGW.patch - 0020-add-python-config-sh.patch - 0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch - 0022-msys-cygwin-semi-native-build-sysconfig.patch - 0023-sysconfig-mingw-sysconfig-like-posix.patch - 0024-mingw-use-backslashes-in-compileall-py.patch - 0025-mingw-pdcurses_ISPAD.patch - 0026-remove_path_max.default.patch - 0027-dont-link-with-gettext.patch - 0028-ctypes-python-dll.patch - 0029-gdbm-module-includes.patch - 0030-use-gnu_printf-in-format.patch - 0031-mingw-fix-ssl-dont-use-enum_certificates.patch - 0032-fix-using-dllhandle-and-winver-mingw.patch - 0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch - 0034-MINGW-link-with-additional-library.patch - 0035-install-msilib.patch - 0036-fix-signal-module-build.patch + 0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch + 0008-build-add-MINGW-support-for-posixmodule.patch + 0009-exports.h-Add-support-for-MINGW.patch + 0010-configure-add-options-so-that-shared-build-is-possib.patch + 0011-build-Add-PYD_PLATFORM_TAG.patch + 0012-build-Add-dynload_win-support-for-MinGW.patch + 0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch + 0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch + 0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch + 0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch + 0017-socketmodule-add-MINGW-support.patch + 0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch + 0019-sysconfig-make-_sysconfigdata.py-relocatable.patch + 0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch + 0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch + 0022-build-semi-native-build-sysconfig.patch + 0023-ctypes-Add-support-for-stdcall-without-underscore.patch + 0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch + 0025-ctypes-find_library-c-should-return-None-with-ucrt.patch + 0026-site-Customize-for-MINGW.patch + 0027-site-Change-user-site-packages-path-to-include-the-e.patch + 0028-python-config-output-Windows-paths-for-the-shell-var.patch + 0029-python-config-use-the-Python-variant-of-python-confi.patch + 0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch + 0031-build-Remove-MAXPATHLEN-default.patch + 0032-build-dont-link-with-gettext.patch + 0033-use-gnu_printf-in-format.patch + 0034-build-remove-usage-of-MS_COREDLL.patch + 0035-getcompiler-expose-MINGW-toolchain-related-informati.patch + 0036-build-fix-signal-module-build.patch 0037-build-build-winconsoleio-and-_testconsole.patch - 0038-expose-sem_unlink.patch + 0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch 0039-Use-cygpty-while-using-isatty.patch 0040-build-link-win-resource-files-and-build-pythonw.patch - 0041-fix-isselectable.patch - 0042-configure.ac-fix-inet_pton-check.patch - 0043-pass-gen-profile-ldflags.patch - 0044-pkg-config-windows-must-link-ext-with-python-lib.patch - 0045-importlib-bootstrap-path-sep.patch - 0046-warnings-fixes.patch - 0047-fix-build-testinternalcapi.patch - 0048-clang-arm64.patch - 0049-configure.ac-set-MINGW-stack-reserve.patch - 0050-Don-t-use-os.pathsep-to-find-EOF.patch - 0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch - 0052-Change-the-get_platform-method-in-sysconfig.patch - 0053-build-Fix-ncursesw-include-lookup.patch - 0054-tests-fix-test_bytes.patch - 0055-time-fix-strftime-not-raising-for-invalid-year-value.patch - 0056-ctypes-find_library-c-should-return-None-with-ucrt.patch - 0057-build-Disable-checks-for-dlopen-dlfcn.patch - 0058-Fix-install-location-of-the-import-library.patch - 0059-build-Integrate-venvlauncher-build-installation-into.patch - 0060-configure.ac-set-_WIN32_WINNT-version.patch - 0061-configure.ac-don-t-check-for-clock_-functions.patch - 0062-expanduser-normpath-paths-coming-from-env-vars.patch - 0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch - 0064-Define-PY3_DLLNAME-to-fix-build.patch - 0065-_testconsole.c-Fix-casing-path-sep.patch - 0066-Return-consistent-architecture-markers-for-python-on.patch - 0067-handle-ncursesw-pkg-config-when-cross-compiling.patch - 0068-mingw_smoketests-fix-_UCRT-condition.patch - 0069-Modify-sys.winver-to-match-upstream.patch - 0070-Change-user-site-packages-path-to-include-the-enviro.patch - 0071-configure-Include-a-header-in-the-check-for-_beginth.patch - 0072-configure.ac-Default-to-without-c-locale-coercion-on.patch - 0073-Fix-failing-tests.patch - 0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch - 0075-def-VPATH-when-compiling-Python-sysmodule.c.patch - 0076-Make-_Py_CheckPython3-extern.patch - 0077-link-with-bcrypt.patch - 0078-correctly-find-native-python.patch - 0079-Add-extra-flags-for-_bootstrap_python.patch - 0080-posixmodule-undefine-HAVE_OPENDIR.patch - 0081-getpath.py-add-support-for-mingw.patch - 0082-Don-t-build-_posixsubprocess-on-Windows.patch - 0083-_ssl-link-with-ws2_32.patch - 0084-Always-normalize-path-in-abspath.patch - 0085-Include-winsock.h-when-checking-for-netdb-function.patch - 0086-include-_multiprocessing-semaphore.c-on-win32.patch - 0087-configure-build-mmap-module-on-win32.patch - 0088-venv-creation-fixes.patch - 0089-move-the-shutdown-function-where-winsock.h-is-includ.patch - 0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch - 0091-configure.ac-fix-building-some-test-modules.patch - 0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch - 0093-Always-convert-to-before-passing-though-pathcch-func.patch - 0094-Build-venvlauncher.exe-from-PC-launcher.c.patch - 0095-getpath.py-fix-dirname.patch - 0096-getpath-use-normpath-on-all-generated-paths.patch - 0097-pathconfig-normpath-sys.path-0.patch - 0098-smoketests-add-some-tests-for-sys-site-paths.patch - 0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch - 0100-Build-and-install-libpython3.dll.patch - 0101-Port-GetPythonImport-to-mingw.patch - 0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch - 0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch - 0104-Add-missing-library-for-multiprocessing-module.patch - 0105-selectmodule-add-support-for-MINGW.patch - 0106-readline-disable-on-MINGW.patch - 0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch - 0108-Add-lpython-version-while-linking-stdlib.patch - 0109-Enable-_uuid-on-MINGW.patch - 0110-Enable-curses-library-on-MINGW.patch - 0111-mingw_smoketests-disable-distutils-related-tests.patch - 0112-configure.ac-use-autoconf-2.69.patch - 0113-CI-clean-up-ignored-tests.patch - 0114-gcc-make-incompatible-pointer-types-as-warning.patch - 0115-test_makefile-normalize-path.patch - 0116-sysconfig.get_platform-use-consistent-naming.patch - 0117-Add-ucrt-to-version-string.patch - 0118-socketmodule-fix-captilization-of-headers.patch - 0119-mingw_smoketests-build-extension-in-a-venv.patch - 0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch - 0121-venv-install-batch-scripts.patch - 0122-winreg-patch-cleanup.patch) + 0041-pycore_fileutils-add-MINGW-support.patch + 0042-configure-fix-inet_pton-check.patch + 0043-importlib-bootstrap-path-sep.patch + 0044-configure-set-MINGW-stack-reserve.patch + 0045-tests-fix-test_bytes.patch + 0046-timemodule-add-MINGW-support.patch + 0047-configure-Disable-checks-for-dlopen-dlfcn.patch + 0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch + 0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch + 0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch + 0051-configure-don-t-check-for-clock_-functions.patch + 0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch + 0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch + 0054-tests-Fix-some-failing-tests.patch + 0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch + 0056-configure-correctly-find-native-python.patch + 0057-build-Add-extra-flags-for-_bootstrap_python.patch + 0058-getpath-add-support-for-mingw.patch + 0059-build-Don-t-build-_posixsubprocess-on-Windows.patch + 0060-ssl-module-add-MINGW-support.patch + 0061-configure-Include-winsock.h-when-checking-for-netdb-.patch + 0062-configure-always-build-_multiprocessing-on-Windows.patch + 0063-configure-build-mmap-module-on-win32.patch + 0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch + 0065-configure-fix-building-some-test-modules.patch + 0066-Always-convert-to-before-passing-though-pathcch-func.patch + 0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch + 0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch + 0069-dynload_win-Port-GetPythonImport-to-MINGW.patch + 0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch + 0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch + 0072-build-Build-and-install-libpython3.dll-stable-ABI.patch + 0073-configure-define-_DEBUG-for-a-debug-build.patch + 0074-configure-fix-multiprocessing-module.patch + 0075-build-add-MINGW-support-for-selectmodule.patch + 0076-configure-disable-various-modules-on-MINGW.patch + 0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch + 0078-configure-Enable-_uuid-on-MINGW.patch + 0079-configure-make-incompatible-pointer-types-a-warning.patch + 0080-tests-test_makefile-normalize-path.patch + 0081-Fix-include-naming-for-cross-build.patch + 0082-Fix-format-warning.patch + 0083-Fix-pragma-warnings.patch + 0084-math-pyhash-MINGW-support.patch + 0085-tests-Fix-test-for-library-name.patch + 0086-dictobject-MINGW-support.patch + 0087-build-Fix-export-Py_GetBuildInfo-symbol.patch + 0088-build-Allow-profile-tests-failure.patch + 0089-build-add-support-for-building-C-modules.patch + 0090-build-build-fix-the-wmi-module.patch + 0091-Fix-exports-for-_suggestions-module.patch + 0092-compileall-Normalize-paths.patch + 0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch + 0094-configure-Work-around-broken-pc-file.patch + 0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch + 0096-venv-also-install-the-versioned-launchers.patch + 0097-configure-set-_WIN32_WINNT-version.patch + 0098-tests-fix-sysconfig.test_get_platform.patch + 0099-pycore_time-fix-missing-timeval.patch + 0100-mmapmodule-define-DONT_USE_SEH.patch + 0101-build-Add-ABIFLAGS-to-targets-when-needed.patch) # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -189,128 +170,107 @@ apply_patch_with_msg() { prepare() { cd "${srcdir}/Python-${pkgver}" - apply_patch_with_msg 0001-sysconfig-make-_sysconfigdata.py-relocatable.patch \ - 0002-build-add-with-nt-threads-and-make-it-default-on-min.patch \ - 0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch \ + apply_patch_with_msg 0001-build-add-with-nt-threads-and-make-it-default-on-min.patch \ + 0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch \ + 0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch \ 0004-configure-add-MACHDEP-and-platform-on-MINGW.patch \ - 0005-Add-default-configuration-for-MINGW.patch \ + 0005-build-Add-default-cross-configuration-for-MINGW.patch \ 0006-configure-enable-largefile-support-by-default-for-Mi.patch \ - 0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch \ - 0008-posixmodule.c-Define-necessary-headers-for-compiling.patch \ - 0009-Build-winreg-by-default-when-compiling-for-MINGW.patch \ - 0010-pyport.h-Add-support-for-MINGW.patch \ - 0011-configure-add-options-so-that-shared-build-is-possib.patch \ - 0012-Add-dynamic-loading-support-for-MINGW.patch \ - 0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch \ - 0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch \ - 0015-Enable-some-windows-specific-modules.patch \ - 0016-sysconfig-MINGW-build-extensions-with-GCC.patch \ - 0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch \ - 0018-Add-support-for-stdcall-without-underscore.patch \ - 0019-Customize-site-for-MINGW.patch \ - 0020-add-python-config-sh.patch \ - 0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch \ - 0022-msys-cygwin-semi-native-build-sysconfig.patch \ - 0023-sysconfig-mingw-sysconfig-like-posix.patch \ - 0024-mingw-use-backslashes-in-compileall-py.patch \ - 0025-mingw-pdcurses_ISPAD.patch \ - 0026-remove_path_max.default.patch \ - 0027-dont-link-with-gettext.patch \ - 0028-ctypes-python-dll.patch \ - 0029-gdbm-module-includes.patch \ - 0030-use-gnu_printf-in-format.patch \ - 0031-mingw-fix-ssl-dont-use-enum_certificates.patch \ - 0032-fix-using-dllhandle-and-winver-mingw.patch \ - 0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch \ - 0034-MINGW-link-with-additional-library.patch \ - 0035-install-msilib.patch \ - 0036-fix-signal-module-build.patch \ + 0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch \ + 0008-build-add-MINGW-support-for-posixmodule.patch \ + 0009-exports.h-Add-support-for-MINGW.patch \ + 0010-configure-add-options-so-that-shared-build-is-possib.patch \ + 0011-build-Add-PYD_PLATFORM_TAG.patch \ + 0012-build-Add-dynload_win-support-for-MinGW.patch \ + 0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch \ + 0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch \ + 0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch \ + 0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch \ + 0017-socketmodule-add-MINGW-support.patch \ + 0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch \ + 0019-sysconfig-make-_sysconfigdata.py-relocatable.patch \ + 0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch \ + 0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch \ + 0022-build-semi-native-build-sysconfig.patch \ + 0023-ctypes-Add-support-for-stdcall-without-underscore.patch \ + 0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch \ + 0025-ctypes-find_library-c-should-return-None-with-ucrt.patch \ + 0026-site-Customize-for-MINGW.patch \ + 0027-site-Change-user-site-packages-path-to-include-the-e.patch \ + 0028-python-config-output-Windows-paths-for-the-shell-var.patch \ + 0029-python-config-use-the-Python-variant-of-python-confi.patch \ + 0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch \ + 0031-build-Remove-MAXPATHLEN-default.patch \ + 0032-build-dont-link-with-gettext.patch \ + 0033-use-gnu_printf-in-format.patch \ + 0034-build-remove-usage-of-MS_COREDLL.patch \ + 0035-getcompiler-expose-MINGW-toolchain-related-informati.patch \ + 0036-build-fix-signal-module-build.patch \ 0037-build-build-winconsoleio-and-_testconsole.patch \ - 0038-expose-sem_unlink.patch \ + 0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch \ 0039-Use-cygpty-while-using-isatty.patch \ 0040-build-link-win-resource-files-and-build-pythonw.patch \ - 0041-fix-isselectable.patch \ - 0042-configure.ac-fix-inet_pton-check.patch \ - 0043-pass-gen-profile-ldflags.patch \ - 0044-pkg-config-windows-must-link-ext-with-python-lib.patch \ - 0045-importlib-bootstrap-path-sep.patch \ - 0046-warnings-fixes.patch \ - 0047-fix-build-testinternalcapi.patch \ - 0048-clang-arm64.patch \ - 0049-configure.ac-set-MINGW-stack-reserve.patch \ - 0050-Don-t-use-os.pathsep-to-find-EOF.patch \ - 0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch \ - 0052-Change-the-get_platform-method-in-sysconfig.patch \ - 0053-build-Fix-ncursesw-include-lookup.patch \ - 0054-tests-fix-test_bytes.patch \ - 0055-time-fix-strftime-not-raising-for-invalid-year-value.patch \ - 0056-ctypes-find_library-c-should-return-None-with-ucrt.patch \ - 0057-build-Disable-checks-for-dlopen-dlfcn.patch \ - 0058-Fix-install-location-of-the-import-library.patch \ - 0059-build-Integrate-venvlauncher-build-installation-into.patch \ - 0060-configure.ac-set-_WIN32_WINNT-version.patch \ - 0061-configure.ac-don-t-check-for-clock_-functions.patch \ - 0062-expanduser-normpath-paths-coming-from-env-vars.patch \ - 0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch \ - 0064-Define-PY3_DLLNAME-to-fix-build.patch \ - 0065-_testconsole.c-Fix-casing-path-sep.patch \ - 0066-Return-consistent-architecture-markers-for-python-on.patch \ - 0067-handle-ncursesw-pkg-config-when-cross-compiling.patch \ - 0068-mingw_smoketests-fix-_UCRT-condition.patch \ - 0069-Modify-sys.winver-to-match-upstream.patch \ - 0070-Change-user-site-packages-path-to-include-the-enviro.patch \ - 0071-configure-Include-a-header-in-the-check-for-_beginth.patch \ - 0072-configure.ac-Default-to-without-c-locale-coercion-on.patch \ - 0073-Fix-failing-tests.patch \ - 0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch \ - 0075-def-VPATH-when-compiling-Python-sysmodule.c.patch \ - 0076-Make-_Py_CheckPython3-extern.patch \ - 0077-link-with-bcrypt.patch \ - 0078-correctly-find-native-python.patch \ - 0079-Add-extra-flags-for-_bootstrap_python.patch \ - 0080-posixmodule-undefine-HAVE_OPENDIR.patch \ - 0081-getpath.py-add-support-for-mingw.patch \ - 0082-Don-t-build-_posixsubprocess-on-Windows.patch \ - 0083-_ssl-link-with-ws2_32.patch \ - 0084-Always-normalize-path-in-abspath.patch \ - 0085-Include-winsock.h-when-checking-for-netdb-function.patch \ - 0086-include-_multiprocessing-semaphore.c-on-win32.patch \ - 0087-configure-build-mmap-module-on-win32.patch \ - 0088-venv-creation-fixes.patch \ - 0089-move-the-shutdown-function-where-winsock.h-is-includ.patch \ - 0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch \ - 0091-configure.ac-fix-building-some-test-modules.patch \ - 0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch \ - 0093-Always-convert-to-before-passing-though-pathcch-func.patch \ - 0094-Build-venvlauncher.exe-from-PC-launcher.c.patch \ - 0095-getpath.py-fix-dirname.patch \ - 0096-getpath-use-normpath-on-all-generated-paths.patch \ - 0097-pathconfig-normpath-sys.path-0.patch \ - 0098-smoketests-add-some-tests-for-sys-site-paths.patch \ - 0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch \ - 0100-Build-and-install-libpython3.dll.patch \ - 0101-Port-GetPythonImport-to-mingw.patch \ - 0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch \ - 0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch \ - 0104-Add-missing-library-for-multiprocessing-module.patch \ - 0105-selectmodule-add-support-for-MINGW.patch \ - 0106-readline-disable-on-MINGW.patch \ - 0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch \ - 0108-Add-lpython-version-while-linking-stdlib.patch \ - 0109-Enable-_uuid-on-MINGW.patch \ - 0110-Enable-curses-library-on-MINGW.patch \ - 0111-mingw_smoketests-disable-distutils-related-tests.patch \ - 0112-configure.ac-use-autoconf-2.69.patch \ - 0113-CI-clean-up-ignored-tests.patch \ - 0114-gcc-make-incompatible-pointer-types-as-warning.patch \ - 0115-test_makefile-normalize-path.patch \ - 0116-sysconfig.get_platform-use-consistent-naming.patch \ - 0117-Add-ucrt-to-version-string.patch \ - 0118-socketmodule-fix-captilization-of-headers.patch \ - 0119-mingw_smoketests-build-extension-in-a-venv.patch \ - 0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \ - 0121-venv-install-batch-scripts.patch \ - 0122-winreg-patch-cleanup.patch + 0041-pycore_fileutils-add-MINGW-support.patch \ + 0042-configure-fix-inet_pton-check.patch \ + 0043-importlib-bootstrap-path-sep.patch \ + 0044-configure-set-MINGW-stack-reserve.patch \ + 0045-tests-fix-test_bytes.patch \ + 0046-timemodule-add-MINGW-support.patch \ + 0047-configure-Disable-checks-for-dlopen-dlfcn.patch \ + 0048-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch \ + 0049-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \ + 0050-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch \ + 0051-configure-don-t-check-for-clock_-functions.patch \ + 0052-CI-test-the-build-and-add-some-mingw-specific-tests.patch \ + 0053-configure-Default-to-without-c-locale-coercion-on-Wi.patch \ + 0054-tests-Fix-some-failing-tests.patch \ + 0055-build-def-VPATH-when-compiling-Python-sysmodule.c.patch \ + 0056-configure-correctly-find-native-python.patch \ + 0057-build-Add-extra-flags-for-_bootstrap_python.patch \ + 0058-getpath-add-support-for-mingw.patch \ + 0059-build-Don-t-build-_posixsubprocess-on-Windows.patch \ + 0060-ssl-module-add-MINGW-support.patch \ + 0061-configure-Include-winsock.h-when-checking-for-netdb-.patch \ + 0062-configure-always-build-_multiprocessing-on-Windows.patch \ + 0063-configure-build-mmap-module-on-win32.patch \ + 0064-configure-set-BUILDEXEEXT-and-EXEEXT.patch \ + 0065-configure-fix-building-some-test-modules.patch \ + 0066-Always-convert-to-before-passing-though-pathcch-func.patch \ + 0067-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch \ + 0068-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch \ + 0069-dynload_win-Port-GetPythonImport-to-MINGW.patch \ + 0070-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch \ + 0071-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch \ + 0072-build-Build-and-install-libpython3.dll-stable-ABI.patch \ + 0073-configure-define-_DEBUG-for-a-debug-build.patch \ + 0074-configure-fix-multiprocessing-module.patch \ + 0075-build-add-MINGW-support-for-selectmodule.patch \ + 0076-configure-disable-various-modules-on-MINGW.patch \ + 0077-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch \ + 0078-configure-Enable-_uuid-on-MINGW.patch \ + 0079-configure-make-incompatible-pointer-types-a-warning.patch \ + 0080-tests-test_makefile-normalize-path.patch \ + 0081-Fix-include-naming-for-cross-build.patch \ + 0082-Fix-format-warning.patch \ + 0083-Fix-pragma-warnings.patch \ + 0084-math-pyhash-MINGW-support.patch \ + 0085-tests-Fix-test-for-library-name.patch \ + 0086-dictobject-MINGW-support.patch \ + 0087-build-Fix-export-Py_GetBuildInfo-symbol.patch \ + 0088-build-Allow-profile-tests-failure.patch \ + 0089-build-add-support-for-building-C-modules.patch \ + 0090-build-build-fix-the-wmi-module.patch \ + 0091-Fix-exports-for-_suggestions-module.patch \ + 0092-compileall-Normalize-paths.patch \ + 0093-configure-enable-64-bit-time-support-for-32-bit-buil.patch \ + 0094-configure-Work-around-broken-pc-file.patch \ + 0095-makesetup-make-sure-a-library-path-is-passed-when-bu.patch \ + 0096-venv-also-install-the-versioned-launchers.patch \ + 0097-configure-set-_WIN32_WINNT-version.patch \ + 0098-tests-fix-sysconfig.test_get_platform.patch \ + 0099-pycore_time-fix-missing-timeval.patch \ + 0100-mmapmodule-define-DONT_USE_SEH.patch \ + 0101-build-Add-ABIFLAGS-to-targets-when-needed.patch autoreconf -vfi } @@ -331,12 +291,6 @@ build() { _extra_config+=("--with-pydebug") fi - case "${CARCH}" in - i686) - LDFLAGS+=" -Wl,--large-address-aware" - ;; - esac - mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" ../Python-${pkgver}/configure \ @@ -391,7 +345,7 @@ package() { install -Dm644 "${srcdir}/EXTERNALLY-MANAGED" -t "${pkgdir}${MINGW_PREFIX}/lib/python${_pybasever}/" # fixup shebangs - for fscripts in 2to3 2to3-${_pybasever} idle3 idle${_pybasever} pydoc3 pydoc${_pybasever}; do + for fscripts in idle3 idle${_pybasever} pydoc3 pydoc${_pybasever}; do sed -e '1 { s|^#!.*$|#!/usr/bin/env python'"${_pybasever}"'.exe| }' -i "${pkgdir}${MINGW_PREFIX}"/bin/${fscripts} done @@ -412,7 +366,6 @@ package() { rm "${pkgdir}${MINGW_PREFIX}"/bin/python3-config rm "${pkgdir}${MINGW_PREFIX}"/bin/idle3 rm "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3 - rm "${pkgdir}${MINGW_PREFIX}"/bin/2to3 rm "${pkgdir}${MINGW_PREFIX}"/bin/libpython3.dll rm "${pkgdir}${MINGW_PREFIX}"/lib/libpython3.dll.a rm "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/python3-embed.pc @@ -421,127 +374,106 @@ package() { fi } -sha256sums=('fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4' +sha256sums=('16ede7bb7cdbfa895d11b0642fa0e523f291e6487194d53cf6d3b338c3a17ea2' '3981fed74ee7d43ad69bd67e634e03d7bf6890558a87062380112e195688728a' - '129e055903f8b68148b618a9c214cc4ee4efe798fe7421f7d595e1851d0b5e6a' - 'fb9cd23fd99dc59e97721265df226678790435f911a40bd2770e5692375ee854' - '3274d63d220a465b862f5cca1b274fa9baa793baff5f6eb448ec5f5423662ee7' - 'e17f52c91fcba9ab72561f978fb20a9053d954feaa643dec9cc39772a96deccb' - '9743fa9631dd227989a22ade48e2270e18de03c264f098610c0c9346ad63df67' - 'a3dc87819ba27f9c51a692862fa948e911eaa8ba540702b8e16506e8bb5f6deb' - 'c0384ad2de32c5d39bcd503bea9a55503ef0939c170ee655e5a6b7cbdd625e21' - '3bdc199a76f5823b0ce623e1764a2f9ff0132d15ab603abb75582208fa6fb4f4' - '75d9e8ebe36c40c32047edb80244260960c2cbc71e9fd53af8e7bfd2a0a76330' - '83d54c63ab8125aff128a9ef649e3869dfc3ff12790a4e163804c366af57e43a' - '57719613069763a9500a12ddbd159cfb169836e83390017ba939929bd3eeb800' - '9e63a4b8e83c8fc1b7eaed2104b8c8e391d63022a958cec909f9119517e9702f' - 'e306e21b2dd505d4ef672cb77ee21ef8d1fd3ee40b7b7cfafea646dbe5f6753a' - '7cd234874590d3ec4cdb7b7890e1221eedc0113509d5565106b2e67d4422a6fe' - 'c370e8d0977ce2c1976fd59373a1edf66e2e530d195d0e21b3e7ca65abfe1045' - 'cc806e4aa326838c8ee5f2d181e2a23f14c8b4d2a4ddf2f15a67189dd3040ee4' - '1c5ca50061fa2b011c42c0abbbe7f7c83be66dc878ff86165693ac190df452b0' - 'ce1160382eca84194b880bc6a71b97b9199a2439fe159bf2defc8b525ad6a8e4' - 'b80eb4e7da6f77909f2ee39acb7ed275ac93083d0fbec7e8fcd3d06357d22115' - '350a6d5a5890b7f5d00fd8ae013102d0421c4dee7990516486d16f9b37bcbd14' - 'dbea41894cc371fcd37bd3f9e53a2fe0da678d22646affbe4ef5e33b30d81041' - 'fd3335f2cabc6a98d31305882d812100557277405f47a2b1531c9d16898061ca' - 'aeb49017fd70e311c9bd2dad145de641460999bb4a43089ec6e2c5fb43d59242' - '70e080bd41007d63b8e026d38181a4f840b18f8a0a65b6b41fcd764e5859d7f8' - 'def26a34f58d0094cd7f5982766f83c9449f12356bb00fc18f74628633685d83' - '8f855744cb0acda024a321aac178266f5f7213f3d419566417a495684a305a14' - '791f89de00195d01cce6cdc02b03ec22e3e1be5fe882007bb90155ed82944f4b' - '313a9690f8048dc3839f46beb700bc4b8bd5601b2083d30de5f3909dd2edc756' - '2311c9fe4b63d73016595d87720f3bee5161a3b62e3d43f540d620a8f94266c7' - 'f1dfd4bc5e9757a25c9155e501853c0c5b50c810df5e555ff2a50763f189953b' - 'ffec02d0479365a0c06948a57f7c367c8b1bf30f064b835e21b2dcf5ca16a8f1' - '539df9eb2bbcd8da2b954b6ef965e8a10d187189b3905f183d3f0e8ff53a74e8' - '686c83deab49bc86475b72c77b180d9e3636fb671808bc17542c068948f04260' - '3f5a2fc54ef1e69951465046161f09694838eb792607ab14a4fed7adf0beab9c' - '9cef2f0f336326ad8cbc1fe31ef6e213590807a691ab0e62922838f2a8c0a55a' - '98addafc878dd86f8e63c1a26b480bee094bacbe5f63ceb8d3890e2937862d3f' - '581d6ea893efc86222b9e5195de7bd2d7e36ba5171ea5c8082489299b1272abc' - 'b90444b250f11187abb17b3ca220e1d2cccc7cc0feb8a245b3e5d18eb3b5c4e5' - 'd27d3c46505873b19073cb9b27e6210557b8d29e2a74a38fb47f32c2fe270bd7' - '17fbfd64c7d9204cf4d502e28c2b8a462d3222fd1aa2c3f96645bbd9f13f9dca' - '731656e9361c5972128dfc3f0404761f790f968c3978771db23f968c3cde1750' - '01d7fb4e2553fff9126bf366c41055f8b09e0e2ab3435ea9a0ac4a8a90854f00' - 'f53b9e2896c599265db1947299f40fbd7ac5937a11c8e6fffb2455f64425f1a5' - '5f9640658a9cd18e3818a0ed074e008a5ea2ed772fe777151bc1334de90662fe' - '55f67c443cfeebc245cb01091d9c10e2425cb2a76ecded123908e49a3a75804c' - '41d7defdb4a4f9b0b0e14b4797ba338e974ad4d6da983cb91c375129f96e08e9' - '2f40805ab4e2c0b7132f66c801a182988c2ce17cc33c4f72cf15aabf6eaac175' - '49c78dc9996ff9156be4aa7afcba8320c9e61b02bfed8fe09c8deb679c697068' - 'de1b297b62c1212b937e98890f7c7d9e867d92a1cb12666f26c1a85a79c76290' - '78b48f10fdd2de058ab36ba3df7cdf9e1acddbc0d07d315f4235fcdc9a486fb3' - '061d24d934dbc102a7f0ab24884d1f579c13d061d7aac471a9890fad96bf9c2a' - '130523daa59dc26da58f8fecb484356dae6f9f7addb0f1924ec2d649ceb116e4' - '493af2753fe143209aa718cb3d49d4a3c6d3678bfa9fea251cf289f7e4f0459d' - '18a7ba77a0ba1a2d5fb35006c35579964bc5e4797d24589de567bd48401d1549' - 'bb17b2e81e134b1fc573a54c41e60294280f5779577a89863b3e916efe421407' - '36462b169d91cd8ec917e05f853d33cca1c92db39bade3e9e46d8ad9601cbdb8' - 'e141ee305658e4a9968294fd87822ecc0ae165fd794bad95096ba088f3f3c188' - 'd5928c14cf7f687b88f42254227d40db160eadcdcb9b04abf368d9a47af87636' - '6868582d1b9b8019669dc61e1f0b7aa13d8469955cedad74dd035ce037c91e94' - 'e218cfad8a4123b659ba29fc6f839ac730dd5a71b595d3863d015152292687de' - 'ecf20781e452c814a260e61af87cc700738227fed6c5fa448051e4eecb77b02d' - 'feedcd2d507017f2fffcd2ae55271c49abc788b1b4f1e054f81709a989c068ee' - 'dffb20582fa0f561ba9ee139b25a83e0589e61725cc2b0e08f1cc8ddbebfef91' - '19e54640d63f4f0f0fc50ff69455f4fc4cc9b983db2bf5fc94a4c4d6ed11a97d' - '93658ca4892c2db353bab2c1335eab69b0d45b581d9be82b7880d6081ccabbdc' - '2a63b0dfeb18acfbb542aa3896b38d98efa4c0de1d60e79c5c2879e8d49d6873' - 'ca394b04bdac0dc60a1ade43a2b584e4b9318067ec124c1f4222ff511a214f29' - 'f060a590ce1b25f7d82dffd7c2d27d6b20296781450da1642f456e92a6a89e3f' - 'e16c43d1b6703a8e7487b8e016be8b11df3e632e7689fa685084754eef539f8b' - '0ead1872c0e0892f05d8ecfa4af457375be3dc72571becdb692414df1985d90e' - '743c1eb3912e170497fa2a047aa68663a7dd00b2f9cb9b41aef28a9a27d83839' - '40a279bd874c582c1ebc6dfc71d218178de1bcb143fc5b40246eda6728e1790b' - '93bf3b5fe25af7e7e633855d9f42ea90e4219fb4a0629b067681ac471a26d11f' - '9fb34396823ab60819456e3430ea15774f8bdfd845a9eeb041f27dea4bc2cdce' - 'adac1cd444eccebab7d49ad8726d0b51bd1a4d60ee19dd64df24296f1cb684df' - '7fabbdbb1ece2d8cdd07c26c54d983046d43b36862bd05304f15974c1b5c33df' - '5e362bb336a3a30dae2efe08f7020604455a1f1a389117b2120392687325b317' - 'd5481a772a2dd6c3db75d46e06491e62023f079c92011e8e98fc46883bee366b' - '56de010c7b70a16643af21cecd9d16dd22164c36f75dc8313841f38ffd43d5d7' - 'c2457ec1a6d3840e0e8ede6906019ac685265505284a999e40ac7d32a446da4a' - 'f7e590d6a3a44a12188e21eae67b4ff636bbc8c933ef9fb1926be7e4f5425ff0' - '60e5b579033463bf864fe539798c2a5182ee7159200c89cf9dede4a9309afb7c' - '64c9d8c2c9d7248b44efbb5df259f80b6c1d7be69708ab48b6a9f8bacf17f962' - '64b2c091d36779c2ab6d58b2fce0f3cf5cde1e8d45a03f946f845b3a38cef366' - '12797782406b293613f73356c27c7007c33c81c653bdf24f10981562ad63c8e3' - 'df7296c5d2fe3699467963d69e3811c813fb0eec17eeb4a27dd4bc09da02c2f2' - '606c3713b5e506e32d8373b6d6351b2b72341cd8ca232b4d95cdcf41152aca3b' - 'c634e36d6a998e17ecf411a750de69958d4149477b085c8e98ebebfc6d015e17' - '48ea3654a79f0b8756907dc657c82c0220fa2a1db663377b2cdb814ce80cb09c' - '9f677bac7da7bee2c85917d2581f9fb66166c2c62b70c38b5c6241f966d4849b' - '49e646ec15a44da1293a7f31c52e03a8c363313706c6b3b16a9489b68698424f' - 'fa1557c21bd8a0944cd35fd12eb9335aa2d40d150edc1573f9eb7135d51d6845' - '9d6dbcc6524fdee59e9d7da6c64ccf2ccd5a48f5c67ea4f1865930af51c4a793' - '2caa194d29a9a4d96015dede8526cfc27d3482307a5b02eb9adb672145a985de' - '4600dab4ca2739d65ee6e09b1d611a1825f0b28fe35c61bf7cd8c0fde2c1f9b2' - '1ada4919e1f4d100ef76f52d20b64f44799b9c1cdf2e9173c169261ed28f8407' - '70b0ae4e680348c92a2b2a34cbe6dd20819f31be4f1e0ef76948191926b6f64f' - '28d86984c7c3b7c190a5ff6d5ec176fa0e2e377093d35d90c44421cd7ad97a8c' - 'd0c815699b211f5bb2590845c391888277557aa22bbfc50ccf4cb9649020255b' - '7e72b5067b5f3d540a0df5d39fb9b5b5f6074063a27a56971204b348042201da' - '8d1d03bb78283830e689911036d390f84c31e291b4470884343194765104e28e' - '18ae3a2c93f238a7dc57d3696d2af7c2c604f9e87b4d3af0307be31333418e53' - '40a81558762e78f0b447ced4dca7c2a12a0921b683057e402d3306f74e45533c' - 'ced7db0fa9e2b5fca949a53c480cd91cce299ddf2e53aceafebd32334801d8a7' - '12ac5e9185a0bbba390be939712118b770836dae48e7566b980427f0cde7398c' - '843e0f0a788c9ccf43b9dd919e0f193f5575bc44182dcf8fcf4c08cd374dc17c' - '673a49a970c5ea9f06285115647f9b329806732effaf671d9247db214c68fde7' - '9f8d753ff92eb9e85c98a736c2d2b352ce57663cc29f12c4e009f00185ed9d44' - 'cec6d88cc7d8a05245808c177a8e2fd2980c18f4afd7804b0f9af69f938524fd' - 'a01811790c1b5baf5883b00782b8173139cc6c05f8dcfc0c3231a2af4aafe99f' - '52edace7e4842e6a0f084acd07a50bc625f9910acb2d33d5c71a32c01b58310b' - '1c9befee6d646288493d7ebab75fce45fff76d8aeac3cee3b0bbde9b9318ff6c' - '15fb7fa6662e3ac07ceb5786dbff4c9763183b79cb4fa44a671c9aa09577e37c' - 'ec2b8a9a42433c05a1ccec3b05fd32e978ec56ea54829fbd8462de77dece599e' - '5f0380d944501089133df335d5728efe2775de861dcdc97439a41c240ef8a2c4' - '0e5a5aab9f743679588dfcbbf322699d8d664c2064fe321df59fc410d73ca5c6' - '4971c88014689b8514414f59806f91fe8c87beffa25669c0e0c6e5263bc75a2c' - 'd44edea30bd4b25a7d0fe226156ae9c286e5c314314300648e7c81e54dead7a5' - '917e340bc3d3232c5ba67a5c120cafb82e3b0846b8034bd6f20ba8ac1fabcaa9' - '71881714a0aa769e2aacc9cae0c7abc754e31379aa72f8d1beecaea90d0dab00' - 'bfc9aab840da24138f2c975b7b36e8f1eb42e538ee27062611cddc15712c6174' - '76608e9472c44db2ac36b5918a03b83fd870fb70931419e9012c2e9d7dbe229d') + 'f22c1a80bdcb52c454f47faecad56a40b3605a0381d12f0d473a4620710dabcb' + 'f8bc3bdf1384ced7ad97ad91fc65851fff355324719e97fc454a95fc6246ecc4' + '6a99c07bd9c80180ea9a49c1ed615a18183ac43b718efdfb067739b989ef8adc' + 'd04a96732cb6c0a464fbf41fc2ccc9fb3ce9154b5aaba5dae654934f265bf1d8' + 'c27cf31cd77f1d213ee856ceb18f25726876d1f445fd03d89a4781ceb79cea4b' + 'b7d942048a0177d7fd2faefc07e8f10b777c4e1398567e0b7479e7eedb1039e6' + 'b808c09ef797e2a563b96fedcb8287daee6ad9fe2846310ecd249db90ba95c33' + 'd9a77f5a395ad0cdb3801a288cb89fa7916cda14c13eca8d86a9cf08b1c44495' + '710f17418bf87c4baf50847501f3ea4cec18b2c1b44b974b22128dbf0158cabc' + '9bd9af1d6e50ec5bf53246aa569791794ab3a4427add8e3bc40b7350e69ccb95' + '0425e6903048c38331f51a1fc3290d702b5afd2994ed7b15185de593cfddb480' + 'af41b629886fb1b9480a49e388560ec523a764b64ea5b6edba1127dbd6877def' + '6d04640831bf33ec9ef281f0ea1dd376dfa1aec3a3d90c6501f4d5624edfa7f2' + '7a2ec8bbd03d4711f510b69603131cbfb5939114b35b45ed6f1c30c8bf22adea' + '9b66a2bdb0b1db363c56597733a4ada2e7618dea5b1956ba7c4e628a8f54210d' + 'c7d33ccfe9eceadce1f97300c75b050ef5e9b2428f86c38bef7bd584ec8c8bd9' + '47ece87a4b839960fdc1e7bdae4dbe872a0605612cb3bea2d15ca16d4e2fdc04' + 'eed52fabd845a1e779482389d53364b2cbbf3640b24b10167d47a6bf941e234e' + 'e8a9d52cf6313b8413f6ce73a8ed239b5e5ee5b40ba79ff7cab236d4a9b539d6' + '4725e877e92765402ef7ff7abba786f548f5f5ab188aa72a0ae3b8a11a414e6a' + '3b3597157c8641d304621261808e122480fd556afbcd2745133fbf28a55a81e1' + 'c8627efa4b3f1540ac32dd721372938f5e9aee386c168b5febba7c9cfa6b5d37' + '86f7be412f4fcb0c8d3c5047dab0ebe80d45996428312b977b8f7f28eb576009' + '5737efd7ed4b53113b3476fae2b3740c46e77944ac80552bc755fc8164830525' + 'ae6d5451ed4fabe2c6a08126bd14116d48e6a541872a83fafbda2a4838fe0b13' + '1eb92279b3fc281ec83763e9787fd1724f2ddf181f5dd7c4848cc7b767e1f5c2' + '040a86936cf639dc7cf6f71f54e8fa8c1efb4863d5988e548b91a6cd75f66517' + 'd798cd592a1c97847204f0b386c8f341fb6129262a7a2a9c6aab8df4145604a7' + '25d18ed0cb6054f812ba0ad81d733479c34dfc08476ce6e7bb2f3d5897f8765d' + 'da1699f28878299ab9e06f1230a569d7c6805b026fe0383de92e92cabec32e02' + 'd69dfe1442f62be1b434f00bf7c7ea4b49cebfbaf706de75d944235089be6b06' + 'fa403feeb0d504c324ab4f4b70c4a33504e1920c96f3e2b7a34ea84f20c401ae' + '650613db80683206e1330354358c25ffadc51218ef192becbea25424c4ff807c' + 'f8d42709a3baf5cf0a3da509f8b085914004879d237b70183a2ba6ddc2882d9a' + 'da878d062d69c3679a4f1e3cb5575574802bab6a8b1299022ee2e6550921d906' + '3cb801db1ecb7a18fddcaf5004797b7ac9976642cf46f33e4cb15a48cf60df9b' + '0f898566e0742efb71225a647e0872c28b0c17c7d5b25f7f5b837b8995dc4126' + '78a786dbaa0f19d19e84d75105af5931092664d0fa63eff0d17cf524bd7274fe' + 'b70796bc242b671b6e2d14e160b3ba4f1f4668834a1717a77f8cbe40cee0e660' + 'e7b7524cbc2fc1e40f0e3eae627353dda7fbeb0419a7f11f4c70d21d65179c58' + 'eeee04e07cb72e066c3d89e0e4cd05b808406869e9be098474cdd0a3f6bd51ac' + 'a0ce2f8e29b6f749e3d9cacb183e654ea0fe99d19912ee20f8742b374c826e5d' + 'acfe1b7fe3c195d8612070dae536113b43fbf21099f79d2fb00b5f2fd041b96f' + '4cabcab7d1e25d54b3d8a9d5f6eb0947ed507d43672587319dccf3bc4bcaae9b' + 'e97ca21326b0424c63807c35146435db4a52eb1f66412daff458169a66ec48fd' + 'f99cc6206b7b0b0f6e8c668463cf5e3064579538b9ad813c36e5f58270e06b2f' + 'fd4a64f3929146430da3cd208f4e3da95b82ba771651d663c4158a707b6fd6f7' + 'ae8341c50aa1f2465a14c6304802a4686a3e4ea9a61d306b8075a6107dffd253' + 'e8f5eed7a5c6396e43420ce87f107af6df400989ccde413e08f7733f9a564f0e' + '0e7562b0028b876430775fd5824380c10a75a92320d4e639a13e588d2c6ab3a3' + '7ea8f9a92f2d687289334ed5f90f2c3e167607f64c97e90aa3251a1a48a6552c' + '890a8fb42cd1db3227b35e4d05dc8d60a4d974b48897e67f2bbb2183fdbe25dd' + '37f86090a32bd394d604557e754318bcffa3bafb1b53f972d12c7196c92bb83a' + '5cf8dacd25c88e446f2cebefef481f33d1d107db1bf99de6e32b65c2c73a2e2f' + '1ed8f081ae5daac427bdd797f7f309a8585015b25db3b93cac6ff8e2f7551107' + '54add6cc94fea89563754095a7263345ef6ab0e0bc72bfe18b293f1f4a94033a' + '83cfd8300ecac2be49faf198a4415a5d1acd2c58cfe1d5adfeea90c6aad47d93' + 'e37c1bbbffde37b5106ff40b908f559458e04c531fc5fd496e6da98e1372a0e0' + '747e249412f270282a9f34bb29a7a8585556e0358acc398b5e2f819329b3343f' + 'd51698aaaef0abb8b4be10e8acc55cd2f5c587f07279c62005e0a89459b64dbb' + '7d788d42cdfe2b69ddd7bcff036ba39172ea8ee29ad5603c1c3b1357ed0111a9' + 'f918c0bd56a4bf2abfa5c3120e8127af268693eb77b5d742db6e309dd29aead0' + 'cfbb97643670e4462627567731e34ea4f6c7e260b220c33ad73b50b899fbfda6' + '88191395b71f62f5b9a8ed769fa16a623d96209e68857f3d3fc5290b85e1f8be' + '17098ea7d5f2df22c974c39754aff4abddcdab36782e55579e18b337766eb352' + '1f599e9fcc0652cba8e474129de0bed17da15f7f4aa5c70aedb2a24653cba87a' + 'd8c8ed10eaee1b1d983c29030089f1cdb0b3a64f1aeacf18efff464e591fe84a' + '96530a3a87834b01f89f27ba2838711d963acf789b6682bc60b45ff65caa89ee' + 'a14ccb49fd266c854c700642bcc90a4145447475b831395c9ba8a2283381cf59' + 'de212dd7b765783615b4b3771a0e2f1f0a6ab8c63e5c92ae93f068c7f7cba5ea' + '352fb2f2a63f668b23f7ba94e46ce76243065cb73011e46df20d87c1ac2476c3' + '2362f6c7c2f2992eb07b4fe4871cca80a85bdfa9319f948e048f1f4e7712c813' + '61326fa22af9f705b4ab5e2986d6d68aac5f443deed37a066fa0f8fd6b61823b' + 'e293a82ec41e3d24cf4a08aa825dcfa415af739acb33fb2dfc6fe91f55ba1b58' + '00033298f9d80cb145aaed0a76097dbbf2ab0c8461d45f6b202411722418dcb0' + 'bf10547c9116006c89683fe9220b49895b5fa4523cd759f216e4c2a148f9aea4' + '9e6be70ad2f3cbfb9a154d1aaff615f143cf82dfdfe431530c900158afb11558' + '601412aa6399e051d8a4ceb4bdac4da70c52d71143325c144f6fd65a4a809f2d' + '4fac23ab8d90aa9648cc211a2f4679d1e777e6667a597ba274e0d4f843ed7c9c' + '52337edf05c18943ef8935fa3c17e8b81a49674e1240801420100f48efe121dd' + '0534c6413b4f494332bd4900c9ef98b38c24384df24cac620687cb179ba1d550' + 'ce45f8aafd941d31904bedd239aa5714edba11e03615492c492bc4b8c6cee4ee' + '7592a55df260db484240e8f233d7fa96ea150dd33f4e761382457c20586aab74' + '7f3f1e75b769b504ca3b75341954172c7c6e3528e7c675347af08f80592eb49d' + '4f9c8a0f15fd2cbd9494f885b6aa816d4594a2b879a260cecd6c41f83e73b3ad' + '911defc021d76bef036931d7c6dc76a8043e1468d647d676fad026dbdb5121e7' + '86c9f4a2856c39cf0c82423a7980738927479c2202bf290f1ddfe7afe03d001d' + 'b341d752f221806bad34d163056d7bf5d92d1cee8e94b947f142cfb7a49443f7' + 'c3f01c6b4d7a61cace77a29a8a5017726a54b24c786dee550f9e54ee2de34a98' + 'd2367d8bdbd104e396ba69ac9462111143d521c91cc2f9458418ab09ad1737e8' + 'c1a545364e105bc9b02247493e33d19c34ed64bcd7bd13a01513a9d270927029' + '4640f683b9a469d1e1e1150e962d4b2122be6769967ffffa78730cd60c3d33c8' + 'e7c2c24e428357028b554987a488e950023b2389daa44b6d318ea4a4b1d707a8' + '18c330571760cb30a525614bf27a18d6ba24d604ce5d3451c68b04a22d9ddbb6' + 'ee90a953107c846a0490a5f223102e003e7ef757af3bf6e07746aa47fbfc0ce3' + '5ed0f33a7baad723c6eff2a496bd2091688d8c5193257d06cca9bcae81667d7b' + '59336186852c77961c82a2a5cb226a4e69824fd2a7db9461c21c4d60c3aae6c5' + 'a030d70aedac7f63e75bac334b1752d2be85f93149dc3582cf5968cc712dd0ef' + '00345500847abe3587df2e8bcca0be89553c47c58551798441913cf42d507935' + 'a2ec1610a1a9169510ef4c69905e9754f646d2d81981617738ca8a1bd8f4c417' + '75f7ae3fb9aa689319c23230dc29b368394d3d92c8241fb9845efcf4cf167ceb') diff --git a/mingw-w64-python/update-patches.sh b/mingw-w64-python/update-patches.sh index c9a5d99f5fca2..4b94d9d4a48eb 100755 --- a/mingw-w64-python/update-patches.sh +++ b/mingw-w64-python/update-patches.sh @@ -8,7 +8,7 @@ die () { } cd "$(dirname "$0")" || -die "Could not cd to mingw-w64-python3.12/" +die "Could not cd to mingw-w64-python3.13/" git rev-parse --verify HEAD >/dev/null && git update-index -q --ignore-submodules --refresh &&