Conversation
MementoRC
force-pushed
the
abi3-suffix-gil-mode
branch
from
September 14, 2026 19:51
a9d7a13 to
5445d34
Compare
isuruf
reviewed
Sep 14, 2026
| # free-threaded build has only the ".abi3t" forms in its filetab. | ||
| # Pick the one the HOST interpreter can actually load. | ||
| if self.host_sysconfigdata.build_time_vars.get("Py_GIL_DISABLED"): | ||
| self.sysconfig_abi3_suffix = ".abi3t.so" |
Contributor
There was a problem hiding this comment.
This is only for 3.15+. For earlier versions there's no abi3.
Author
There was a problem hiding this comment.
Ok, so this calls for a version guard, a dedicated helper function?
isuruf
reviewed
Sep 14, 2026
| EXTENSION_SUFFIXES = [ | ||
| {{repr(self.sysconfig_ext_suffix)}}, | ||
| {{repr(self.sysconfig_abi3_suffix)}}, | ||
| ".so", |
Contributor
There was a problem hiding this comment.
We are also missing abi3-x86_64-linux-gnu.so types coming in 3.15
Author
There was a problem hiding this comment.
So, abi-<arch>.so. Could try extracting from sysconfig_ext_suffix
Author
There was a problem hiding this comment.
Is the order correct?
suffixes = [".%s.so" % stem]
soabi_platform = self._host_soabi_platform()
if soabi_platform:
suffixes.append(".%s-%s.so" % (stem, soabi_platform))
Author
There was a problem hiding this comment.
New test is passing: tests/test_environment.py::test_abi3_extension_suffixes PASSED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
1.6.0 added
EXTENSION_SUFFIXEStoimportlib-machinery-patchso that setuptoolsget_abi3_suffix()stops picking the build interpreter's platform-tagged.abi3-<multiarch>.soon a cross build. The second element is hardcoded to".abi3.so", which is correct only for a GIL-enabled host.In
Python/dynload_shlib.cthe plain abi3 entries are inside the#ifndef Py_GIL_DISABLEDblock while the abi3t entries are outside it, so a free-threaded interpreter has no plain.abi3entry in its filetab at all. With the hardcoded list, a free-threaded cross build names the extension.abi3.so, which that interpreter cannot load.This takes the suffix from the host's own
Py_GIL_DISABLEDinstead..get()rather than indexing, since the var is absent from a GIL build'sbuild_time_varsrather than set to 0.Measured on a GIL build, CPython 3.15.0rc2 x86_64,
_imp.extension_suffixes():I have not tested a free-threaded cross build; this is from reading
dynload_shlib.cand the hostbuild_time_vars. Happy to adjust if you would rather list both forms than pick one - note thatget_abi3_suffix()takes the first entry containing.abi3, and.abi3t.somatches that substring, so ordering would become load-bearing.Raised by @isuruf in conda-forge/crossenv-feedstock#49.