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

expat: Restore the use of pyexpatns.h to avoid link time conflicts vs other versions #79192

Closed
gpshead opened this issue Oct 18, 2018 · 7 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build deferred-blocker extension-modules C modules in the Modules dir

Comments

@gpshead
Copy link
Member

gpshead commented Oct 18, 2018

BPO 35011
Nosy @gpshead, @benjaminp, @ned-deily, @miss-islington
PRs
  • bpo-35011: Restore use of pyexpatns.h in libexpat #9939
  • [3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) #9940
  • [3.6] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) #9941
  • 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 = 'https://github.com/gpshead'
    closed_at = <Date 2018-10-18.02:07:24.193>
    created_at = <Date 2018-10-18.00:26:15.374>
    labels = ['extension-modules', '3.8', 'deferred-blocker', 'build', '3.7']
    title = 'expat: Restore the use of pyexpatns.h to avoid link time conflicts vs other versions'
    updated_at = <Date 2018-10-18.04:54:49.613>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2018-10-18.04:54:49.613>
    actor = 'benjamin.peterson'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2018-10-18.02:07:24.193>
    closer = 'gregory.p.smith'
    components = ['Build', 'Extension Modules']
    creation = <Date 2018-10-18.00:26:15.374>
    creator = 'gregory.p.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35011
    keywords = ['patch']
    message_count = 7.0
    messages = ['327919', '327920', '327921', '327924', '327927', '327928', '327934']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'benjamin.peterson', 'ned.deily', 'miss-islington']
    pr_nums = ['9939', '9940', '9941']
    priority = 'deferred blocker'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue35011'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @gpshead
    Copy link
    Member Author

    gpshead commented Oct 18, 2018

    These lines used to exist in Modules/expat/expat_external.h:

    /* Namespace external symbols to allow multiple libexpat version to
       co-exist. */
    #include "pyexpatns.h"

    5dc3f23#diff-3afaf7274c90ce1b7405f75ad825f545

    removed them during an expat upgrade.

    This causes link time conflicts when embedding Python using its own expat in an application that also uses libexpat from the C/C++ side on its own.

    @gpshead gpshead added 3.7 (EOL) end of life 3.8 only security fixes labels Oct 18, 2018
    @gpshead
    Copy link
    Member Author

    gpshead commented Oct 18, 2018

    Not a release blocker as most users probably do not run into this problem, but the pyexpatns.h mechanics should be restored.

    @gpshead gpshead added build The build process and cross-build extension-modules C modules in the Modules dir labels Oct 18, 2018
    @gpshead gpshead changed the title Update to expat removed the pyexpatns.h, causing link time symbol conflicts vs other versions in an application expat: Restore the use of pyexpatns.h to avoid link time conflicts vs other versions Oct 18, 2018
    @gpshead gpshead self-assigned this Oct 18, 2018
    @gpshead gpshead added the build The build process and cross-build label Oct 18, 2018
    @gpshead
    Copy link
    Member Author

    gpshead commented Oct 18, 2018

    This appears to not have been shipped in a release yet. It is new in 3.6.7. cc'ing ned daily to see if he wants to include the fix (the PR is trivial, coming ASAP).

    I don't have a good feel for how this impacts the real world or not.

    We noticed because we embed CPython in larger applications that use a different copy of libexpat on their own.

    @gpshead
    Copy link
    Member Author

    gpshead commented Oct 18, 2018

    New changeset 9d4712b by Gregory P. Smith in branch 'master':
    bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939)
    9d4712b

    @miss-islington
    Copy link
    Contributor

    New changeset 4bfecb9 by Miss Islington (bot) in branch '3.6':
    [3.6] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9941)
    4bfecb9

    @miss-islington
    Copy link
    Contributor

    New changeset 35ae99d by Miss Islington (bot) in branch '3.7':
    [3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9940)
    35ae99d

    @gpshead gpshead closed this as completed Oct 18, 2018
    @benjaminp
    Copy link
    Contributor

    Sorry for breaking that, and thanks for the fix!

    I'm curious, though, why are you still using the embedded expat rather than linking everything against the same expat?

    @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 3.8 only security fixes build The build process and cross-build deferred-blocker extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants