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

Python3.2.2 make fail on cygwin #57965

Closed
holgerd00d mannequin opened this issue Jan 10, 2012 · 19 comments
Closed

Python3.2.2 make fail on cygwin #57965

holgerd00d mannequin opened this issue Jan 10, 2012 · 19 comments
Labels
3.7 (EOL) end of life build The build process and cross-build

Comments

@holgerd00d
Copy link
Mannequin

holgerd00d mannequin commented Jan 10, 2012

BPO 13756
Nosy @loewis, @mhammond, @ezio-melotti, @merwok, @embray, @zware, @ma8ma
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • patch.xz: Patch file (xz compressed)
  • patch
  • 3.2.3-libpython-abi.patch
  • 0001-CYGWIN-issue13756-Python-make-fail-on-cygwin.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 2016-10-01.21:26:41.907>
    created_at = <Date 2012-01-10.12:44:18.463>
    labels = ['build', '3.7']
    title = 'Python3.2.2 make fail on cygwin'
    updated_at = <Date 2017-03-31.16:36:18.046>
    user = 'https://bugs.python.org/holgerd00d'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:18.046>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-10-01.21:26:41.907>
    closer = 'zach.ware'
    components = ['Build']
    creation = <Date 2012-01-10.12:44:18.463>
    creator = 'holgerd00d'
    dependencies = []
    files = ['24395', '24657', '25936', '28934']
    hgrepos = []
    issue_num = 13756
    keywords = ['patch', 'needs review']
    message_count = 19.0
    messages = ['151014', '151217', '151346', '152455', '154466', '154490', '162619', '162641', '181069', '181092', '181170', '181334', '273435', '277832', '277833', '278029', '278039', '278046', '278057']
    nosy_count = 14.0
    nosy_names = ['loewis', 'mhammond', 'jlt63', 'ezio.melotti', 'eric.araujo', 'rpetrov', 'yselkowitz', 'python-dev', 'erik.bray', 'holgerd00d', 'Luis.Marsano', 'zach.ware', 'Lohoris', 'masamoto']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue13756'
    versions = ['Python 3.7']

    @holgerd00d
    Copy link
    Mannequin Author

    holgerd00d mannequin commented Jan 10, 2012

    Downloaded Python-3.2.2.tar
    cd Python-3.2.2
    ./configure
    make
    ....
    Fail on:
    --------------------
    .....
    ranlib libpython3.2m.a
    make: *** No rule to make target libpython3.2m.dll.a', needed by python.exe'. Stop.
    --------------------

    libpython3.2m.a was built successfully:
    --------------------

    $ ls -l libpython3.2m.a
    -rw-r--r--+ 1 hbille Domain Users 7182050 Jan 10 13:31 libpython3.2m.a

    I am not sure which part is incorrect. The name with or without "dll"

    @holgerd00d holgerd00d mannequin added the topic-installation label Jan 10, 2012
    @merwok
    Copy link
    Member

    merwok commented Jan 14, 2012

    I am not sure building CPython with Cygwin is supported.

    @LuisMarsano
    Copy link
    Mannequin

    LuisMarsano mannequin commented Jan 16, 2012

    The README file implies support:
    [⋮]
    Build Instructions
    ------------------

    On Unix, Linux, BSD, OSX, and Cygwin:
    [⋮]

    @LuisMarsano LuisMarsano mannequin added build The build process and cross-build and removed topic-installation labels Jan 16, 2012
    @LuisMarsano
    Copy link
    Mannequin

    LuisMarsano mannequin commented Feb 2, 2012

    Got it to build. Unpack the Python (3.2.2) source package and apply this patch to get a package that builds on Cygwin (1.7.9), eg:
    xz -d patch.xz && tar -xJf Python-3.2.2.tar.xz && patch -p0 -i patch

    Changes:
    (1) The Makefile, makesetup, and distutils.UnixCCompiler and distutils.command.build_ext modules set values for locating cygwin's python library that didn't agree or make sense during buildtime, so I revised them to agree and use build options that work.
    (2) configuration and setup.py couldn't locate cygwin's ncurses headers, so I revised them to do that. I don't think I made that change as portable friendly as possible, so someone please check that and find a better way.

    Your input is welcome.

    @merwok
    Copy link
    Member

    merwok commented Feb 27, 2012

    Martin, any input?

    Uncompressed patch attached. Plain text files are easier to review and devoid of security issues (unlike executables on Windows, PDFs if you’re using Adobe Reader, etc.).

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Feb 27, 2012

    The removal of testing for ncurses.h is incorrect: this should break the Linux build, where ncurses.h is indeed commonly located in /usr/include.

    Not sure how to proceed here: if somebody would try to reproduce the problem, they would likely come up with a patch which is fairly different from the one you are proposing.

    So, Luis: are you interested in working out a complete and correct patch? If so, please start with generating one that is against the hg 3.2 branch (or perhaps even against the default branch). It's ok if you are not interested, in that case we'll need to wait for some other volunteer.

    @Lohoris Lohoris mannequin added the build The build process and cross-build label Apr 24, 2012
    @jlt63
    Copy link
    Mannequin

    jlt63 mannequin commented Jun 11, 2012

    I offer the attached patch for consideration. AFAICT, only the Makefile.pre.in and build_ext.py changes are required. I included the makesetup change for completeness and to be consistent with the other changes.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Jun 11, 2012

    Hi Jason,
    if you look in default rule you will see the same, so this relict specific "else case" could be removed. Also in Lib/packaging/command/build_ext.py.

    @ezio-melotti
    Copy link
    Member

    Is this still an issue on 3.3/3.4? Does the patch still work?

    @jlt63
    Copy link
    Mannequin

    jlt63 mannequin commented Feb 1, 2013

    Is this still an issue on 3.3/3.4?

    I presume so.

    Does the patch still work?

    I haven't tried it on 3.3 yet, so I don't know if it will apply cleanly.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Feb 2, 2013

    Jason Tishler wrote:

    Jason Tishler added the comment:

    > Is this still an issue on 3.3/3.4?
    I presume so.
    This build is broken since SOABI implementation.

    > Does the patch still work?
    I haven't tried it on 3.3 yet, so I don't know if it will apply cleanly.
    Attached "0001-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch" for head.
    This patch is part of split bpo-3871 into small independent changes.

    Roumen

    @merwok
    Copy link
    Member

    merwok commented Feb 4, 2013

    I have no objection to the patch. I can’t test it on cygwin (unless snakebite provides it, I’ll ask) but I can check that a linux build still works.

    @embray
    Copy link
    Contributor

    embray commented Aug 23, 2016

    I can confirm that the last attached patch on this issue fixes this particular issue with building on Cygwin. There are other issues but this is definitely one of them.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 1, 2016

    New changeset 5b4c21436036 by Zachary Ware in branch 'default':
    Issue bpo-13756: Fix building extensions modules on Cygwin
    https://hg.python.org/cpython/rev/5b4c21436036

    @zware
    Copy link
    Member

    zware commented Oct 1, 2016

    Fixed on 3.7, we can evaluate backporting later. With this committed, a build on Cygwin can succeed if you configure with --without-threads.

    Thanks for the patch!

    @zware zware closed this as completed Oct 1, 2016
    @embray
    Copy link
    Contributor

    embray commented Oct 4, 2016

    FWIW, even with this patch and --without-threads Python does *not* build successfully on Cygwin64 (which is all I'm really interested in personally), though it does succeed on 32-bit Cygwin. This has two related reasons:

    1. The build of Python's bundled libffi does not work on 64-bit Cygwin for at least a few reasons that I won't go into here. There doesn't seem to be a ticket yet for that so I'll open one.

    2. Using --with-system-ffi doesn't work for reasons I talked about in bpo-2445, and also discussed a bit in bpo-1706863

    @zware
    Copy link
    Member

    zware commented Oct 4, 2016

    Hmm, Cygwin64 is what I built on (successfully). _ctypes does not build, but that's due to not having any libffi available at all: the bundled copy is no longer included in 3.7, and I didn't install a system copy. I view ctypes support as a fairly low-priority item; we have much bigger issues to worry about first :). If trying to build _ctypes actually crashes your build, I think '--without-system-ffi' might be enough to get it to error out cleanly.

    @zware zware added the 3.7 (EOL) end of life label Oct 4, 2016
    @embray
    Copy link
    Contributor

    embray commented Oct 4, 2016

    Okay, that would explain it then. I was building from an older branch (pre-3.7) that still has the bundled libffi.

    FWIW with the fix from bpo-2445, --with-system-ffi works (as does some trivial use of _ctypes though I haven't run all the tests). So if the bundled libffi is gone then I guess that's a moot point.

    Thanks for getting a bunch of these fixes merged.

    @zware
    Copy link
    Member

    zware commented Oct 4, 2016

    No problem. Feel free to nosy me on any Cygwin issues that you feel have consensus on the solution and a commit-ready patch implementing it. I can't guarantee when I'll have time to look at them, but I have finally gotten around to installing Cygwin and will get to them eventually :)

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants