Repository navigation
Conversation
a9d7a13 to
5445d34
Compare
| # 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" |
There was a problem hiding this comment.
This is only for 3.15+. For earlier versions there's no abi3.
There was a problem hiding this comment.
Ok, so this calls for a version guard, a dedicated helper function?
| EXTENSION_SUFFIXES = [ | ||
| {{repr(self.sysconfig_ext_suffix)}}, | ||
| {{repr(self.sysconfig_abi3_suffix)}}, | ||
| ".so", |
There was a problem hiding this comment.
We are also missing abi3-x86_64-linux-gnu.so types coming in 3.15
There was a problem hiding this comment.
So, abi-<arch>.so. Could try extracting from sysconfig_ext_suffix
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))
There was a problem hiding this comment.
New test is passing: tests/test_environment.py::test_abi3_extension_suffixes PASSED
auscompgeek
left a comment
There was a problem hiding this comment.
My reading of https://docs.python.org/3.15/howto/abi3t-migration.html is that abi3t is compatible with both freethreaded and non-freethreaded CPythons starting from 3.15. I don't believe this correctly implements that?
I can see rules_pycross appears to handle it correctly.
|
Right, .abi3t is unconditional |
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.