pip has recently started to compare wheel tags with system supported wheel tags, and as it turns out build tools just use sysconfig.get_platform() to generate a tag (in setuptools, wheel, packaging, etc) for non-official platforms. For official platforms they do various normalization steps and use other sources. Since we can't really patch all those packages we need to provide a platform string that wont change between updates. * Don't include the cygwin version in it anymore, since that can change on updates. * Hardcode to "cygwin" since builing for cygwin can change the output of os.uname() The later breaks detection of MSYS2 compared to cygwin, but ideally no one should depend on it, and we want to get rid of the differences there anyway. Fixes #5143
69 lines
2.9 KiB
Diff
69 lines
2.9 KiB
Diff
--- Python-3.8.7.cygwin/configure.ac 2021-05-11 21:07:52.839122100 +0200
|
|
+++ Python-3.8.7/configure.ac 2021-05-11 21:10:48.366063600 +0200
|
|
@@ -1137,7 +1148,7 @@
|
|
case $ac_sys_system in
|
|
CYGWIN*)
|
|
LDLIBRARY='libpython$(LDVERSION).dll.a'
|
|
- DLLLIBRARY='libpython$(LDVERSION).dll'
|
|
+ DLLLIBRARY='msys-python$(LDVERSION).dll'
|
|
;;
|
|
SunOS*)
|
|
LDLIBRARY='libpython$(LDVERSION).so'
|
|
--- Python-3.8.7.orig/Lib/ctypes/__init__.py 2020-12-21 17:25:24.000000000 +0100
|
|
+++ Python-3.8.7/Lib/ctypes/__init__.py 2021-05-11 22:26:25.866873900 +0200
|
|
@@ -456,7 +456,7 @@
|
|
if _os.name == "nt":
|
|
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
|
|
elif _sys.platform == "cygwin":
|
|
- pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
|
|
+ pythonapi = PyDLL("msys-python%d.%d.dll" % _sys.version_info[:2])
|
|
else:
|
|
pythonapi = PyDLL(None)
|
|
|
|
--- Python-3.12.4/Lib/test/test_ctypes/test_loading.py.orig 2024-06-06 20:26:44.000000000 +0200
|
|
+++ Python-3.12.4/Lib/test/test_ctypes/test_loading.py 2024-07-04 07:35:25.827763700 +0200
|
|
@@ -16,7 +16,7 @@
|
|
if os.name == "nt":
|
|
libc_name = find_library("c")
|
|
elif sys.platform == "cygwin":
|
|
- libc_name = "cygwin1.dll"
|
|
+ libc_name = "msys-2.0.dll"
|
|
else:
|
|
libc_name = find_library("c")
|
|
|
|
--- Python-3.8.7/Lib/ctypes/util.py.orig 2021-05-11 22:31:37.409285900 +0200
|
|
+++ Python-3.8.7/Lib/ctypes/util.py 2021-05-11 22:33:22.371550100 +0200
|
|
@@ -387,8 +387,8 @@
|
|
print(f"crypto\t:: {find_library('crypto')}")
|
|
print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
|
|
elif sys.platform == "cygwin":
|
|
- print(cdll.LoadLibrary("cygbz2-1.dll"))
|
|
- print(cdll.LoadLibrary("cygcrypt-0.dll"))
|
|
+ print(cdll.LoadLibrary("msys-bz2-1.dll"))
|
|
+ print(cdll.LoadLibrary("msys-crypt-0.dll"))
|
|
print(find_library("crypt"))
|
|
else:
|
|
print(cdll.LoadLibrary("libm.so"))
|
|
--- Python-3.12.8/Lib/sysconfig.py.orig 2024-12-03 19:42:41.000000000 +0100
|
|
+++ Python-3.12.8/Lib/sysconfig.py 2025-01-24 20:14:10.834146500 +0100
|
|
@@ -815,13 +815,13 @@
|
|
elif osname[:3] == "aix":
|
|
from _aix_support import aix_platform
|
|
return aix_platform()
|
|
- elif osname[:6] == "cygwin":
|
|
+ elif osname[:6] == "cygwin" or osname[:4] == "msys":
|
|
+ # https://github.com/msys2/MSYS2-packages/issues/5143
|
|
+ # Various build tools use the platform to derive the wheel tag
|
|
+ # and the wheel tag needs to be stable for a specific platform
|
|
+ # so we can't include a version here.
|
|
osname = "cygwin"
|
|
- import re
|
|
- rel_re = re.compile(r'[\d.]+')
|
|
- m = rel_re.match(release)
|
|
- if m:
|
|
- release = m.group()
|
|
+ return f"{osname}-{machine}"
|
|
elif osname[:6] == "darwin":
|
|
import _osx_support
|
|
osname, release, machine = _osx_support.get_platform_osx(
|