-
Notifications
You must be signed in to change notification settings - Fork 152
Add support for building Python 3.12x #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jcfr
merged 4 commits into
python-cmake-buildsystem:master
from
jcfr:add-python-3.12-support
Jun 2, 2025
Merged
Add support for building Python 3.12x #398
jcfr
merged 4 commits into
python-cmake-buildsystem:master
from
jcfr:add-python-3.12-support
Jun 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3cc9a3b
to
2b7b380
Compare
@jcfr I see the CI is all green. Do you additional ad-hoc testing to see if some feature is missing or not working? Or with the green CI does that mean the Python 3.12 work is completed as well? |
I was looking at some of the test failures before moving forward with the integration. |
Ah I see the test failures are happening, but not failing the CI. |
87c20ec
to
a383fd2
Compare
* Add checksums for Python 3.12.0 to 3.12.10 * Set default python version to 3.12.10 * Fix windows _bootstrap_python build generating custom "config_minimal.c" This also required adding 3.12 patch to work around the lack of `sys.winver`. See python-cmake-buildsystem/cpython@ca2fd1a7856 ("_bootstrap_python: Fix execution on windows disabling site import", 2025-05-13) _bootstrap_python: * Fix windows build updating `config_minimal.c` including - `_typing` to follow-up on python-cmake-buildsystem/cpython@24d8b88420b ("gh-103763: Implement PEP 695 (#103764)", 2023-05-15) - `_winapi` to follow-up on python-cmake-buildsystem/cpython@935aa452359 ("GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179)", 2023-04-04) ctypes extension: * Introduce `HAVE_FFI_CALL` set to 1 only if the `ffi_call` symbol is found. This allows to implement the logic similar to the one introduced in autoconf. * On macOS, the extension requires to be built against system ffi. See python/cpython@2df82db4850 ("gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)", 2022-12-29) * On macOS, the extension requires to compile `_ctypes/malloc_closure.c` along with setting define `USING_MALLOC_CLOSURE_DOT_C` to `1` Updated `pyconfig.h.in`: * Add the following for which there was already a configure check. - Headers: - `HAVE_EDITLINE_READLINE_H` - `HAVE_MINIX_CONFIG_H` - `HAVE_PANEL_H` - `HAVE_READLINE_READLINE_H` - Libraries: - `HAVE_NCURSESW` Updated `pyconfig.h.in` and configure checks: * Add header checks: - `HAVE_LINUX_FS_H` - `HAVE_NET_ETHERNET_H` - `HAVE_STDIO_H` - `HAVE_SYS_PIDFD_H` * Add symbol checks: - `HAVE_FFI_CLOSURE_ALLOC` - `HAVE_FFI_PREP_CIF_VAR` - `HAVE_FFI_PREP_CLOSURE_LOC` - `HAVE_SETNS` - `HAVE_TTYNAME_R` - `HAVE_UNSHARE` * Add type checks: - `ALIGNOF_MAX_ALIGN_T` Tests: * Include CPython patch to update build directory assumptions in `getpath.py` to fix `test_frozen` and `test_sys`. See python-cmake-buildsystem/cpython@b8d5fa3e61e ("getpath: Update build directory assumptions based on python-cmake-buildsystem", 2025-05-30) Co-authored-by: Brett Jia <dev.bjia56@gmail.com>
… import Defines _BSD_SOURCE and _DEFAULT_SOURCE to ensure functions from `endian.h` are defined. See https://man7.org/linux/man-pages/man3/endian.3.html Related commits: * python/cpython@360ef843d8f ("gh-99108: Add missing md5/sha1 defines to Modules/Setup (#102308)", 2023-02-28) * python/cpython@15665d896ba ("gh-99108: Replace SHA3 implementation HACL* version (#103597)", 2023-05-07)
a383fd2
to
8c61e08
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add checksums for Python 3.12.0 to 3.12.10
Set default python version to 3.12.10
Fix windows _bootstrap_python build generating custom "config_minimal.c". This also required adding 3.12 patch to work around the lack of
sys.winver
. See python-cmake-buildsystem/cpython@ca2fd1a7856 ("_bootstrap_python: Fix execution on windows disabling site import", 2025-05-13)_bootstrap_python:
config_minimal.c
including_typing
. Follow-up of 5683458 ("cmake: Fix windows _bootstrap_python build generating custom "config_minimal.c"", 2025-05-13)ctypes extension:
Introduce
HAVE_FFI_CALL
set to 1 only if theffi_call
symbol is found. This allows to implement the logic similar to the one introduced in autoconf.On macOS, the extension requires to be built against system ffi. See python/cpython@2df82db4850 ("gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)", 2022-12-29)
On macOS, the extension requires to compile
_ctypes/malloc_closure.c
along with setting defineUSING_MALLOC_CLOSURE_DOT_C
to1
Updated
pyconfig.h.in
:HAVE_EDITLINE_READLINE_H
HAVE_MINIX_CONFIG_H
HAVE_PANEL_H
HAVE_READLINE_READLINE_H
HAVE_NCURSESW
Updated
pyconfig.h.in
and configure checks:Add header checks:
HAVE_LINUX_FS_H
HAVE_NET_ETHERNET_H
HAVE_STDIO_H
HAVE_SYS_PIDFD_H
Add symbol checks:
HAVE_FFI_CLOSURE_ALLOC
HAVE_FFI_PREP_CIF_VAR
HAVE_FFI_PREP_CLOSURE_LOC
HAVE_SETNS
HAVE_TTYNAME_R
HAVE_UNSHARE
Add type checks:
ALIGNOF_MAX_ALIGN_T
Tests:
getpath.py
tofix
test_frozen
andtest_sys
. See python-cmake-buildsystem/cpython@b8d5fa3e61e ("getpath: Update build directory assumptions based on python-cmake-buildsystem", 2025-05-30)Working toward addressing: