]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-146907: Clarify ABI compatibility between debug and release builds (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 3 Apr 2026 08:03:09 +0000 (10:03 +0200)
committerGitHub <noreply@github.com>
Fri, 3 Apr 2026 08:03:09 +0000 (10:03 +0200)
(cherry picked from commit 03f3b9ade975e78a31bf776ff27ac6ac22fcb65a)

Co-authored-by: konsti <konstin@mailbox.org>
Doc/using/configure.rst
Doc/whatsnew/3.8.rst

index 03039edc71a71e22037db110bc1bfe66deef076f..fde0ddba9f9d29510aaf02b332912e174aa6b4b3 100644 (file)
@@ -708,9 +708,11 @@ See also the :ref:`Python Development Mode <devmode>` and the
 :option:`--with-trace-refs` configure option.
 
 .. versionchanged:: 3.8
-   Release builds and debug builds are now ABI compatible: defining the
+   Release builds are now ABI compatible with debug builds: defining the
    ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the
-   :option:`--with-trace-refs` option).
+   :option:`--with-trace-refs` option). However, debug builds still expose
+   more symbols than release builds and code built against a debug build is not
+   necessarily compatible with a release build.
 
 
 Debug options
index ea809931a3166bd7f50a463f4d8d5616a3d2407c..308f41abc74cbaa1d4fac1b40ab8f2a2ea28b8f9 100644 (file)
@@ -207,14 +207,15 @@ subdirectories).
 Debug build uses the same ABI as release build
 -----------------------------------------------
 
-Python now uses the same ABI whether it's built in release or debug mode. On
-Unix, when Python is built in debug mode, it is now possible to load C
-extensions built in release mode and C extensions built using the stable ABI.
-
-Release builds and :ref:`debug builds <debug-build>` are now ABI compatible: defining the
-``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro, which
-introduces the only ABI incompatibility. The ``Py_TRACE_REFS`` macro, which
-adds the :func:`sys.getobjects` function and the :envvar:`PYTHONDUMPREFS`
+The ABI of Python :ref:`debug builds <debug-build>`  is now compatible with
+Python release builds. On Unix, when Python is built in debug mode, it is now
+possible to load C extensions built in release mode and C extensions built
+using the stable ABI. The inverse is not true, as debug builds expose
+additional symbols not available in release builds.
+
+Defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro,
+which introduces the only ABI incompatibility. The ``Py_TRACE_REFS`` macro,
+which adds the :func:`sys.getobjects` function and the :envvar:`PYTHONDUMPREFS`
 environment variable, can be set using the new :option:`./configure
 --with-trace-refs <--with-trace-refs>` build option.
 (Contributed by Victor Stinner in :issue:`36465`.)