Skip to content

Generation of an executable's library file when python is built is static #88267

Closed

Description

@lakor64
mannequin
BPO 44101
Nosy @pfmoore, @tjguk, @zware, @zooba, @lakor64
Files
  • prop.patch
  • 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-10.11:27:58.956>
    labels = ['type-bug', 'OS-windows', '3.11']
    title = "Generation of an executable's library file when python is built is static"
    updated_at = <Date 2021-05-10.11:27:58.956>
    user = 'https://github.com/lakor64'

    bugs.python.org fields:

    activity = <Date 2021-05-10.11:27:58.956>
    actor = 'lakor64'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Windows']
    creation = <Date 2021-05-10.11:27:58.956>
    creator = 'lakor64'
    dependencies = []
    files = ['50031']
    hgrepos = []
    issue_num = 44101
    keywords = ['patch']
    message_count = 1.0
    messages = ['393377']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'lakor64']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue44101'
    versions = ['Python 3.11']

    Linked PRs

    Activity

    1. lakor64 commented on May 10, 2021

      lakor64mannequin
      MannequinAuthor

      When linking any windows application with pythoncore built as a static library, such executable will automatically export all python c api functions and generate a static library.

      Exporting functions from a static library is a strange behavour, as I am not aware of any reason why dllimport/export should be used when building a static library.

      This behavour oncurrs because python's export.h doesn't know when the library is linked as shared or static.

      I have attached a patch that should fix this issue.
      Tested under Windows 10 + VS2019, a static linkage of Python3 does not produce any library file anymore, and such exports are no longer visible with Dependencies.

      I would like to apology if I got any tag wrong, as it's my first issue here.

    2. transferred this issue fromon Apr 10, 2022
    3. added 3 commits that reference this issue on Nov 30, 2022
    4. added a commit that references this issue on Dec 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesOS-windowstype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions