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

Fixed compile on cygwin. #73904

Closed
AraHaan mannequin opened this issue Mar 4, 2017 · 16 comments
Closed

Fixed compile on cygwin. #73904

AraHaan mannequin opened this issue Mar 4, 2017 · 16 comments
Labels
3.7 (EOL) end of life build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-installation

Comments

@AraHaan
Copy link
Mannequin

AraHaan mannequin commented Mar 4, 2017

BPO 29718
Nosy @vstinner, @embray, @ma8ma, @AraHaan
PRs
  • bpo-29718: Fixed compile on cygwin. #447
  • Files
  • cygwin_build.patch
  • 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-09-11.03:55:14.277>
    created_at = <Date 2017-03-04.03:49:42.787>
    labels = ['interpreter-core', 'build', 'expert-installation', '3.7']
    title = 'Fixed compile on cygwin.'
    updated_at = <Date 2017-09-11.03:55:14.276>
    user = 'https://github.com/AraHaan'

    bugs.python.org fields:

    activity = <Date 2017-09-11.03:55:14.276>
    actor = 'Decorater'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-11.03:55:14.277>
    closer = 'Decorater'
    components = ['Build', 'Installation', 'Interpreter Core']
    creation = <Date 2017-03-04.03:49:42.787>
    creator = 'Decorater'
    dependencies = []
    files = ['46698']
    hgrepos = []
    issue_num = 29718
    keywords = ['patch']
    message_count = 16.0
    messages = ['288949', '288954', '288955', '288956', '288957', '288958', '288961', '288968', '288969', '288975', '288982', '288983', '289008', '289012', '291969', '301855']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'erik.bray', 'masamoto', 'Decorater']
    pr_nums = ['447']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue29718'
    versions = ['Python 3.7']

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    Cygwin had an issue with building and installing python after it was configured. The main issue was the TLS key stuff which would make python fail to fully build or work correctly. This issue contains a patch for cygwin specifically to make it compile and work fully. It uses the __CYGWIN__ macro for separating the code from this patch with the TLS code on the other targets. This should help fix issues that was present in the standard library and setup.py in the repo for cygwin as well.

    @AraHaan AraHaan mannequin added 3.7 (EOL) end of life build The build process and cross-build topic-installation interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Mar 4, 2017
    @vstinner
    Copy link
    Member

    vstinner commented Mar 4, 2017

    #324 (comment)

    @AraHaan: "By the way guys I will be working on cpython to work on some changes to a few things for cygwin to compile using the official cpython source code on 3.5, 3.6, and 3.7. (...)"

    Cygwin is not currently officially supported by CPython (or am I wrong?), so changes should only be made in Python 3.7 (master branch). I'm neutral on supporting Cygwin. In the meanwhile, you can prepare a CPython fork, and then come back with atomic commits as PR? Since I expect many changes, you may also discuss Cygwin support on python-dev.

    What is the current status of the Cygwin support? Is it possible to build Python using Cygwin? How many tests fail?

    To have an official support, we need an assigned developer and a buildbot:
    https://www.python.org/dev/peps/pep-0011/#supporting-platforms

    @vstinner
    Copy link
    Member

    vstinner commented Mar 4, 2017

    +/* Define if pthread_key_t is compatible with int. */
    +#undef PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT

    Is this change the implementation of the issue bpo-25658?

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    Yes, it is because of the fact in Cygwin it will cause an compile Error when ints are involved forcing other methods to be put in place.

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    For now I stuck it under cygwin only but it could easily move out to not only cygwin if desired.

    @vstinner
    Copy link
    Member

    vstinner commented Mar 4, 2017

    Please explain why you want to support Cygwin. Which Cygwin and Windows versions are you targetingW

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    I use cygwin to test things that I write in python to see if they work under linux without having to boot up into an linux VM to find out as it would be too slow to even do that with the computer I have. And besides cygwin makes all of this faster. The version of Cygwin I have is 2.877 (64 bit).

    Long story short this thing for a 64 bit computer is limited to only 2 CPU cores and 4 GB's of memory right now. All of that plays into why an VM would be too slow to even run or compile python (it would take forever to even open up the terminal).

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    Well then I am thinking about figuring out how to make an batch file under tools/buildbot to target cygwin building in windows. tbh windows 7 or newer on cygwin is fine with me. It is just that I need to figure out how to make it invoke Cygwin.bat and yet also somehow input everything it needs to the cygwin console for building and testing python.

    Feel free to let me know if anyone has an idea on this.

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    Also I just realized my Cygwin updated to 2.7.0 as well.

    @ma8ma
    Copy link
    Mannequin

    ma8ma mannequin commented Mar 4, 2017

    The patch can split to several issues, moreover, some issues are able to pick up as general not Cygwin specific. Perhaps, it will be an opportunity to fix even if Cygwin specific, if we could explain the implicit issue on implementation. See bpo-4032, bpo-25658, bpo-25720, bpo-27374, bpo-28441 and bpo-28459. Of course your patch has solutions for issues that are not yet known in the bug tracker.

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    hmm maybe if TSS is available on all platforms maybe python could use that instead of TLS so that way I would not have to have a lot of __CYGWIN__'s all over the place. However I am not sure if all of the OS's that are on the buildbot for python supports TSS. hmm

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Mar 4, 2017

    And yeah that is why I stuck most of the changes in here under __CYGWIN__ macros for now until I know otherwise that all of the changes will not break other platforms.

    @ma8ma
    Copy link
    Mannequin

    ma8ma mannequin commented Mar 5, 2017

    We should avoid to submit quickfix to official as much as we can. Especially the case of unofficial (or inarticulate) support platform, a patch for specific platform is probably rejected because the code won't be maintained.

    Thread Specific Storage API (TSS) has been designed to work on more platforms, but it has incompatible changing and the API merging needs official acceptance for the PEP-539. (Please wait PEP author, or you can discuss for the new API or alternatives, see bpo-25658 for details)

    @vstinner
    Copy link
    Member

    vstinner commented Mar 5, 2017

    Please remove TSS from the Cygwin patch in that case.

    @embray
    Copy link
    Contributor

    embray commented Apr 20, 2017

    This seems to be fixing a number of different Cygwin issues, many of which are known (some of these patches come from the Cygwin port of Python). However, some of these issues are already being handled separately, such as bpo-25658, and I think rather than one big mongo patch it wold be good to break this up into individual issues.

    I was also just planning to submit some individual patches for review.

    @AraHaan
    Copy link
    Mannequin Author

    AraHaan mannequin commented Sep 11, 2017

    Closing this in favor of https://www.python.org/dev/peps/pep-0539/.

    @AraHaan AraHaan mannequin closed this as completed Sep 11, 2017
    @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 build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-installation
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants