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

ifdef uses of EPOLLxxx macros so we can compile on systems that don't have them #67840

Closed
WanderingLogic mannequin opened this issue Mar 12, 2015 · 4 comments
Closed
Labels
build The build process and cross-build

Comments

@WanderingLogic
Copy link
Mannequin

WanderingLogic mannequin commented Mar 12, 2015

BPO 23652
Nosy @zware
Files
  • epoll-macros-patch.diff: Patch to wrap uses of unusual EPOLLxxx macros in ifdefs
  • 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 2015-08-02.02:39:58.132>
    created_at = <Date 2015-03-12.20:41:46.794>
    labels = ['build']
    title = "ifdef uses of EPOLLxxx macros so we can compile on systems that don't have them"
    updated_at = <Date 2015-08-02.02:40:31.203>
    user = 'https://bugs.python.org/WanderingLogic'

    bugs.python.org fields:

    activity = <Date 2015-08-02.02:40:31.203>
    actor = 'zach.ware'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-08-02.02:39:58.132>
    closer = 'python-dev'
    components = ['Build']
    creation = <Date 2015-03-12.20:41:46.794>
    creator = 'WanderingLogic'
    dependencies = []
    files = ['38461']
    hgrepos = []
    issue_num = 23652
    keywords = ['patch']
    message_count = 4.0
    messages = ['237984', '247733', '247850', '247851']
    nosy_count = 4.0
    nosy_names = ['neologix', 'python-dev', 'zach.ware', 'WanderingLogic']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue23652'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6']

    @WanderingLogic
    Copy link
    Mannequin Author

    WanderingLogic mannequin commented Mar 12, 2015

    With the LSB (Linux Standard Base) headers for libc Modules/selectmodule.c fails to compile because we have code that uses EPOLLRDNORM, EPOLLRDBAND, EPOLLWRNORM and EPOLLMSG without first checking that they are defined.

    The patch wraps the five uses of PyModule_AddIntMacro in #ifdefs, following exactly the same pattern that is used for the POLLRDNORM, POLLRDBAND, POLLWRNORM, POLLMSG macros 30 lines earlier in selectmodule.c.

    The only documentation I can find for these five macros from Linux is (a) in the Python documentation for the select module! (https://docs.python.org/3.4/library/select.html#edge-and-level-trigger-polling-epoll-objects) and (b) on this StackOverflow answer: http://stackoverflow.com/a/27143672/2209313.

    They are not described on http://man7.org/linux/man-pages/man2/epoll_ctl.2.html (where the rest of the EPOLL macros are defined), nor at http://linux.die.net/man/4/epoll. As explained by the StackOverflow answer they actually are described (indirectly) by http://man7.org/linux/man-pages/man2/poll.2.html.

    Nor are these macros in the Linux Foundation's LSB database: http://www.linuxbase.org/navigator/browse/headgroup.php?cmd=list-byheadgroup&HGid=1398.

    Obviously almost all modern Linuxes have these macros, so we should keep them, but we should also compile with the LSB headers (since compiling and linking against the LSB SDK (http://www.linuxfoundation.org/collaborate/workgroups/lsb/group) is one of the easiest ways to produce a Python binary that will actually run on most important supported Linux distros (e.g., RHEL 5).

    http://man7.org/linux/man-pages/man7/epoll.7.html,

    @WanderingLogic WanderingLogic mannequin added build The build process and cross-build labels Mar 12, 2015
    @zware
    Copy link
    Member

    zware commented Jul 31, 2015

    Looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 2, 2015

    New changeset e38470b49d3c by Zachary Ware in branch '2.7':
    Issue bpo-23652: Make the select module compile against LSB headers.
    https://hg.python.org/cpython/rev/e38470b49d3c

    New changeset c18a18b65a49 by Zachary Ware in branch '3.4':
    Issue bpo-23652: Make the select module compile against LSB headers.
    https://hg.python.org/cpython/rev/c18a18b65a49

    New changeset a99f17c752d8 by Zachary Ware in branch '3.5':
    Issue bpo-23652: Merge with 3.4
    https://hg.python.org/cpython/rev/a99f17c752d8

    New changeset c7273b46980c by Zachary Ware in branch 'default':
    Closes bpo-23652: Merge with 3.5
    https://hg.python.org/cpython/rev/c7273b46980c

    @python-dev python-dev mannequin closed this as completed Aug 2, 2015
    @zware
    Copy link
    Member

    zware commented Aug 2, 2015

    Thanks for the patch!

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

    No branches or pull requests

    1 participant