python3.13: patch sync (#25521)

This commit is contained in:
Christoph Reiter 2025-09-14 11:03:52 +02:00 committed by GitHub
parent 15aa5ed06c
commit 9314e76d93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 206 additions and 4 deletions

View File

@ -0,0 +1,25 @@
From f50419ac79ae94969e43d5bd1c6eb2ed63767099 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 11 Sep 2025 18:10:59 +0200
Subject: [PATCH 177/N] Work around broken pc file
https://github.com/python/cpython/issues/138800
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac
index 4745388..62a9dcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6748,6 +6748,10 @@ 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")
fi
# On iOS the shared libraries must be linked with the Python framework

View File

@ -0,0 +1,41 @@
From c6263a43cc719a507632c005a75fe065c5c0501d Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 13 Sep 2025 15:27:31 +0200
Subject: [PATCH 178/N] restore versioned launchers in venv + cleanup
---
Lib/venv/__init__.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 79a5fdf..e85c1e1 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 and not 'mingw' in sys.version.lower():
+ if self.symlinks and not sys._is_mingw:
do_copies = False
# For symlinking, we need all the DLLs to be available alongside
# the executables.
@@ -437,7 +447,6 @@ 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)

View File

@ -0,0 +1,19 @@
From 631f439a474a5ef20bc0bdf91a305589cac091db Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 13 Sep 2025 15:59:04 +0200
Subject: [PATCH 179/N] tests: try to skip differently
---
mingw_ignorefile.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mingw_ignorefile.txt b/mingw_ignorefile.txt
index 163ead1..30d126e 100644
--- a/mingw_ignorefile.txt
+++ b/mingw_ignorefile.txt
@@ -50,4 +50,4 @@ 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
+test.test_multiprocessing_spawn.test_manager.WithManagerTestMyManager.*

View File

@ -0,0 +1,52 @@
From 367e3543d3d6310051adc9cf8a43f0eb4f437566 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 13 Sep 2025 17:55:15 +0200
Subject: [PATCH 180/N] soabi fixes
---
configure.ac | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 62a9dcd..2cc8b0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6705,7 +6705,7 @@ AC_MSG_CHECKING([ABIFLAGS])
AC_MSG_RESULT([$ABIFLAGS])
AC_MSG_CHECKING([SOABI])
case $host_os in
- mingw*) SOABI='cp'`echo $VERSION | tr -d .`;;
+ 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])
@@ -6716,7 +6716,7 @@ if test "$Py_DEBUG" = 'true'; then
# Similar to SOABI but remove "d" flag from ABIFLAGS
AC_SUBST([ALT_SOABI])
case $host_os in
- mingw*) ALT_SOABI='cp'`echo $VERSION | tr -d .`;;
+ 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}"],
@@ -6724,12 +6724,15 @@ if test "$Py_DEBUG" = 'true'; then
fi
AC_SUBST([EXT_SUFFIX])
-VERSION_NO_DOTS=$(echo $LDVERSION | tr -d .)
-if test -n "${PYD_PLATFORM_TAG}"; then
- EXT_SUFFIX="${ABIFLAGS}.cp${VERSION_NO_DOTS}-${PYD_PLATFORM_TAG}${SHLIB_SUFFIX}"
-else
- 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)'

View File

@ -0,0 +1,26 @@
From f12c612b07fc35e693d704b28011e6b6934bbb28 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 13 Sep 2025 17:59:54 +0200
Subject: [PATCH 181/N] smoketests: add test for soabi fix
---
mingw_smoketests.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mingw_smoketests.py b/mingw_smoketests.py
index 18db3b5..3e6533a 100644
--- a/mingw_smoketests.py
+++ b/mingw_smoketests.py
@@ -221,9 +221,11 @@ class Tests(unittest.TestCase):
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("cp" + f'{sys.version_info.major}{sys.version_info.minor}'))
+ 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")

View File

@ -0,0 +1,21 @@
From b649b8523923260b8a733f829df649ec94a69cf4 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sun, 14 Sep 2025 10:09:11 +0200
Subject: [PATCH 182/N] install versioned pythonw
---
Makefile.pre.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index a87606e..7cbedbe 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -2254,6 +2254,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(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); \
else \

View File

@ -23,7 +23,7 @@ else
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
fi
pkgver=${_pybasever}.7
pkgrel=2
pkgrel=3
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
@ -232,7 +232,13 @@ source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz
0173-Try-fix-64-bit-time-support-for-32-bit-build-again.patch
0174-Do-ne-sys-module-flags-underscored.patch
0175-Fix-new-variable-name-using.patch
0176-Add-test-that-fail-time-to-time.patch)
0176-Add-test-that-fail-time-to-time.patch
0177-Work-around-broken-pc-file.patch
0178-restore-versioned-launchers-in-venv-cleanup.patch
0179-tests-try-to-skip-differently.patch
0180-soabi-fixes.patch
0181-smoketests-add-test-for-soabi-fix.patch
0182-install-versioned-pythonw.patch)
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
@ -421,7 +427,13 @@ prepare() {
0173-Try-fix-64-bit-time-support-for-32-bit-build-again.patch \
0174-Do-ne-sys-module-flags-underscored.patch \
0175-Fix-new-variable-name-using.patch \
0176-Add-test-that-fail-time-to-time.patch
0176-Add-test-that-fail-time-to-time.patch \
0177-Work-around-broken-pc-file.patch \
0178-restore-versioned-launchers-in-venv-cleanup.patch \
0179-tests-try-to-skip-differently.patch \
0180-soabi-fixes.patch \
0181-smoketests-add-test-for-soabi-fix.patch \
0182-install-versioned-pythonw.patch
autoreconf -vfi
}
@ -702,4 +714,10 @@ sha256sums=('5462f9099dfd30e238def83c71d91897d8caa5ff6ebc7a50f14d4802cdaaa79a'
'125d7ff9f40bb002af657be94075aad9baf07d0e76882c401f18ebc6a67b313c'
'4f47b2b045c8dbcbc104b2be46026c5264a56f63359dc488c159c06438f080ae'
'ae382a101cd938d4a238e39b54516f04fc89c40fb36f5316a185a947ec00fbbe'
'3192e4b3db5d382245ae6af07d46e8395ce6586755ca0ca06a63d0bc8ca3c436')
'3192e4b3db5d382245ae6af07d46e8395ce6586755ca0ca06a63d0bc8ca3c436'
'5ab7b2b056b86e269a1a954c72dbd88c4faaa35fda4d1fd6efc6d63d5557cd36'
'219eb248f0ad08b2843488b1d7e2752c77c4cad49c35750aa92d388d80f36a29'
'4e844d076a23dcba9ececf221ed6ed01e8e7edaf17630022186df235ded25236'
'2640e5776300b28a31385d38cfff6a3170cafdac0ead7938bf5582c02cee602f'
'54652e002b9be4ad212fd5dbcac8a1eae9ad86467aaa0fbaf60981697669b14e'
'73724ba0227f868ea6907978bc7bd204814311a2ede7ad0ce6ae3d2cbedc6fd0')