Skip to content

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

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

Closed
lakor64 mannequin opened this issue May 10, 2021 · 1 comment · Fixed by #99888
Closed

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

lakor64 mannequin opened this issue May 10, 2021 · 1 comment · Fixed by #99888
Labels
3.11 only security fixes OS-windows type-bug An unexpected behavior, bug, or error

Comments

@lakor64
Copy link
Mannequin

lakor64 mannequin commented May 10, 2021

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

    @lakor64
    Copy link
    Mannequin Author

    lakor64 mannequin commented May 10, 2021

    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.

    @lakor64 lakor64 mannequin added 3.11 only security fixes OS-windows type-bug An unexpected behavior, bug, or error labels May 10, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    lakor64 added a commit to lakor64/cpython that referenced this issue Nov 30, 2022
    lakor64 added a commit to lakor64/cpython that referenced this issue Nov 30, 2022
    lakor64 added a commit to lakor64/cpython that referenced this issue Nov 30, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes OS-windows type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    0 participants