Skip to content

Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows #88402

Description

@zooba
BPO 44236
Nosy @pfmoore, @tjguk, @zware, @zooba

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:

assignee = None
closed_at = None
created_at = <Date 2021-05-25.15:15:02.518>
labels = ['3.10', 'OS-windows', '3.11']
title = 'Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows'
updated_at = <Date 2021-05-25.15:18:34.574>
user = 'https://github.com/zooba'

bugs.python.org fields:

activity = <Date 2021-05-25.15:18:34.574>
actor = 'steve.dower'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2021-05-25.15:15:02.518>
creator = 'steve.dower'
dependencies = []
files = []
hgrepos = []
issue_num = 44236
keywords = []
message_count = 2.0
messages = ['394368', '394369']
nosy_count = 4.0
nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue44236'
versions = ['Python 3.10', 'Python 3.11']

Linked PRs

Activity

  1. zooba commented on May 25, 2021

    @zooba
    MemberAuthor

    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?

  2. zooba commented on May 25, 2021

    @zooba
    MemberAuthor

    Should actually be:

    LIBPL=Path(sysconfig.get_config_var("installed_base")) / "libs"
  3. transferred this issue fromon Apr 10, 2022
  4. tasty0tomato commented on Feb 19, 2023

    @tasty0tomato

    Tools/freeze.py may not work on Windows because of this.

    configdir = sysconfig.get_config_var('LIBPL')

  5. zooba commented on Feb 20, 2023

    @zooba
    MemberAuthor

    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

  6. FFY00 commented on Feb 20, 2023

    @FFY00
    Member

    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.

    def _init_non_posix(vars):

    I'd also probably add a test to make sure they match with the values in importlib.machinery.EXTENSION_SUFFIXES

    Should actually be:

    Yes, it should be derived from installed_base.

  7. colesbury commented on Sep 28, 2023

    @colesbury
    Contributor

    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 SOABI consistent defined will be useful for PEP 703, and it'd be helpful to have sysconfig.get_config_var('Py_NOGIL') work on Windows as well.

  8. FFY00 commented on Sep 28, 2023

    @FFY00
    Member

    @colesbury, yeah please do! I'd be happy to review it.

  9. added a commit that references this issue on Sep 28, 2023
  10. added a commit that references this issue on Oct 4, 2023
  11. FFY00 commented on Oct 5, 2023

    @FFY00
    Member

    GH-110049 landed thanks to @colesbury, which implemented this, but with the following differences from the original proposal:

    • LIBDIR was used instead of LIBPL, as it better matches the POSIX semantics (discussion)
    • LIBRARY exposes the libpython DLL name instead of the path to the directory where it is contained (discussion)
    • Py_NOGIL was also added
  12. added a commit that references this issue on Sep 2, 2024
  13. added
    3.13only security fixes
    and removed
    3.11only security fixes
    on Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions