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

Failed to compile with --enable-framework on macOS on master #82610

Closed
HarukaMa mannequin opened this issue Oct 10, 2019 · 7 comments
Closed

Failed to compile with --enable-framework on macOS on master #82610

HarukaMa mannequin opened this issue Oct 10, 2019 · 7 comments
Labels
3.9 only security fixes build The build process and cross-build OS-mac

Comments

@HarukaMa
Copy link
Mannequin

HarukaMa mannequin commented Oct 10, 2019

BPO 38429
Nosy @ronaldoussoren, @vstinner, @ned-deily
PRs
  • bpo-38353: Fix typos in calculate_argv0_path_framework() #16695
  • 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 2019-10-10.13:43:11.012>
    created_at = <Date 2019-10-10.08:47:11.301>
    labels = ['OS-mac', 'build', '3.9']
    title = 'Failed to compile with --enable-framework on macOS on master'
    updated_at = <Date 2019-10-10.13:59:51.249>
    user = 'https://bugs.python.org/HarukaMa'

    bugs.python.org fields:

    activity = <Date 2019-10-10.13:59:51.249>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-10.13:43:11.012>
    closer = 'vstinner'
    components = ['macOS']
    creation = <Date 2019-10-10.08:47:11.301>
    creator = 'Haruka Ma'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38429
    keywords = ['patch']
    message_count = 7.0
    messages = ['354348', '354359', '354361', '354367', '354370', '354371', '354377']
    nosy_count = 4.0
    nosy_names = ['ronaldoussoren', 'vstinner', 'ned.deily', 'Haruka Ma']
    pr_nums = ['16695']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue38429'
    versions = ['Python 3.9']

    @HarukaMa
    Copy link
    Mannequin Author

    HarukaMa mannequin commented Oct 10, 2019

    Since commit c02b41b , some syntax errors are preventing cpython from compiling with --enable-framework on.

    Specifically, the errors are in Modules/getpath.c on line 1134 and 1165.

    I've made some inline comments on github as well.

    @HarukaMa HarukaMa mannequin added 3.9 only security fixes OS-mac build The build process and cross-build labels Oct 10, 2019
    @vstinner
    Copy link
    Member

    Oh, I expected that we had macOS buildbots building Python with --enable-framework. Thanks for the reporting the issue.

    I wrote PR 16695 which should fix the issue, but I cannot test my fix right now.

    @HarukaMa
    Copy link
    Mannequin Author

    HarukaMa mannequin commented Oct 10, 2019

    I'm now getting double free on the same function:

    https://pastebin.com/zHWCtTuV (with debug on)

    @vstinner
    Copy link
    Member

    Hum, getpath.c seems to use deprecated APIs:

    ./Modules/getpath.c:1098:20: warning: 'NSModuleForSymbol' is deprecated: first deprecated in macOS 10.5 - dladdr() [-Wdeprecated-declarations]
        pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize"));
                       ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:193:21: note: 'NSModuleForSymbol' has been explicitly marked deprecated here
    extern NSModule     NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos)  __OSX_DEPRECATED(10.1, 10.5, "dladdr()");
                        ^
    ./Modules/getpath.c:1098:38: warning: 'NSLookupAndBindSymbol' is deprecated: first deprecated in macOS 10.4 - dlsym() [-Wdeprecated-declarations]
        pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize"));
                                         ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:183:17: note: 'NSLookupAndBindSymbol' has been explicitly marked deprecated here
    extern NSSymbol NSLookupAndBindSymbol(const char* symbolName)                                                    __API_UNAVAILABLE(ios, tvos, watchos)  __OSX_DEPRECATED(10...
                    ^
    ./Modules/getpath.c:1101:27: warning: 'NSLibraryNameForModule' is deprecated: first deprecated in macOS 10.5 [-Wdeprecated-declarations]
        const char* modPath = NSLibraryNameForModule(pythonModule);
                              ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:163:21: note: 'NSLibraryNameForModule' has been explicitly marked deprecated here
    extern const char*  NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos)  __OSX_DEPRECATED(10.1, 10.5, "");
                        ^
    3 warnings generated.

    @vstinner
    Copy link
    Member

    New changeset b6e0fc7 by Victor Stinner in branch 'master':
    bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)
    b6e0fc7

    @vstinner
    Copy link
    Member

    Thanks for the bug report Haruka Ma, it should now be fixed.

    @ronaldoussoren
    Copy link
    Contributor

    W.r.t. the deprecated APIs in getpath.c: bpo-15498

    That issue contains an ancient patch to switch to non-deprecated APIs, but we haven't had time yet to fully test these. The issue also mentions that Apple's install of Python already switched away from the deprecated APIs, but had some issues at the time.

    @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 build The build process and cross-build OS-mac
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants