-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set sys.abiflags on Windows to make check free-threaded/debug builds easier
#127405
Comments
|
I'm not convinced this is non-impactful elsewhere. We would need to make sure that anywhere that uses something "defined" by The lack of documentation for experimental builds is somewhat deliberate right now. It's being documented outside of the main docs, as we don't want to confuse users with features that are not officially part of CPython. If you want more info about how to work with free-threaded builds, you'll have to find that (I don't remember where it is, but the discussion forums are a good place to start looking). |
Here is the search result of the following statements on GitHub:
Issue on the
The debug flag is included in the ABI tags. Here is the result that the Python is configured with $ python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'
.cpython-314td-darwin.so
A fresh installation built with $ python3 -VV
Python 3.14.0a2+ experimental free-threading build (heads/main:c46acd35888, Dec 3 2024, 01:17:32) [Clang 16.0.0 (clang-1600.0.26.4)]
$ python3 -c 'import sys; print(sys.abiflags)'
td
$ python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'
.cpython-314td-darwin.so |
Not on Windows - we use a There are a number of differences like this between Windows and other platforms. It's really meaningless to test any of this on non-Windows and then assume it applies cross-platform, it really won't. (Also don't put too much faith in the docs. They're largely written by Linux developers for Linux developers, and only rarely branch out into other platforms.) |
There are no $ .\arm64\python3.14t_d.exe -c 'import pprint, sysconfig; pprint.pprint(sysconfig.get_config_vars())'
{'BINDIR': 'C:\\Users\\PanXuehai\\Projects\\cpython\\PCbuild\\arm64',
'BINLIBDEST': 'C:\\Users\\PanXuehai\\Projects\\cpython\\Lib',
'EXE': '.exe',
'EXT_SUFFIX': '_d.cp314t-win_arm64.pyd',
'INCLUDEPY': 'C:\\Users\\PanXuehai\\Projects\\cpython\\Include',
'LDLIBRARY': 'python314t_d.dll',
'implementation_lower': 'python',
'installed_base': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'installed_platbase': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'platbase': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'platlibdir': 'DLLs',
'prefix': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'projectbase': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'py_version': '3.14.0a2+',
'py_version_nodot': '314',
'py_version_nodot_plat': '314t-arm64',
'py_version_short': '3.14',
'srcdir': 'C:\\Users\\PanXuehai\\Projects\\cpython',
'userbase': 'C:\\Users\\PanXuehai\\AppData\\Roaming\\Python'}I wonder if adding something that did not exist before would break historical things. cpython/Include/internal/pycore_importdl.h Lines 106 to 133 in 6cf7794
|
Yes, this is my concern, but I'm far more concerned about 3rd party code using This seems much like the discussion we had about using Being able to add |
For a concrete use-case, I'm trying to patch |


Feature or enhancement
Proposal:
Currently, the
sys.abiflagsattribute is only set on Unix systems. On Windows, there are nosys.abiflagsset (i.e.hasattr(sys, 'abiflags') -> False). It is hard to tell if Python is in free-threaded or debug builds. Although developers can use something likesysconfig.get_config_var('Py_GIL_DISABLED'). It is not well documented and is not convenient.cpython/Lib/test/test_sys.py
Lines 686 to 687 in 3afb639
cpython/Lib/test/test_sys.py
Lines 1294 to 1297 in 3afb639
It would be nice if we could set
ABIFLAGSinpyconfig.hand enablesys.abiflagson Windows. This would simplify much code in the wild world and also in the CPython repo.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
sys.abiflagson Windows #127406The text was updated successfully, but these errors were encountered: