Skip to content

Update to v3.14.4#208

Merged
lazka merged 106 commits into
mingw-v3.14.4from
wip/mingw-v3.14.4
Apr 11, 2026
Merged

Update to v3.14.4#208
lazka merged 106 commits into
mingw-v3.14.4from
wip/mingw-v3.14.4

Conversation

@lazka
Copy link
Copy Markdown
Member

@lazka lazka commented Apr 10, 2026

range diff:

Details
  1:  a267a7db9ff =   1:  6685cd49b10 build: add --with-nt-threads and make it default on mingw
  2:  10b7fcf1ddd =   2:  f1f479d211a build: Define `MS_WINDOWS` (and others) when compiling with MINGW
  3:  2a22de43704 =   3:  e7aa3d69aeb sysmodule: Implement flags "_is_mingw", "is_mingw_ucrt" and "_use_alt_sep"
  4:  22541a06289 =   4:  129b0041798 configure: add `MACHDEP` and `platform` on MINGW
  5:  f1b9a685b54 =   5:  ded60bdad5e build: Add default cross configuration for MINGW
  6:  71ba4c3fc71 =   6:  0ccdf30b011 configure: enable largefile support by default for Mingw
  7:  12f22783e58 =   7:  0b172b5b719 build: Add `PC/` to `CPPFLAGS` and to `SRCDIRS` on Mingw
  8:  9135c03adcc =   8:  bf5da35d125 build: add MINGW support for posixmodule
  9:  0274f8301c6 =   9:  97c8910c37d exports.h: Add support for MINGW
 10:  1f203e1ef6e =  10:  f7b105face7 configure: add options so that shared build is possible on MINGW
 11:  b008a49a555 =  11:  aacd343ba82 build: Add PYD_PLATFORM_TAG
 12:  4a9b59224fb =  12:  0e25866ff85 build: Add dynload_win support for MinGW
 13:  82ba8f1ba5f =  13:  8c0f66c7195 build: Use .pyd extension suffix + fix import lib install location
 14:  94f7d65df7f =  14:  2a3451ada8f build: Configure SOABI and EXT_SUFFIX for MINGW
 15:  b69b01b586f =  15:  ea16fa89656 build: Define MS_DLL_ID for sys.winver on MINGW
 16:  58d665820f3 =  16:  519a83746f2 build: Ignore main program for frozen scripts on MINGW
 17:  28596083f9a =  17:  d7946b664d6 socketmodule: add MINGW support
 18:  710a544ddbb =  18:  e5d209f8e88 build: enable winreg, msvcrt, _winapi, winsound and _overlapped modules
 19:  4b3529befd8 =  19:  28afc958830 sysconfig: make _sysconfigdata.py relocatable
 20:  98199f907ff =  20:  c2ef066df8a sysconfig: treat MINGW builds as POSIX builds
 21:  5acc8893ccd =  21:  d1dd4699d90 sysconfig: Change the `get_platform()` method in sysconfig
 22:  3214227859a =  22:  abf0ac3b976 build: semi native build sysconfig
 23:  44d96a11e65 =  23:  9f5ea034a83 ctypes: Add support for stdcall without underscore
 24:  afceb943905 =  24:  976470d812b ctypes: add suppor for ctypes.pythonapi under MINGW
 25:  1c74201fa98 =  25:  e096c431bd2 ctypes: find_library('c') should return None with ucrt
 26:  57b324e02a0 =  26:  3db8e01f9aa site: Customize for MINGW
 27:  503286dbaef =  27:  129e69f0b0f site: Change user site-packages path to include the environment info
 28:  9aed4f27db6 =  28:  40178f07c7e python-config: output Windows paths for the shell variant
 29:  40b7746efde =  29:  21c0ea4d101 python-config: use the Python variant of python-config
 30:  cfa3915eb24 =  30:  d912118d05f mingw: prefer unix sep if MSYSTEM environment variable
 31:  5a1e3e8b51a =  31:  0d7e47cba87 build: Remove MAXPATHLEN default
 32:  ad515ef705c =  32:  0e6c7b080f7 build: dont link with gettext
 33:  7a4fb0b0f8b =  33:  3de6138ae96 use gnu_printf in format
 34:  e9c9da64d54 =  34:  6eba1d48245 build: remove usage of MS_COREDLL
 35:  c76ca0da552 !  35:  08769017aa6 getcompiler: expose MINGW toolchain related information
    @@ Python/getcompiler.c
     +#endif
     +
     +#if defined(__clang__)
    ++#define CLANG_VERSION_STRING Py_STRINGIFY(__clang_major__) "." Py_STRINGIFY(__clang_minor__) "." Py_STRINGIFY(__clang_patchlevel__)
     +#  if defined(_UCRT)
     +// Some code checks for "GCC" in the compiler string, so we include it here.
    -+#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang UCRT " __clang_version__ ARCH_SUFFIX " (GCC)]"
    ++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang UCRT " CLANG_VERSION_STRING ARCH_SUFFIX " (GCC)]"
     +#  else
    -+#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang " __clang_version__ ARCH_SUFFIX " (GCC)]"
    ++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang " CLANG_VERSION_STRING ARCH_SUFFIX " (GCC)]"
     +#  endif
     +#else
     +#  if defined(_UCRT)
 36:  da3915d69f2 =  36:  a3361cf2e6e build: fix signal module build
 37:  a8bde8d2430 =  37:  0f5887f9ff7 build: build winconsoleio and _testconsole
 38:  52562dc9f09 =  38:  903b2b1923c multiprocessing: expose sem_unlink to fix multiprocessing.Queue
 39:  c365c7e55de =  39:  dc8b61f3b1f build: link win resource files and build pythonw
 40:  fbc4775fdd2 =  40:  f7a918288b3 pycore_fileutils: add MINGW support
 41:  81fee289e9b =  41:  a3f187ff4f2 configure: fix inet_pton check
 42:  c4ddff86059 =  42:  1c748b32c35 importlib: bootstrap path sep
 43:  1318287fd16 =  43:  040e717c92c configure: set MINGW stack reserve
 44:  e1b6cecb4e7 =  44:  f6b98d23ead tests: fix test_bytes
 45:  edc5d0ac8b0 =  45:  9b5d4fab66a timemodule: add MINGW support
 46:  c364df6628e =  46:  fffaf0db61a configure: Disable checks for dlopen/dlfcn
 47:  d3598e0ee31 =  47:  068283b4f96 venvlauncher: Build venvlauncher.exe from PC/launcher.c
 48:  7c5212a5e12 =  48:  25bb7be1e93 venvlauncher: try looking for the versioned .exe first and then fall back
 49:  0fb5deb81af =  49:  76bb577e9c2 venvlauncher: Skip find python in Registry for mingw builds
 50:  5994ed99a32 =  50:  63b0a302f5a configure: don't check for clock_ functions
 51:  48b49059f17 !  51:  b24e64690da CI: test the build and add some mingw specific tests
    @@ .github/workflows/mingw.yml (new)
     +            ${{ matrix.prefix }}-libffi
     +            ${{ matrix.prefix }}-mpdecimal
     +            ${{ matrix.prefix }}-ncurses
    ++            ${{ matrix.prefix }}-readline
     +            ${{ matrix.prefix }}-openssl
     +            ${{ matrix.prefix }}-sqlite3
     +            ${{ matrix.prefix }}-tcl
 52:  3e4dc640e91 =  52:  62e1e490e77 configure: Default to --without-c-locale-coercion on Windows
 53:  bb92eb7d40a =  53:  dd3a490220b tests: Fix some failing tests
 54:  b34fbfd45ab =  54:  4c2c82ebbf1 build: def VPATH when compiling `Python/sysmodule.c`
 55:  02e167001e6 =  55:  a9c7ebdb10d configure: correctly find native python
 56:  42be80e6036 =  56:  a88ebac0dcf build: Add extra flags for `_bootstrap_python`
 57:  3f5f8b7ff50 =  57:  86fe49a36c7 getpath: add support for mingw
 58:  c8af69035f7 =  58:  755a55247ae build: Don't build _posixsubprocess on Windows.
 59:  2595cbf32d9 =  59:  a6c9c95d9cd ssl module: add MINGW support
 60:  09985af46ba =  60:  a4786481cab configure: Include `winsock.h` when checking for netdb function
 61:  c1cbf6b667a =  61:  42926e3068c configure: always build _multiprocessing on Windows
 62:  de39097b2a8 =  62:  d7a7bd8e5e7 configure: build `mmap` module on win32
 63:  e3128f1414d =  63:  9b315c57d76 configure: set BUILDEXEEXT and EXEEXT
 64:  86d511bd371 =  64:  6eb9762d9aa configure: fix building some test modules
 65:  a21432d01a7 =  65:  29059231661 Always convert `/` to `\\` before passing though pathcch functions
 66:  8e36efb6ba7 =  66:  075c0b49412 pylifecycle.h: remove conflicting  _Py_CheckPython3 declaration
 67:  094498e47cc =  67:  6ae609fe567 dynload_win: add env var for reverting the legacy DLL loading paths
 68:  42061d53fc5 =  68:  9d110eb3233 dynload_win: Port GetPythonImport() to MINGW
 69:  422a89b79c8 =  69:  b5bdf5b7ad9 dynload_win: make sure to only use backslashes for paths with LoadLibraryExW
 70:  28667751838 =  70:  a9aa7a88400 dynload_win: don't run _Py_CheckPython3 for MINGW builds
 71:  86ca35dfa0e !  71:  895662ed099 build: Build and install libpython3.dll (stable ABI)
    @@ Makefile.pre.in: $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) pyth
     +
      # wasm32-emscripten browser web example
      
    - EMSCRIPTEN_DIR=$(srcdir)/Tools/wasm/emscripten
    + EMSCRIPTEN_DIR=$(srcdir)/Platforms/emscripten
     @@ Makefile.pre.in: altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
      		if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
      			if test -n "$(DLLLIBRARY)" ; then \
 72:  969bafa9047 =  72:  38cc494bd28 configure: define _DEBUG for a debug build
 73:  6140036e391 =  73:  e42096084cd configure: fix multiprocessing module
 74:  7f8b944b25b =  74:  054693ddb07 build: add MINGW support for selectmodule
 75:  a8f5a415086 =  75:  39bd3b9aa95 configure: disable various modules on MINGW
 76:  9aff3d3994c =  76:  02fbebbca7a configure: Add libraries to fix ctypes on MINGW
 77:  852125b026b =  77:  683cb5b62bc configure: Enable `_uuid` on MINGW
 78:  3b5b43e0ba8 =  78:  f0f8e8ccc29 configure: make `incompatible-pointer-types` a warning
 79:  f44a748eb86 =  79:  ae65d5bb519 tests: test_makefile: normalize path
 80:  4efb5bdd649 =  80:  03c78636ecf Fix include naming for cross build
 81:  399d6d3a22f =  81:  e3ba7b4aede Fix format warning
 82:  a8b2b4ea621 =  82:  4a4285669ae Fix pragma warnings
 83:  dabc7a478d9 =  83:  201956a9160 math, pyhash: MINGW support
 84:  7d11c776693 =  84:  22790586bd9 tests: Fix test for library name
 85:  f974ea13577 =  85:  d6625c54aab dictobject: MINGW support
 86:  468a1841a6b =  86:  d6a5534349d build: Fix export Py_GetBuildInfo symbol
 87:  36b01038764 =  87:  0d469027277 build: Allow profile tests failure
 88:  9742207e74b =  88:  26d4a70e2ce build: add support for building C++ modules.
 89:  d427895dc56 =  89:  af7ce0daa97 build: build/fix the wmi module
 90:  84a6614d71d =  90:  0f7c9fb6076 Fix exports for _suggestions module
 91:  d2487fb2285 =  91:  1f712c7fa48 compileall: Normalize paths
 92:  166eb5cc8cb =  92:  8868fca1bd5 configure: enable 64-bit time support for 32-bit build
 93:  ebab059dae2 =  93:  b853df602fa configure: Work around broken pc file
 94:  3b03e5dc7d7 =  94:  bc4e944e162 makesetup: make sure a library path is passed when building modules
 95:  5e1eeaef890 =  95:  90df2b487de venv: also install the versioned launchers
 96:  d48b519707e =  96:  835fa2e17ac configure: set _WIN32_WINNT version
 97:  2ba51b2e9bd =  97:  92be3ec4eae tests: fix sysconfig.test_get_platform
 98:  5d898ed6929 =  98:  1d43ef7d987 pycore_time: fix missing timeval
 99:  0e9b3bd3a73 =  99:  72e9e7f8290 mmapmodule: define DONT_USE_SEH
