[New-bugs-announce] [issue44230] lookup extensions with the stable ABI under a platform specific name

Matthias Klose report at bugs.python.org
Tue May 25 07:10:17 EDT 2021


New submission from Matthias Klose <doko at debian.org>:

On Posix targets, the file names for extensionsions are currently

foo.cpython-39-x86_64-linux-gnu.so
foo.abi3.so

for platforms which have PLATFORM_TRIPLET defined.  This makes it clear which extension belongs to which interpreter, and at least on Debian and Ubuntu, it allowes cross-building of extensions by installing both the required build and host (or host and target) packages in the same environment.

Of course, the stable ABI is stable, so introducing another extension suffix to lookup has to be optional.  Having such a lookup only as a local patch in a CPython build would make these extensions not loadable by other CPython builds.

Proposing to also look up an extension with the stable ABI as

foo.x86_64-linux-gnu.abi3.so

Not using foo.x86_64-linux-gnu-abi3.so (with a dash) to keep possible .endswith() matches working.

Adding this new lookup to _PyImport_DynLoadFiletab, before or after the original .abi3.so should be possible.

- Adding it after the original one has the advantage that lookups won't get penalized with one extra lookup for people not using it.
- Adding it before the original one has the advantage that the more specific one is looked up before the more general one. That behavior could also become the default on Debian builds using a local patch.

One more question would be how to document that change, or if the platform specific extension file name should be the preferred name for the future.  Adding here just a minimal patch for discussion.

----------
components: Extension Modules
files: platform-stable-abi.diff
keywords: patch
messages: 394325
nosy: barry, doko, petr.viktorin
priority: normal
severity: normal
status: open
title: lookup extensions with the stable ABI under a platform specific name
type: enhancement
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50062/platform-stable-abi.diff

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44230>
_______________________________________


More information about the New-bugs-announce mailing list