From 95eefb0df0c038677049ddfa09be20cedd24b96f Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Tue, 16 Dec 2025 09:15:44 -0600 Subject: [PATCH 1/9] CPython 3.15.0a2 -> 3.15.0a3 --- pythonbuild/downloads.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 7c2184e6..1d2ec65d 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -93,10 +93,10 @@ "python_tag": "cp314", }, "cpython-3.15": { - "url": "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a2.tar.xz", - "size": 23728836, - "sha256": "d8a0a2f4a7f3d7090cf195e81814efe95f70554955557f40e149d8694a662751", - "version": "3.15.0a2", + "url": "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a3.tar.xz", + "size": 34723712, + "sha256": "6ab02cdac24505779877bb1d9189432d67e90ddf2a9b8b7b373ead54ac07b607", + "version": "3.15.0a3", "licenses": ["Python-2.0", "CNRI-Python"], "license_file": "LICENSE.cpython.txt", "python_tag": "cp315", From e4ac37acd02a843f4f2aa144a48a9b1ce5b5ac21 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Tue, 16 Dec 2025 15:12:42 -0600 Subject: [PATCH 2/9] validate existing extensions-modules.yml Validate all the modules listed in extensions-modules.yml against the schema. Previously, those with digits were not validated. --- pythonbuild/cpython.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pythonbuild/cpython.py b/pythonbuild/cpython.py index bd7213b6..6ff60ab7 100644 --- a/pythonbuild/cpython.py +++ b/pythonbuild/cpython.py @@ -53,6 +53,7 @@ "type": "object", "properties": { "path": {"type": "string"}, + "includes": {"type": "array", "items": {"type": "string"}}, "targets": {"type": "array", "items": {"type": "string"}}, "minimum-python-version": {"type": "string"}, "maximum-python-version": {"type": "string"}, @@ -109,12 +110,20 @@ "type": "object", "properties": { "source": {"type": "string"}, + "sources": {"type": "array", "items": {"type": "string"}}, "targets": {"type": "array", "items": {"type": "string"}}, "minimum-python-version": {"type": "string"}, "maximum-python-version": {"type": "string"}, }, "additionalProperties": False, - "required": ["source"], + "oneOf": [ + { + "required": ["source"], + }, + { + "required": ["sources"], + }, + ], }, }, }, @@ -124,7 +133,7 @@ EXTENSION_MODULES_SCHEMA = { "type": "object", "patternProperties": { - "^[a-z_]+$": EXTENSION_MODULE_SCHEMA, + "^[a-z0-9_]+$": EXTENSION_MODULE_SCHEMA, }, } From bc1ee90c4be827f084e5132b63824c2f086778b2 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Tue, 16 Dec 2025 15:23:47 -0600 Subject: [PATCH 3/9] _remote_debugging module sources are split in 3.15 The _remote_debugging module was split into multiple files in: https://github.com/python/cpython/pull/141934 Update the extensions-modules.yml file to reflect this change. --- cpython-unix/extension-modules.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 1fb0860d..5efc71bb 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -431,8 +431,18 @@ _random: _remote_debugging: minimum-python-version: "3.14" - sources: - - _remote_debugging_module.c + sources-conditional: + - sources: + - _remote_debugging_module.c + maximum-python-version: "3.14" + - sources: + - _remote_debugging/module.c + - _remote_debugging/object_reading.c + - _remote_debugging/code_objects.c + - _remote_debugging/frames.c + - _remote_debugging/threads.c + - _remote_debugging/asyncio.c + minimum-python-version: "3.15" _scproxy: # _scproxy is Apple OS only. From 271ada5c8d8af348cb3ec084772a5e5481690edf Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 11:26:22 -0600 Subject: [PATCH 4/9] update patch-checksharedmods-disable patch for 3.15 --- cpython-unix/build-cpython.sh | 4 +++- .../patch-checksharedmods-disable-3.15.patch | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cpython-unix/patch-checksharedmods-disable-3.15.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 2afeb134..332b5d0d 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -270,7 +270,9 @@ fi # the configure-based module building and replacing it with our # own Setup-derived version completely breaks assumptions in this # script. So leave it off for now... at our own peril. -if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then +if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]; then + patch -p1 -i ${ROOT}/patch-checksharedmods-disable-3.15.patch +elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then patch -p1 -i ${ROOT}/patch-checksharedmods-disable.patch fi diff --git a/cpython-unix/patch-checksharedmods-disable-3.15.patch b/cpython-unix/patch-checksharedmods-disable-3.15.patch new file mode 100644 index 00000000..18952a03 --- /dev/null +++ b/cpython-unix/patch-checksharedmods-disable-3.15.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index a6beb96d12a..bb4e1ecd49b 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1610,7 +1610,7 @@ checksharedmods: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) + else \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py --generate-missing-stdlib-info; \ + fi +- @$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py ++ @echo "module checking disabled" + + .PHONY: rundsymutil + rundsymutil: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) From aa4f32d7c16182c053c332b1491e825cde76d6cc Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 11:27:00 -0600 Subject: [PATCH 5/9] update patch-configure-disable-stdlib-mod patch for 3.15 --- cpython-unix/build-cpython.sh | 9 ++++++- ...ch-configure-disable-stdlib-mod-3.15.patch | 26 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 332b5d0d..d5379540 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -228,7 +228,14 @@ fi # disable the functionality and require our auto-generated Setup.local to provide # everything. if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then - if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]; then + # This sets MODULE__STATE=disabled in the Makefile for all extension + # modules that are not unavailable (n/a) based on the platform. + # Valid STATE variables are needed to create the _missing_stdlib_info.py + # file during the build. + # TODO(jjh): This could likely be done for older Python versions as well. + patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod-3.15.patch + elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod-3.12.patch else patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod.patch diff --git a/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch b/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch new file mode 100644 index 00000000..675c3107 --- /dev/null +++ b/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch @@ -0,0 +1,26 @@ +diff --git a/configure.ac b/configure.ac +index a284a118f02..7e536c41fda 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -7859,11 +7859,7 @@ AC_DEFUN([PY_STDLIB_MOD], [ + m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl + m4_pushdef([modstate], [py_cv_module_$1])dnl + dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() +- AS_IF([test "$modstate" != "n/a"], [ +- AS_IF([m4_ifblank([$2], [true], [$2])], +- [AS_IF([m4_ifblank([$3], [true], [$3])], [modstate=yes], [modstate=missing])], +- [modstate=disabled]) +- ]) ++ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) + _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) + AS_VAR_IF([modstate], [yes], [ + m4_ifblank([$4], [], [_MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_CFLAGS], [$4])]) +@@ -7883,7 +7879,7 @@ AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ + m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl + m4_pushdef([modstate], [py_cv_module_$1])dnl + dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() +- AS_IF([test "$modstate" != "n/a"], [modstate=yes]) ++ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) + AM_CONDITIONAL(modcond, [test "$modstate" = yes]) + _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) + AS_VAR_IF([modstate], [yes], [ From 575d3bf631f329af8b4dbbd472007362c60008b3 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 12:48:07 -0600 Subject: [PATCH 6/9] add missing files to _remote_debugging extension --- cpython-unix/extension-modules.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 5efc71bb..739cf08e 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -440,8 +440,10 @@ _remote_debugging: - _remote_debugging/object_reading.c - _remote_debugging/code_objects.c - _remote_debugging/frames.c + - _remote_debugging/frame_cache.c - _remote_debugging/threads.c - _remote_debugging/asyncio.c + - _remote_debugging/subprocess.c minimum-python-version: "3.15" _scproxy: From 637daad4c1da866108e7518719b34703583255d1 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 12:48:28 -0600 Subject: [PATCH 7/9] include object files from _remote_debugging --- cpython-unix/build-cpython.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index d5379540..a920cfc6 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -1233,7 +1233,7 @@ ${BUILD_PYTHON} ${ROOT}/fix_shebangs.py ${ROOT}/out/python/install # downstream consumers. OBJECT_DIRS="Objects Parser Parser/lexer Parser/pegen Parser/tokenizer Programs Python Python/deepfreeze" OBJECT_DIRS="${OBJECT_DIRS} Modules" -for ext in _blake2 cjkcodecs _ctypes _ctypes/darwin _decimal _expat _hacl _io _multiprocessing _sha3 _sqlite _sre _testinternalcapi _xxtestfuzz _zstd; do +for ext in _blake2 cjkcodecs _ctypes _ctypes/darwin _decimal _expat _hacl _io _multiprocessing _remote_debugging _sha3 _sqlite _sre _testinternalcapi _xxtestfuzz _zstd; do OBJECT_DIRS="${OBJECT_DIRS} Modules/${ext}" done From 84f4887005fc1e1b708ba40c2383ed5d28346f7c Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 12:52:57 -0600 Subject: [PATCH 8/9] patch-dont-clear-runshared un-needed in 3.15 --- cpython-unix/build-cpython.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index a920cfc6..e0335b2e 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -96,7 +96,8 @@ fi # TODO this may not be needed after removing support for i686 builds. But it # may still be useful since CPython's definition of cross-compiling has historically # been very liberal and kicks in when it arguably shouldn't. -if [ -n "${CROSS_COMPILING}" ]; then +# Merged upstream in Python 3.15, https://github.com/python/cpython/pull/141958 +if [[ -n "${CROSS_COMPILING}" && -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_14}" ]]; then if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" ]; then patch -p1 -i ${ROOT}/patch-dont-clear-runshared-14.patch elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then From cf3d8bac366119cf538a813218902407864373b4 Mon Sep 17 00:00:00 2001 From: Jonathan Helmus Date: Wed, 17 Dec 2025 13:32:34 -0600 Subject: [PATCH 9/9] merge patch-configuration-disable-stdlib-mod patches Use the 3.15 patch for all CPython versions >=3.12. --- cpython-unix/build-cpython.sh | 7 ++--- ...ch-configure-disable-stdlib-mod-3.12.patch | 22 +++++++--------- ...ch-configure-disable-stdlib-mod-3.15.patch | 26 ------------------- 3 files changed, 11 insertions(+), 44 deletions(-) delete mode 100644 cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index e0335b2e..518d690c 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -229,14 +229,11 @@ fi # disable the functionality and require our auto-generated Setup.local to provide # everything. if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then - if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then # This sets MODULE__STATE=disabled in the Makefile for all extension # modules that are not unavailable (n/a) based on the platform. # Valid STATE variables are needed to create the _missing_stdlib_info.py - # file during the build. - # TODO(jjh): This could likely be done for older Python versions as well. - patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod-3.15.patch - elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then + # file during the build in Python 3.15+ patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod-3.12.patch else patch -p1 -i ${ROOT}/patch-configure-disable-stdlib-mod.patch diff --git a/cpython-unix/patch-configure-disable-stdlib-mod-3.12.patch b/cpython-unix/patch-configure-disable-stdlib-mod-3.12.patch index 3f0266ea..675c3107 100644 --- a/cpython-unix/patch-configure-disable-stdlib-mod-3.12.patch +++ b/cpython-unix/patch-configure-disable-stdlib-mod-3.12.patch @@ -1,30 +1,26 @@ diff --git a/configure.ac b/configure.ac -index ba768aea93..031d5c897f 100644 +index a284a118f02..7e536c41fda 100644 --- a/configure.ac +++ b/configure.ac -@@ -7288,13 +7288,7 @@ dnl sets MODULE_$NAME_CFLAGS and MODULE_$NAME_LDFLAGS - AC_DEFUN([PY_STDLIB_MOD], [ - AC_MSG_CHECKING([for stdlib extension module $1]) +@@ -7859,11 +7859,7 @@ AC_DEFUN([PY_STDLIB_MOD], [ m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl -- m4_pushdef([modstate], [py_cv_module_$1])dnl -- dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() + m4_pushdef([modstate], [py_cv_module_$1])dnl + dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() - AS_IF([test "$modstate" != "n/a"], [ - AS_IF([m4_ifblank([$2], [true], [$2])], - [AS_IF([m4_ifblank([$3], [true], [$3])], [modstate=yes], [modstate=missing])], - [modstate=disabled]) - ]) -+ m4_pushdef([modstate], [disabled])dnl ++ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) AS_VAR_IF([modstate], [yes], [ m4_ifblank([$4], [], [_MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_CFLAGS], [$4])]) -@@ -7312,9 +7306,7 @@ dnl PY_STDLIB_MOD_SIMPLE([NAME], [CFLAGS], [LDFLAGS]) - dnl cflags and ldflags are optional - AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ +@@ -7883,7 +7879,7 @@ AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl -- m4_pushdef([modstate], [py_cv_module_$1])dnl -- dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() + m4_pushdef([modstate], [py_cv_module_$1])dnl + dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() - AS_IF([test "$modstate" != "n/a"], [modstate=yes]) -+ m4_pushdef([modstate], [disabled])dnl ++ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) AM_CONDITIONAL(modcond, [test "$modstate" = yes]) _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) AS_VAR_IF([modstate], [yes], [ diff --git a/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch b/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch deleted file mode 100644 index 675c3107..00000000 --- a/cpython-unix/patch-configure-disable-stdlib-mod-3.15.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index a284a118f02..7e536c41fda 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -7859,11 +7859,7 @@ AC_DEFUN([PY_STDLIB_MOD], [ - m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl - m4_pushdef([modstate], [py_cv_module_$1])dnl - dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() -- AS_IF([test "$modstate" != "n/a"], [ -- AS_IF([m4_ifblank([$2], [true], [$2])], -- [AS_IF([m4_ifblank([$3], [true], [$3])], [modstate=yes], [modstate=missing])], -- [modstate=disabled]) -- ]) -+ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) - _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) - AS_VAR_IF([modstate], [yes], [ - m4_ifblank([$4], [], [_MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_CFLAGS], [$4])]) -@@ -7883,7 +7879,7 @@ AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ - m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl - m4_pushdef([modstate], [py_cv_module_$1])dnl - dnl Check if module has been disabled by PY_STDLIB_MOD_SET_NA() -- AS_IF([test "$modstate" != "n/a"], [modstate=yes]) -+ AS_IF([test "$modstate" != "n/a"], [modstate=disabled]) - AM_CONDITIONAL(modcond, [test "$modstate" = yes]) - _MODULE_BLOCK_ADD(modcond[_STATE], [$modstate]) - AS_VAR_IF([modstate], [yes], [