100:  8815d8bdc76 = 100:  297d36b966c build: Add ABIFLAGS to targets when needed
101:  f906082c0bc = 101:  129d0719a07 sysconfig: patch nt schemes again
102:  5f9464ea9eb = 102:  e6255eb47cf configure: define _PYTHREAD_NAME_MAXLEN for MINGW
103:  a118f6d4bfc = 103:  a592f9e3886 configure: allow older autoconf
104:  0d1dc78aa4b = 104:  de133ae5c7a tests: allow sys.abiflags to exist
105:  3cadc018786 = 105:  834f2f792f4 configure: fix AC_PATH_TOOL usage
106:  ec874b9ce89 = 106:  38b01eb98ad makesetup: make sure to link the built libpython
  • readline no longer gets pulled in, so add it
  • __clang_version__ now includes a URL and git info, which overflows the version buffer, so build the version string manually

Alexpux and others added 30 commits April 10, 2026 15:54
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
This is used throughout the Python code but is not defined
when compiling with Mingw-w64 compilers, so define it.
In MSVC these are defined in PC/pyconfig.h, we have to
define it manually because pyconfig.h is created by
autotools.

Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Largefile is supported on Windows.

Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Also, build `nt` module instead of `posix` when compiling
with MINGW.

Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Add PYD_PLATFORM_TAG to distinguish C extensions built with different
MinGW toolchain configurations. The tag follows the format:
  mingw_<cpu_arch>_<c_runtime>_<toolchain>

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 <[email protected]>
Try to match the format defined in pycore_importdl.h for Windows
MS_DLL_ID is used for sys.winver and Windows registry keys
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: lovetox <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
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 <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
This is the case used in MINGW

