]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-146907: Clarify ABI compatibility between debug and release builds (GH-146925)
authorkonsti <konstin@mailbox.org>
Wed, 1 Apr 2026 14:17:56 +0000 (16:17 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Apr 2026 14:17:56 +0000 (16:17 +0200)
Doc/using/configure.rst
Doc/whatsnew/3.8.rst

index b218325b140d43eacc488de64db4d63b2a14a51d..cc6aafe80f810dada18f42a892d65380d32effd0 100644 (file)
@@ -906,9 +906,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 91cd23f6f2bbb95beb76ddf13039ba9fb2374d63..5078fc30ac111e47b2d17f134b574d4a804f5783 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`.)