Skip to content

Commit 47116a4

Browse files
committed
Only target abi3t (for expediency)
1 parent 46e746d commit 47116a4

4 files changed

Lines changed: 11 additions & 22 deletions

File tree

Doc/whatsnew/3.16.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ Other language changes
8181
they reference) alive indefinitely.
8282
(Contributed by Łukasz Langa in :gh:`102960`.)
8383

84-
* Stable ABI extensions may now include a multiarch tuple in the
85-
filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.
84+
* Stable ABI extensions (with free-threaded compatibility) may now
85+
include a multiarch tuple in the filename, e.g.
86+
``foo.abi3t-x86-64-linux-gnu.so``.
8687
This permits stable ABI extensions for multiple architectures to be
8788
co-installed into the same directory, without clashing with each
8889
other, as regular dynamic extensions do. Build tools will generate

Lib/test/test_importlib/extension/test_finder.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_failure(self):
6262

6363
def test_abi3_extension_suffixes(self):
6464
suffixes = self.machinery.EXTENSION_SUFFIXES
65+
platform = sysconfig.get_config_var("SOABI_PLATFORM")
6566
if 'win32' in sys.platform:
6667
# Either "_d.pyd" or ".pyd" must be in suffixes
6768
self.assertTrue({"_d.pyd", ".pyd"}.intersection(suffixes))
@@ -72,20 +73,10 @@ def test_abi3_extension_suffixes(self):
7273
self.assertNotIn(".abi3.so", suffixes)
7374
else:
7475
self.assertIn(".abi3.so", suffixes)
75-
self.assertIn(".abi3t.so", suffixes)
76-
77-
@unittest.skipIf(
78-
not (sysconfig.get_config_var("SOABI_PLATFORM") or "").strip('"'),
79-
"Linux-only test"
80-
)
81-
def test_multiarch_abi3_extension_suffixes(self):
82-
suffixes = self.machinery.EXTENSION_SUFFIXES
83-
platform = sysconfig.get_config_var("SOABI_PLATFORM").strip('"')
84-
if Py_GIL_DISABLED:
85-
self.assertNotIn(f".abi3-{platform}.so", suffixes)
86-
else:
87-
self.assertIn(f".abi3-{platform}.so", suffixes)
88-
self.assertIn(f".abi3t-{platform}.so", suffixes)
76+
if platform:
77+
self.assertIn(f".abi3t-{platform}.so", suffixes)
78+
else:
79+
self.assertIn(".abi3t.so", suffixes)
8980

9081

9182
(Frozen_FinderTests,
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Allow importing stable ABI C extensions that include a multiarch tuple
2-
in their filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.
1+
Linux: Include multiarch tuples in ``abi3t`` stable ABI C extension filenames, e.g. ``foo.abi3t-x86-64-linux-gnu.so``.

Python/dynload_shlib.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ const char *_PyImport_DynLoadFiletab[] = {
4646
"." ALT_SOABI ".so",
4747
#endif
4848
#ifndef Py_GIL_DISABLED
49-
#ifdef SOABI_PLATFORM
50-
".abi" PYTHON_ABI_STRING "-" SOABI_PLATFORM ".so",
51-
#endif /* SOABI_PLATFORM */
5249
".abi" PYTHON_ABI_STRING ".so",
5350
#endif /* Py_GIL_DISABLED */
5451
#ifdef SOABI_PLATFORM
5552
".abi" PYTHON_ABI_STRING "t-" SOABI_PLATFORM ".so",
56-
#endif /* SOABI_PLATFORM */
53+
#else
5754
".abi" PYTHON_ABI_STRING "t.so",
55+
#endif /* SOABI_PLATFORM */
5856
".so",
5957
#endif /* __CYGWIN__ */
6058
NULL,

0 commit comments

Comments
 (0)