Co-authored-by: Алексей <[email protected]>
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Just like with MSVC. This fixes a test in test_ctypes.
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
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-<platform tag here>`, for example, in
CLANG64 this would be `~/.local/lib/python3.12-mingw_x86_64_ucrt_llvm`.

Fixes #40
Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
so there is no bash required to run it on Windows
os needs ntpath.sep, so define it before importing os

Co-authored-by: Алексей <[email protected]>
Co-authored-by: Christoph Reiter <[email protected]>
Co-authored-by: cat <[email protected]>
Co-authored-by: Naveen M K <[email protected]>
Alexpux and others added 23 commits April 10, 2026 21:20
Invalid "Libs:" value

Also it contains "-L." which is only used at build time by
makesetup and shouldn't be exposed.

python#138800
This is fallout from LIBPYTHON not inluding -L. anymore
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.
copy the logic from callproc.c
So we get different names for debug and free threaded builds
setuptools doesn't play along
value copied from the MSVC build config
We require autoreconf to run for the build, and we use
Ubuntu 24.04 for llvm which only ships 2.71. It looks like there
wasno real reason for upstream to require it, so this should be fine.
it's tied to the build system used and not Windows,
and it's used in various places we use such as python-config,
so improve the condition.
It passing "notfound" as the path parameter and not
as the fallback, so this never could have worked
with cross compiling.

Fixes CXX being set to "g++" instead of the cross compiler.

Should be upstreamed.
dependency libs might add system search paths first, so
make sure we link to libpython before that.
Otherwise we link to the system libpython if it already exists.
@lazka lazka force-pushed the wip/mingw-v3.14.4 branch from b2d941b to 38b01eb Compare April 10, 2026 19:21
@lazka lazka marked this pull request as ready for review April 10, 2026 19:22
@lazka lazka merged commit 38b01eb into mingw-v3.14.4 Apr 11, 2026
28 checks passed
@lazka lazka deleted the wip/mingw-v3.14.4 branch April 11, 2026 05:56
lazka added a commit to lazka/MINGW-packages that referenced this pull request Apr 11, 2026
lazka added a commit to msys2/MINGW-packages that referenced this pull request Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants