GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-122931: Allow stable abi3 API extensions to include a multiarch tuple in the filename by stefanor · Pull Request #152461 · python/cpython

Conversation

@stefanor

@stefanor stefanor commented Jun 27, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This permits abi3 stable ABI extensions for multiple architectures to be co-installed into the same directory, without clashing with each other, the same way (non-stable ABI) regular extensions can.

It is listed before the current .abi3 suffix because .abi3 extensions are only compatible with future Python releases, not older versions.

This follows on from #122917 which was reduced down to just targetting abi3t

  • Issue: Allow stable ABI extensions to include multiarch tuples in the filename #122931

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
stefanor added 7 commits June 26, 2026 09:12
@stefanor
pythongh-122917 Allow stable API extensions to include a multiarch tu…
989c779
…ple in the filename

This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.

It is listed below the current .abi3 suffix because setuptools will
select the first suffix containing .abi3, as the target filename.
We do this to protect older Python versions predating this patch.
@stefanor
Order the multiarch-tagged extensions first
39fb3a4
@stefanor
Test for presence of multiarch extension suffixes
8324a7f
@stefanor
Fix editing error in NEWS and improve clarity
5684c14
@stefanor
Fix up the test
dfddd07
@stefanor
Only target abi3t (for expediency)
67e2548
@stefanor
pythongh-122931: Allow stable API extensions to include a multiarch t…
52e251a
…uple in the filename

This permits `abi3` stable ABI extensions for multiple architectures to be co-installed into the same directory, without clashing with each other, the same way (non-stable ABI) regular extensions can.

It is listed before the current .abi3 suffix because .abi3 extensions are only compatible with future Python releases, not older versions.

This follows on from python#122917 which was reduced down to just targetting `abi3t`
@stefanor
stefanor requested review from AA-Turner, FFY00, brettcannon, corona10, emmatyping, ericsnowcurrently, erlend-aasland, itamaro, ncoghlan and warsaw as code owners June 27, 2026 22:57
@bedevere-app bedevere-app Bot added the awaiting review label Jun 27, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 27, 2026
Allow stable ABI extensions to include multiarch tuples in the filename #122931
Closed
@stefanor stefanor mentioned this pull request Jun 27, 2026
gh-122931: Include multiarch tuple in abi3t filenames #122917
Closed
@read-the-docs-community

read-the-docs-community Bot commented Jun 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33776618 | 📁 Comparing e59ddbc against main (46d1809)

  🔍 Preview build  

144 files changed · + 3 added · ± 141 modified

+ Added

  • library/asyncio-tools.html
  • library/tkinter.fontchooser.html
  • library/tkinter.systray.html

± Modified

  • glossary.html
  • license.html
  • py-modindex.html
  • c-api/bytes.html
  • c-api/dict.html
  • c-api/exceptions.html
  • c-api/float.html
  • c-api/frame.html
  • c-api/gen.html
  • c-api/intro.html
  • and 131 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon
brettcannon removed their request for review June 29, 2026 17:53
@encukou

encukou commented Jul 18, 2026

Copy link
Copy Markdown
Member

The SC agreed to add the arch-specific abi3t .so filename. .abi3t.so should always be there.
we should do the same for abi3 as for abi3t. (I talked with the RM and a SC member & they agree; if anyone wants an official clarification from the SC, ask them.)

I'll update & merge this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou added 4 commits July 18, 2026 15:44
@encukou
Allow bare abi3/abi3t suffix
02ece69
@encukou
Test that SOABI_PLATFORM is in SOABI
b5ca9eb
@encukou
Move What's New to 3.15; remove redundant NEWS entry
cd63672
@encukou
Merge in the main branch
36a836d
@encukou encukou added the needs backport to 3.15 bugs and security fixes label Jul 18, 2026
encukou and others added 2 commits July 18, 2026 17:09
@encukou
Fix the embarrassing mistake
e20b0b2
@vstinner @stefanor
Add SOABI_PLATFORM to test.pythoninfo
f9e3817
Add ALT_SOABI and SOABI_PLATFORM to test.pythoninfo. Add also
EXTENSION_SUFFIXES of importlib.machinery.
@stefanor

stefanor commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

This change adds the following strings to importlib.machinery.EXTENSION_SUFFIXES on a regular build:

  • Emscripten: .abi3-wasm32-emscripten.so and .abi3t-wasm32-emscripten.so
  • macOS: .abi3-darwin.so and .abi3t-darwin.so
  • Ubuntu (x86-64): .abi3-x86_64-linux-gnu.so and .abi3t-x86_64-linux-gnu.so
  • WASI: .abi3-wasm32-wasi.so and .abi3t-wasm32-wasi.so

no new string is added on these platforms:

  • FreeBSD
  • Windows

So, I primarily care about Linux here, that's where the pain is. And that's probably the platform where working with multiple architectures is the most common.

To me the addition makes sense and is potentially useful on all of those platforms (FreeBSD and Windows too). But figuring out the details for this all would probably take some time. We could restrict it to Linux only to get this merged now.

Fat binaries are common on macOS, but you'd only build one at a time, and combine them into a fat binary.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stefanor

stefanor commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

This change adds the following strings to importlib.machinery.EXTENSION_SUFFIXES on a regular build:

Maybe we're overthinking this. These platforms already have the additional .so extension suffix, we're just doing the same for abi3 and abi3t.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jul 19, 2026

Copy link
Copy Markdown
Member

To me the addition makes sense and is potentially useful on all of those platforms (FreeBSD and Windows too).

Currently, we don't support the "platform triplet" on FreeBSD (same on OpenBSD or NetBSD).

The PLATFORM_TRIPLET variable in configure.ac is set by:

AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then
  PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d '    '`
  PLATFORM_TRIPLET="${PLATFORM_TRIPLET@%:@PLATFORM_TRIPLET=}"
  AC_MSG_RESULT([$PLATFORM_TRIPLET])
else
  AC_MSG_RESULT([none])
fi
rm -f conftest.out

But on FreeBSD, Misc/platform_triplet.c fails to compile:

vstinner@freebsd$ cc -E Misc/platform_triplet.c | grep '^PLATFORM_TRIPLET=' | tr -d ' '
Misc/platform_triplet.c:289:3: error: unknown platform triplet
  289 | # error unknown platform triplet
      |   ^
1 error generated.

Maybe we should explore the ./config.guess option:

vstinner@freebsd$ ./config.guess
x86_64-unknown-freebsd15.0

The commit d3899c1 of issue gh-67169 in 2015 introduced PLATFORM_TRIPLET variable and modified SOABI to use it. The change is part of Python 3.5.

Result of import sysconfig; sysconfig.get_config_var('SOABI'):

  • Python 3.4: 'cpython-34dm'
  • Python 3.5: 'cpython-35dm-x86_64-linux-gnu'
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Since the point of the feature is to have different .so names for different platforms, i think:

  • adding -darwin or wasm32-wasi is correct.
  • the fact that nothing is added for FreeBSD is a (low-priority) bug. We can fix it in the future (for cpython-3XX files as well as abi3 ones).
  • Windows uses .pyd instead; changing that would be a different feature.
stefanor reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 19, 2026
@bedevere-bot

bedevere-bot commented Jul 19, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 0ebab06 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152461%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 19, 2026
@vstinner

vstinner commented Jul 19, 2026

Copy link
Copy Markdown
Member

test_curses fails on RHEL8 buildbot workers, but these workers should only be run on Python 3.12 and older. Example: https://github.com/python/buildmaster-config/blob/519dfd6b9757ab889d32677b71c074c5ccc2096c/master/custom/workers.py#L115.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou added 2 commits July 27, 2026 13:23
@encukou
Merge in the main branch
2d0e27f
@encukou
Skip test if SOABI_PLATFORM is undefined
e59ddbc
@encukou

encukou commented Jul 27, 2026

Copy link
Copy Markdown
Member

!buildbot FreeBSD14

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jul 27, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit e59ddbc 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152461%2Fmerge

The command will test the builders whose names match following regular expression: FreeBSD14

The builders matched are:

  • AMD64 FreeBSD14 PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Jul 27, 2026

Copy link
Copy Markdown
Member

Let's get it in then.

merwok reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou
encukou merged commit 7961bbf into python:main Jul 27, 2026
55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jul 27, 2026

Copy link
Copy Markdown

Thanks @stefanor for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Jul 27, 2026
@bedevere-app

bedevere-app Bot commented Jul 27, 2026

Copy link
Copy Markdown

GH-154772 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jul 27, 2026
@stefanor
stefanor deleted the stable-abi3-multiarch branch July 28, 2026 13:09
This was referenced Jul 28, 2026
Python 3.15 final will allow including platform tags in stable abi extension filenames PyO3/pyo3#6258
Open
Support for Python limited API extensions assumes there is only one valid extension suffix mesonbuild/meson#15637
Open
This was referenced Jul 28, 2026
Stable ABI filename new form in Python 3.15+ mesonbuild/meson-python#875
Closed
Stable ABI filename new form in 3.15+ scikit-build/scikit-build-core#1525
Open
Stable ABI filename new form in Python 3.15+ wjakob/nanobind#1404
Closed
encukou added a commit that referenced this pull request Jul 29, 2026
@miss-islington @stefanor
@encukou @vstinner
[3.15] gh-122931: Allow stable abi3 API extensions to include a multi…
23b2b40
…arch tuple in the filename (GH-152461) (GH-154772)

This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.

It is listed before the current platform-less suffixes since it's more
specific.

The platform is stored in a new pyconfig.h define & sysconfig
variable, SOABI_PLATFORM.
On some known architectures (FreeBSD, Windows), this
will be undefined/zero; these won't have the new tag (yet).

Add SOABI_PLATFORM & ALT_SOABI the info to
`make pythoninfo` as well.
(cherry picked from commit 7961bbf)

Co-authored-by: Stefano Rivera <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
@stefanor @encukou
@vstinner @mbeijen
pythongh-122931: Allow stable abi3 API extensions to include a multia…
f630835
…rch tuple in the filename (pythonGH-152461)

This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each other,
the same way (non-stable ABI) regular extensions can.

It is listed before the current platform-less suffixes since it's more
specific.

The platform is stored in a new pyconfig.h define & sysconfig
variable, SOABI_PLATFORM.
On some known architectures (FreeBSD, Windows), this
will be undefined/zero; these won't have the new tag (yet).

Add SOABI_PLATFORM & ALT_SOABI the info to
`make pythoninfo` as well.

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@hmaarrfk hmaarrfk mentioned this pull request Sep 6, 2026
Fix Python 3.15 so names conda-forge/python-feedstock#926
Closed
@vfazio vfazio mentioned this pull request Oct 16, 2026
[BUG] cross compiling 3.15 abi3 wheels fails due to new multiarch support pypa/setuptools#5351
Closed
yselkowitz added a commit to yselkowitz/python-augeas that referenced this pull request Oct 27, 2026
@yselkowitz
spec: fix build with Python 3.15
08b16c2
The platform triplet has been added to the standard extension filename:

python/cpython#152461
@yselkowitz yselkowitz mentioned this pull request Oct 27, 2026
spec: fix build with Python 3.15 hercules-team/python-augeas#63
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@itamaro itamaro Awaiting requested review from itamaro itamaro is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@stefanor @encukou @vstinner @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.