Add support for tvOS, visionOS and watchOS. This is mostly configuration
updates and testbed projects to support deploying to the new platforms.
Also includes a mimalloc change to support arm64_32 that has been contributed
upstream.
Add constants decimal.LIBMPDEC_VERSION, decimal.libmpdec_version,
decimal.LIBMPDEC_VERSION_INFO, and decimal.libmpdec_version_info in
the C implementation, which provide information about the version of
the libmpdec library in use.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants which provide information about the version of the
underlying library in use: GDBM_VERSION_INFO, gdbm_version_info and
gdbm_version if it is GDBM, or BDB_VERSION, bdb_version,
BDB_VERSION_INFO and bdb_version_info if it is Berkeley DB.
dbm.ndbm.library is now 'ndbm' instead of 'GNU gdbm' for a classic
NDBM library.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants tkinter.TCL_VERSION_INFO and tkinter.TK_VERSION_INFO,
named tuples with the versions of the Tcl and Tk libraries that were
used for building the module, and _tkinter.TCL_PATCH_LEVEL and
_tkinter.TK_PATCH_LEVEL strings.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constant pyexpat.VERSION_INFO which provides information about the
version of the Expat library that was used for building the module.
Make pyexpat.version_info a named tuple.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
ssl.OPENSSL_VERSION_INFO is now a named tuple.
Add ssl.OPENSSL_API_VERSION_INFO which provides information about the
version of the OpenSSL library that was used for building the module.
The private name _OPENSSL_API_VERSION is kept as an alias.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants sqlite3.SQLITE_VERSION and sqlite3.SQLITE_VERSION_INFO
which provide information about the version of the SQLite library that
was used for building the module.
Make sqlite3.sqlite_version_info a named tuple.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants readline.READLINE_VERSION_INFO,
readline.readline_version_info and readline.readline_version, which
provide information about the version of the Readline library in use.
The private names _READLINE_VERSION, _READLINE_RUNTIME_VERSION and
_READLINE_LIBRARY_VERSION are kept for backward compatibility.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants dbm.gnu.GDBM_VERSION_INFO, dbm.gnu.gdbm_version_info and
dbm.gnu.gdbm_version, which provide information about the version of
the GDBM library in use.
The private constant _gdbm._GDBM_VERSION has been removed.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test_cext now uses a single virtual environment for all tests.
It makes the test way faster since creating a virtual environment
is quite slow.
* Add Py_TARGET_ABI3T test on C++.
* Move macro tests from module exec function to test_macros().
* Call Py_BEGIN_CRITICAL_SECTION() on a fresh dictionary object,
rather than on the module.
* Rename some environment variables to always use "CPYTHON_TEST_"
prefix.
* Replace support.MS_WINDOWS with MSVC to be more explicit.
* Move macro tests to test_macros().
* On macOS, use C++11 by default.
Add constants ctypes.LIBFFI_VERSION, ctypes.libffi_version,
ctypes.LIBFFI_VERSION_INFO and ctypes.libffi_version_info, which
provide information about the version of the libffi library in use.
They are only available with libffi 3.5 or later.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add constants which provide information about the version of the
compression library used for building the module and the version
actually loaded:
* zlib: ZLIB_VERSION_INFO, zlib_version_info, ZLIBNG_VERSION_INFO,
and zlib_version as an alias of ZLIB_RUNTIME_VERSION
* bz2: bzlib_version, bzlib_version_info
* lzma: LZMA_VERSION, lzma_version, LZMA_VERSION_INFO, lzma_version_info
* compression.zstd: ZSTD_VERSION, ZSTD_VERSION_INFO
Make compression.zstd.zstd_version_info a named tuple.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.
It is listed before the current platform-less suffixes since it's more
specific.
The platform is stored in a new pyconfig.h define & sysconfig
variable, SOABI_PLATFORM.
On some known architectures (FreeBSD, Windows), this
will be undefined/zero; these won't have the new tag (yet).
Add SOABI_PLATFORM & ALT_SOABI the info to
`make pythoninfo` as well.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Use WMI to detect virtualization on Windows.
Replace wmic command with _wmi module to get the operating system caption and
version.
The wmic tool is deprecated since January 2024:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242
For example, it's no longer installed in Windows images on GitHub
Action.
Fix also run_command(): no longer try to spawn a subprocess if the
platform doesn't support subprocess. It avoids logging run_command()
errors.
On Apple, log the hardware model as "system.hardware".
* Log the "CI", "IMAGE_OS_VERSION" and "container"
environment variables.
* Add run_command() and first_line() functions.
Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.
Log vsock CID in test.pythoninfo.
* introduce executable specific linker flags
Add PY_CORE_EXE_LDFLAGS and EXE_LDFLAGS which stores executable specific
LDFLAGS, replacing PY_CORE_LDFLAGS for building
executable targets.
If PY_CORE_EXE_LDFLAGS / EXE_LDFLAGS is not provided, then it defaults
to the value of PY_CORE_LDFLAGS which is the existing behaviour.
If both flags are supplied, and there is a need
to distinguish between executable and shared specific LDFLAGS,
in particular, PY_CORE_LDFLAGS should contain the shared specific LDFLAGS.
* documentation for new linker flags
* update Misc folder documentation
* Update Makefile.pre.in
Co-authored-by: Victor Stinner <vstinner@python.org>
---------
Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Filipe Laíns <lains@riseup.net>
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows
* Remove calls to PyOS_CheckStack
* Add stack protection to parser
* Make tests more robust to low stacks
* Improve error messages for stack overflow
Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now
Unfortunatlely, the change broke some buildbots.
This reverts commit 2498c22fa0.
* Implement C recursion protection with limit pointers
* Remove calls to PyOS_CheckStack
* Add stack protection to parser
* Make tests more robust to low stacks
* Improve error messages for stack overflow
* Add mimalloc v2.12
Modified src/alloc.c to remove include of alloc-override.c and not
compile new handler.
Did not include the following files:
- include/mimalloc-new-delete.h
- include/mimalloc-override.h
- src/alloc-override-osx.c
- src/alloc-override.c
- src/static.c
- src/region.c
mimalloc is thread safe and shares a single heap across all runtimes,
therefore finalization and getting global allocated blocks across all
runtimes is different.
* mimalloc: minimal changes for use in Python:
- remove debug spam for freeing large allocations
- use same bytes (0xDD) for freed allocations in CPython and mimalloc
This is important for the test_capi debug memory tests
* Don't export mimalloc symbol in libpython.
* Enable mimalloc as Python allocator option.
* Add mimalloc MIT license.
* Log mimalloc in Lib/test/pythoninfo.py.
* Document new mimalloc support.
* Use macro defs for exports as done in:
https://github.com/python/cpython/pull/31164/
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.
* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".
Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.
test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.
On Emscripten and WASI, or if --python command line is used,
libregrtest now writes JSON into stdout, instead of using a name
file.
* Add JsonFileType.STDOUT.
* Remove JsonFileType.FILENAME.
* test.pythoninfo logs environment variables related to
cross-compilation and running Python on Emscripten/WASI.