Repository navigation
Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows #88402
Description
Activity
Python on Windows currently has no values in sysconfig to locate the lib files for building. Though these are very predictable (for now), it would be nice to have them in the same place as for other platforms.
I propose defining the following config vars in sysconfig:
LIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).stem LDLIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).name LIBPL=Path(sys.prefix) / "libs" SOABI=<SO but without '.' and '.pyd'>
Are there better shared names for these? Or others that should be added?
Reacted by Ray SpethShould actually be:
LIBPL=Path(sysconfig.get_config_var("installed_base")) / "libs"
Tools/freeze.py may not work on Windows because of this.
cpython/Tools/freeze/freeze.py
Line 239 in 04cc427
configdir = sysconfig.get_config_var('LIBPL') Well, we know it currently works well enough to pass tests, so there must be some other way that it handles that variable not currently existing. It's possible though that providing that value would cause it to start failing.
And now I've been reminded of this issue, ping @FFY00
I propose defining the following config vars in sysconfig:
I think it's a good idea, we could definitely use this downstream until we have a better place to expose this information. Adding this should be fairly easy, the new variables just need to be added to
_init_non_posix, if anyone wants to open a PR.Line 540 in 84181c1
def _init_non_posix(vars): I'd also probably add a test to make sure they match with the values in
importlib.machinery.EXTENSION_SUFFIXESShould actually be:
Yes, it should be derived from
installed_base.Adding this should be fairly easy, the new variables just need to be added to _init_non_posix, if anyone wants to open a PR.
I can put up a PR for this. I think having
SOABIconsistent defined will be useful for PEP 703, and it'd be helpful to havesysconfig.get_config_var('Py_NOGIL')work on Windows as well.Reacted by Filipe Laíns and Itamar Oren@colesbury, yeah please do! I'd be happy to review it.
Reacted by Sam Gross- added a commit that references this issue
on Sep 28, 2023 GH-110049 landed thanks to @colesbury, which implemented this, but with the following differences from the original proposal:
LIBDIRwas used instead ofLIBPL, as it better matches the POSIX semantics (discussion)LIBRARYexposes the libpython DLL name instead of the path to the directory where it is contained (discussion)Py_NOGILwas also added
Reacted by tasty0tomatoReacted by Itamar Oren- added3.13only security fixesonly security fixesand removed3.11only security fixesonly security fixes3.10 (EOL)end of lifeend of life
on Oct 22, 2024
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs