-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
setuptools version
setuptools == 80.9.0
Python version
3.13t, 3.14t
OS
Windows
Description
blis uses setuptools to compile Cython extensions with cmake. Due to nuances around the pure-C libraries, it does not use MSVC, but instead it uses new_compiler(plat="nt", compiler="unix").
Compilation fails on 3.13t and 3.14t:
clang.exe [...] -lpython314 [...]
LINK : fatal error LNK1181: cannot open input file 'python314.lib'In some environments which for some reason deploy both python314.lib and python314t.lib, like actions/setup-python, the linking instead succeeds but then the interpreter segfaults on import.
The issue is caused by this code branch, which fails to account for "t" variants of python*.lib:
setuptools/setuptools/_distutils/command/build_ext.py
Lines 772 to 782 in d198e86
| if not isinstance(self.compiler, MSVCCompiler): | |
| template = "python%d%d" | |
| if self.debug: | |
| template = template + '_d' | |
| pythonlib = template % ( | |
| sys.hexversion >> 24, | |
| (sys.hexversion >> 16) & 0xFF, | |
| ) | |
| # don't extend ext.libraries, it may be shared with other | |
| # extensions, it is a reference to the original list | |
| return ext.libraries + [pythonlib] |
Expected behavior
On 3.14t clang must be passed -lpython314t instead of -lpython314
Workaround
Subclass build_ext and override the method build_ext.get_libraries to make it return ["python314t"] instead of ["python314"].
How to Reproduce
pip install git+https://github.com/explosion/cython-blis.git@9dbe572cef57b394f97b3114a3e28ec04eb3a39e