Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-109740: Use 't' in --disable-gil SOABI
Shared libraries for CPython 3.13 are now marked with a 't' for
threading. For example, `binascii.cpython-313t-darwin.so`.
  • Loading branch information
colesbury committed Sep 26, 2023
commit e745f3264b577dc706ab83cb8c50e3e7f5e9da8d
7 changes: 7 additions & 0 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,13 @@ def test_pystats(self):
sys._stats_clear()
sys._stats_dump()

@test.support.cpython_only
@unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags')
Comment thread
vstinner marked this conversation as resolved.
def test_disable_gil_abi(self):
abi_threaded = 't' in sys.abiflags
py_nogil = (sysconfig.get_config_var('Py_NOGIL') == 1)
self.assertEqual(py_nogil, abi_threaded)


@test.support.cpython_only
class UnraisableHookTest(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The experimental `--disable-gil` flag now includes "t" (for "threaded") in
extension ABI tags.
10 changes: 8 additions & 2 deletions Python/dynload_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
#define PYD_DEBUG_SUFFIX ""
#endif

#ifdef Py_NOGIL
#define PYD_THREADING_TAG "t"
#else
#define PYD_THREADING_TAG ""
#endif
Comment thread
vstinner marked this conversation as resolved.

#ifdef PYD_PLATFORM_TAG
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".pyd"
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) PYD_THREADING_TAG "-" PYD_PLATFORM_TAG ".pyd"
#else
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) ".pyd"
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) PYD_THREADING_TAG ".pyd"
#endif

#define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd"
Expand Down
64 changes: 33 additions & 31 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 17 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,22 @@ fi
AC_SUBST([ABIFLAGS])
ABIFLAGS=""

# Check for --disable-gil
# --disable-gil
AC_MSG_CHECKING([for --disable-gil])
AC_ARG_ENABLE([gil],
[AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])],
[AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no]
)
AC_MSG_RESULT([$disable_gil])

if test "$disable_gil" = "yes"
then
AC_DEFINE([Py_NOGIL], [1],
[Define if you want to disable the GIL])
Comment thread
vstinner marked this conversation as resolved.
ABIFLAGS="${ABIFLAGS}t"
fi

# Check for --with-pydebug
AC_MSG_CHECKING([for --with-pydebug])
AC_ARG_WITH([pydebug],
Expand Down Expand Up @@ -5669,6 +5685,7 @@ AC_C_BIGENDIAN
#
# * The Python implementation (always 'cpython-' for us)
# * The major and minor version numbers
# * --disable-gil (adds a 't')
# * --with-pydebug (adds a 'd')
#
# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
Expand Down Expand Up @@ -6947,21 +6964,6 @@ AC_ARG_ENABLE([test-modules],
AC_MSG_RESULT([$TEST_MODULES])
AC_SUBST([TEST_MODULES])

# Check for --disable-gil
# --disable-gil
AC_MSG_CHECKING([for --disable-gil])
AC_ARG_ENABLE([gil],
[AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])],
[AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no]
)
AC_MSG_RESULT([$disable_gil])

if test "$disable_gil" = "yes"
then
AC_DEFINE([Py_NOGIL], [1],
[Define if you want to disable the GIL])
fi

# gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
# On Linux aarch64, GCC may require programs and libraries to be linked
# explicitly to libatomic. Call _Py_atomic_or_uint64() which may require
Expand Down