Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -229,6 +230,10 @@ fi
# everything.
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then
# This sets MODULE_<NAME>_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 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
Expand Down Expand Up @@ -270,7 +275,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

Expand Down Expand Up @@ -1224,7 +1231,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

Expand Down
16 changes: 14 additions & 2 deletions cpython-unix/extension-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,20 @@ _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/frame_cache.c
- _remote_debugging/threads.c
- _remote_debugging/asyncio.c
- _remote_debugging/subprocess.c
minimum-python-version: "3.15"

_scproxy:
# _scproxy is Apple OS only.
Expand Down
13 changes: 13 additions & 0 deletions cpython-unix/patch-checksharedmods-disable-3.15.patch
Original file line number Diff line number Diff line change
@@ -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)
22 changes: 9 additions & 13 deletions cpython-unix/patch-configure-disable-stdlib-mod-3.12.patch
Original file line number Diff line number Diff line change
@@ -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], [
13 changes: 11 additions & 2 deletions pythonbuild/cpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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"],
},
],
},
},
},
Expand All @@ -124,7 +133,7 @@
EXTENSION_MODULES_SCHEMA = {
"type": "object",
"patternProperties": {
"^[a-z_]+$": EXTENSION_MODULE_SCHEMA,
"^[a-z0-9_]+$": EXTENSION_MODULE_SCHEMA,
},
}

Expand Down
8 changes: 4 additions & 4 deletions pythonbuild/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading