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

Statically linking pyexpat in Modules/Setup fails to compile on macOS #79320

Closed
MaximeBelanger mannequin opened this issue Nov 1, 2018 · 6 comments
Closed

Statically linking pyexpat in Modules/Setup fails to compile on macOS #79320

MaximeBelanger mannequin opened this issue Nov 1, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir OS-mac

Comments

@MaximeBelanger
Copy link
Mannequin

MaximeBelanger mannequin commented Nov 1, 2018

BPO 35139
Nosy @ronaldoussoren, @benjaminp, @ned-deily, @miss-islington
PRs
  • bpo-35139: The pyexpat module's macros in Modules/Setup now matches setup.py #10289
  • [3.7] closes bpo-35139: The pyexpat module's macros in Modules/Setup now match setup.py (GH-10289) #10291
  • [3.6] closes bpo-35139: The pyexpat module's macros in Modules/Setup now match setup.py (GH-10289) #10292
  • [2.7] closes bpo-35139: The pyexpat module's macros in Modules/Setup now match setup.py (GH-10289) #10293
  • 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 2018-11-02.02:49:49.634>
    created_at = <Date 2018-11-01.21:56:10.866>
    labels = ['extension-modules', 'OS-mac', '3.8', 'build', '3.7']
    title = 'Statically linking pyexpat in Modules/Setup fails to compile on macOS'
    updated_at = <Date 2018-11-02.03:32:33.707>
    user = 'https://bugs.python.org/MaximeBelanger'

    bugs.python.org fields:

    activity = <Date 2018-11-02.03:32:33.707>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-11-02.02:49:49.634>
    closer = 'benjamin.peterson'
    components = ['Build', 'Extension Modules', 'macOS']
    creation = <Date 2018-11-01.21:56:10.866>
    creator = 'Maxime Belanger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35139
    keywords = ['patch']
    message_count = 6.0
    messages = ['329089', '329090', '329100', '329101', '329102', '329104']
    nosy_count = 5.0
    nosy_names = ['ronaldoussoren', 'benjamin.peterson', 'ned.deily', 'Maxime Belanger', 'miss-islington']
    pr_nums = ['10289', '10291', '10292', '10293']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue35139'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @MaximeBelanger
    Copy link
    Mannequin Author

    MaximeBelanger mannequin commented Nov 1, 2018

    Uncommenting the following line in [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup) leads to a compiler error on macOS (tested w/ Xcode 10):

    ./Modules/expat/xmlparse.c:92:3: error: You do not have support for any sources of high quality entropy enabled. For end user security, that is probably not what you want.
          Your options include: * Linux + glibc >=2.25 (getrandom): HAVE_GETRANDOM, * Linux + glibc <2.25 (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, * BSD / macOS >=10.7
          (arc4random_buf): HAVE_ARC4RANDOM_BUF, * BSD / macOS <10.7 (arc4random): HAVE_ARC4RANDOM, * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, * libbsd
          (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, * Linux / BSD / macOS (/dev/urandom): XML_DEV_URANDOM * Windows (RtlGenRandom): _WIN32. If insist on not using any of
          these, bypass this error by defining XML_POOR_ENTROPY; you have been warned. If you have reasons to patch this detection code away or need changes to the build system,
          please open a bug. Thank you!
    

    I believe this is due to setup.py being out of sync with [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup), which defines XML_POOR_ENTROPY. I'll attach a patch that resolves the issue for me.

    @MaximeBelanger MaximeBelanger mannequin added 3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir OS-mac labels Nov 1, 2018
    @MaximeBelanger
    Copy link
    Mannequin Author

    MaximeBelanger mannequin commented Nov 1, 2018

    The line in question being:

    #pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
    

    @benjaminp
    Copy link
    Contributor

    New changeset 318ab63 by Benjamin Peterson (Max Bélanger) in branch 'master':
    closes bpo-35139: The pyexpat module's macros in [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup) now match setup.py (GH-10289)
    318ab63

    @miss-islington
    Copy link
    Contributor

    New changeset 04c9666 by Miss Islington (bot) in branch '3.7':
    closes bpo-35139: The pyexpat module's macros in [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup) now match setup.py (GH-10289)
    04c9666

    @benjaminp
    Copy link
    Contributor

    New changeset a614cc9 by Benjamin Peterson in branch '2.7':
    [2.7] closes bpo-35139: The pyexpat module's macros in [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup) now match setup.py (GH-10293)
    a614cc9

    @miss-islington
    Copy link
    Contributor

    New changeset 2339fe7 by Miss Islington (bot) in branch '3.6':
    closes bpo-35139: The pyexpat module's macros in [Modules/Setup](https://github.com/python/cpython/blob/main/Modules/Setup) now match setup.py (GH-10289)
    2339fe7

    @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 extension-modules C modules in the Modules dir OS-mac
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants