Skip to content

Commit 03f3b9a

Browse files
authored
gh-146907: Clarify ABI compatibility between debug and release builds (GH-146925)
1 parent 2452324 commit 03f3b9a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Doc/using/configure.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,11 @@ See also the :ref:`Python Development Mode <devmode>` and the
906906
:option:`--with-trace-refs` configure option.
907907

908908
.. versionchanged:: 3.8
909-
Release builds and debug builds are now ABI compatible: defining the
909+
Release builds are now ABI compatible with debug builds: defining the
910910
``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the
911-
:option:`--with-trace-refs` option).
911+
:option:`--with-trace-refs` option). However, debug builds still expose
912+
more symbols than release builds and code built against a debug build is not
913+
necessarily compatible with a release build.
912914

913915

914916
Debug options

Doc/whatsnew/3.8.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,15 @@ subdirectories).
207207
Debug build uses the same ABI as release build
208208
-----------------------------------------------
209209

210-
Python now uses the same ABI whether it's built in release or debug mode. On
211-
Unix, when Python is built in debug mode, it is now possible to load C
212-
extensions built in release mode and C extensions built using the stable ABI.
213-
214-
Release builds and :ref:`debug builds <debug-build>` are now ABI compatible: defining the
215-
``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro, which
216-
introduces the only ABI incompatibility. The ``Py_TRACE_REFS`` macro, which
217-
adds the :func:`sys.getobjects` function and the :envvar:`PYTHONDUMPREFS`
210+
The ABI of Python :ref:`debug builds <debug-build>` is now compatible with
211+
Python release builds. On Unix, when Python is built in debug mode, it is now
212+
possible to load C extensions built in release mode and C extensions built
213+
using the stable ABI. The inverse is not true, as debug builds expose
214+
additional symbols not available in release builds.
215+
216+
Defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro,
217+
which introduces the only ABI incompatibility. The ``Py_TRACE_REFS`` macro,
218+
which adds the :func:`sys.getobjects` function and the :envvar:`PYTHONDUMPREFS`
218219
environment variable, can be set using the new :option:`./configure
219220
--with-trace-refs <--with-trace-refs>` build option.
220221
(Contributed by Victor Stinner in :issue:`36465`.)

0 commit comments

Comments
 (0)