Skip to content

Commit f84ef65

Browse files
committed
Only target abi3t (for expediency)
1 parent 7b071c2 commit f84ef65

4 files changed

Lines changed: 8 additions & 28 deletions

File tree

Doc/whatsnew/3.16.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ New features
7575
Other language changes
7676
======================
7777

78-
* Stable ABI extensions now include a multiarch tuple in the
79-
filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.
80-
This permits stable ABI extensions for multiple architectures to be
81-
co-installed into the same directory, without clashing with each
82-
other, as regular dynamic extensions do. Build tools will generate
83-
these multiarch tagged filenames, by default, when targeting
84-
compatibility with at least Python 3.15.
85-
(Contributed by Stefano Rivera in :gh:`122931`.)
8678

8779

8880
New modules

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").strip('"')
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)