Skip to content
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

python3.lib in Python3.9.0 Windows distribution does not contain PyObject_CallNoArgs symbol #86581

Closed
DavidHewitt mannequin opened this issue Nov 19, 2020 · 5 comments
Closed
Labels
3.9 only security fixes 3.10 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir OS-windows topic-C-API

Comments

@DavidHewitt
Copy link
Mannequin

DavidHewitt mannequin commented Nov 19, 2020

BPO 42415
Nosy @pfmoore, @vstinner, @tjguk, @alex, @zware, @zooba, @ZackerySpytz
PRs
  • bpo-42415: Add PyObject_CallNoArgs to PC\python3dll.c #23415
  • [3.9] bpo-42415: Add symbols of the stable ABI to python3dll.c (GH-23598) #23801
  • 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 = <Date 2020-12-16.21:43:38.059>
    created_at = <Date 2020-11-19.22:47:45.721>
    labels = ['3.9', '3.10', 'extension-modules', 'expert-C-API', 'build', 'OS-windows']
    title = 'python3.lib in Python3.9.0 Windows distribution does not contain PyObject_CallNoArgs symbol'
    updated_at = <Date 2020-12-16.21:43:38.058>
    user = 'https://bugs.python.org/DavidHewitt'

    bugs.python.org fields:

    activity = <Date 2020-12-16.21:43:38.058>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-12-16.21:43:38.059>
    closer = 'vstinner'
    components = ['Extension Modules', 'Windows', 'C API']
    creation = <Date 2020-11-19.22:47:45.721>
    creator = 'David Hewitt'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42415
    keywords = ['patch']
    message_count = 5.0
    messages = ['381458', '381459', '381460', '383170', '383211']
    nosy_count = 8.0
    nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'alex', 'zach.ware', 'steve.dower', 'ZackerySpytz', 'David Hewitt']
    pr_nums = ['23415', '23801']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue42415'
    versions = ['Python 3.9', 'Python 3.10']

    @DavidHewitt
    Copy link
    Mannequin Author

    DavidHewitt mannequin commented Nov 19, 2020

    I'm unsure if this is a packaging error or a misunderstanding by me.

    I'm trying to link a binary on windows with Py_LIMITED_API set. According to https://www.python.org/dev/peps/pep-0384/#linkage I _think_ I'm supposed to be linking against python3.lib (instead of python39.lib).

    However my build fails because the PyObject_CallNoArgs symbol is not present in python3.lib

    I see that the symbol is indeed present in python39.lib

    Is this a misunderstanding on my part? I was under the impression that python3.lib will only contain symbols available in the limited api, and that (since 3.9) PyObject_CallNoArgs is part of the limited api.

    @DavidHewitt DavidHewitt mannequin added 3.9 only security fixes OS-windows build The build process and cross-build labels Nov 19, 2020
    @alex
    Copy link
    Member

    alex commented Nov 19, 2020

    This looks like a bug to me. While 2ff58a2 added it to the header, it did not add it to https://github.com/python/cpython/blob/master/PC/python3dll.c which is required.

    @alex alex added extension-modules C modules in the Modules dir labels Nov 19, 2020
    @zooba
    Copy link
    Member

    zooba commented Nov 20, 2020

    Yeah, this will be our fault.

    Someone is looking into automatically generating the .def file so that this stops happening. Last time we tried that there was a lot of pushback because "too many APIs will become stable", but this time I think we're just going to force those devs to care for their APIs properly.

    (I'm blanking right now on who was working on this... anyone remember?)

    @alex alex added topic-C-API 3.10 only security fixes labels Nov 20, 2020
    @vstinner
    Copy link
    Member

    commit fcc6935
    Author: Victor Stinner <vstinner@python.org>
    Date: Wed Dec 16 15:08:23 2020 +0100

    Add symbols of the stable ABI to python3dll.c (GH-23598)
    
    Add the following symbols to python3dll.c:
    
    * PyFrame_GetCode (bpo-40421)
    * PyFrame_GetLineNumber (bpo-40421)
    * PyModule_AddObjectRef (bpo-1635741)
    * PyObject_CallNoArgs (bpo-37194)
    * PyThreadState_GetFrame (bpo-39947)
    * PyThreadState_GetID (bpo-39947)
    * PyThreadState_GetInterpreter (bpo-39947)
    

    I backported the change manually to 3.9: PR 23801.

    @vstinner
    Copy link
    Member

    Thanks David Hewitt for the bug report, and Zackery Spytz for your fix!

    3.9 fix:

    commit 1662868
    Author: Victor Stinner <vstinner@python.org>
    Date: Wed Dec 16 22:41:47 2020 +0100

    Add symbols of the stable ABI to python3dll.c (GH-23598) (GH-23801)
    
    Add the following symbols to python3dll.c:
    
    * PyFrame_GetCode (bpo-40421)
    * PyFrame_GetLineNumber (bpo-40421)
    * PyObject_CallNoArgs (bpo-37194)
    * PyThreadState_GetFrame (bpo-39947)
    * PyThreadState_GetID (bpo-39947)
    * PyThreadState_GetInterpreter (bpo-39947)
    
    (cherry picked from commit fcc6935384b933fbe1a1ef659ed455a3b74c849a)
    

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir OS-windows topic-C-API
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants