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

move pygetopt.h into internal/ #76445

Closed
benjaminp opened this issue Dec 9, 2017 · 6 comments
Closed

move pygetopt.h into internal/ #76445

benjaminp opened this issue Dec 9, 2017 · 6 comments
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@benjaminp
Copy link
Contributor

BPO 32264
Nosy @db3l, @ronaldoussoren, @benjaminp, @ned-deily
PRs
  • move pygetopt.h to internal (closes bpo-32264) #4830
  • add 'extern' to pygetopt.h symbols, so then don't end up in comdat #4909
  • bpo-35081: Rename internal headers #10275
  • 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 2017-12-15.07:48:14.932>
    created_at = <Date 2017-12-09.22:08:43.880>
    labels = ['interpreter-core', 'type-feature', '3.7']
    title = 'move pygetopt.h into internal/'
    updated_at = <Date 2018-11-12.15:31:47.480>
    user = 'https://github.com/benjaminp'

    bugs.python.org fields:

    activity = <Date 2018-11-12.15:31:47.480>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-12-15.07:48:14.932>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2017-12-09.22:08:43.880>
    creator = 'benjamin.peterson'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32264
    keywords = ['patch']
    message_count = 6.0
    messages = ['307925', '308367', '308482', '308483', '308492', '308494']
    nosy_count = 4.0
    nosy_names = ['db3l', 'ronaldoussoren', 'benjamin.peterson', 'ned.deily']
    pr_nums = ['4830', '4909', '10275']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32264'
    versions = ['Python 3.7']

    @benjaminp
    Copy link
    Contributor Author

    This header has no public functions. It shouldn't be distributed.

    @benjaminp benjaminp added 3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Dec 9, 2017
    @benjaminp
    Copy link
    Contributor Author

    New changeset e425bd7 by Benjamin Peterson in branch 'master':
    move pygetopt.h to internal (closes bpo-32264) (bpo-4830)
    e425bd7

    @db3l
    Copy link
    Contributor

    db3l commented Dec 17, 2017

    This commit appears to have broken OSX installer builds using the build-installer.py script (as in the last two attempts on the bolen-dmg-3.x builder), confirmed with a bisection from the first failing worker build (covering the range 02a0a19..3327a2d)

    It fails during the main python compilation with:

    ld: multiple definitions of symbol __PyOS_optarg
    libpython3.7m.a(getopt.o) definition of __PyOS_optarg in section (__DATA,__data)
    libpython3.7m.a(main.o) definition of __PyOS_optarg in section (__DATA,__common)
    ld: multiple definitions of symbol __PyOS_opterr

    (repeated for the various __PyOS__opt* symbols.

    It doesn't seem to be a problem with a simple manual configure/make build (probably why the regular OSX workers aren't failing).

    So best guess at the moment is it's related to one of the extra configure options used by the build-installer script. I'm not sure which of the commit or build process needs correction, although reverting this at least temporarily would resolve the immediate issue.

    @db3l
    Copy link
    Contributor

    db3l commented Dec 17, 2017

    After some further testing, it does not appear to be configure related but something environmental (maybe MACOSX_DEPLOYMENT_TARGET) - using the same configure options manually as build-installer seems ok.

    For what it's worth, since there do appear to be duplicate definitions in pygetopt.h and getopt.c, adding "extern" to the declarations in pygetopt.h appears to resolve the issue. It looks like that was lost with the removal of PyAPI_DATA.

    @benjaminp
    Copy link
    Contributor Author

    Thanks the report and debugging. You're exactly right—I forgot to add extern.

    @benjaminp
    Copy link
    Contributor Author

    New changeset 4c72bc4 by Benjamin Peterson in branch 'master':
    add 'extern' to pygetopt.h symbols, so then don't end up in comdat (bpo-4909)
    4c72bc4

    @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.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants