classification
Title: Add disclaimer about MinGW compat in distutils docs
Type: Stage: resolved
Components: Distutils, Distutils2, Documentation, Library (Lib), Windows Versions: Python 3.1, Python 3.2, Python 2.7, 3rd party
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, exarkun, lambacck, loewis, pitrou, tarek
Priority: normal Keywords: patch

Created on 2009-05-12 21:45 by exarkun, last changed 2010-12-15 22:21 by eric.araujo. This issue is now closed.

Files
File name Uploaded Description Edit
updated_mingw_docs.patch lambacck, 2010-11-20 21:57 Patch to update mingw docs against py3k branch.
Messages (12)
msg87660 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2009-05-12 21:45
Per issue3308, it is not really possible to build Python extensions with
MinGW anymore (as far as I can tell).  The distutils documentation is
misleading in this regard, as is the continued existence of the
build_ext --compiler=mingw32 option.  The result of using this feature
is a dll which cannot actually be loaded.

If my understanding of the issue is correct, then the mingw32 compiler
should be removed from distutils and the documentation corrected to
indicate the lack of support for this compiler toolchain.
msg87661 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-12 21:47
(or perhaps an announcement can be made on distutils-sig in the hope
that someone step up and fix mingw support?)
msg87667 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-13 03:03
> Per issue3308, it is not really possible to build Python extensions with
> MinGW anymore (as far as I can tell).

I'm interpreting the issue differently - it was withdrawn by the
submitter, indicating that it isn't an issue with Python.

Even though I still don't understand the original issue, apparently,
it is an issue only if the localtime() function is used. Extensions
that don't use it might still work fine, according to the report.

> If my understanding of the issue is correct, then the mingw32 compiler
> should be removed from distutils and the documentation corrected to
> indicate the lack of support for this compiler toolchain.

I think this is exaggerating the actual state. The compiler is certainly
supported.
msg87680 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2009-05-13 12:14
> Even though I still don't understand the original issue, apparently,
> it is an issue only if the localtime() function is used. Extensions
> that don't use it might still work fine, according to the report.

I have an extension which doesn't use it and can't be loaded when built
with mingw32, so I think the issue goes beyond localtime().

> I think this is exaggerating the actual state. The compiler is
> certainly supported.

Can you elaborate on what "supported" means?  To me, it would mean that
it could build all the same Python extensions which MSVC can build.
msg87701 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-13 18:47
>> I think this is exaggerating the actual state. The compiler is
>> certainly supported.
> 
> Can you elaborate on what "supported" means?  To me, it would mean that
> it could build all the same Python extensions which MSVC can build.

"Supported" means that it will invoke the compiler with the right
command line arguments.

It can't possibly mean what you suggest: gcc simply cannot compile all
code that MSVC can compile - in particular, will will not support many
of the VC extensions to C that a Python extension module may use. COM
interfaces are particularly difficult, making it fail on, e.g. PyWin32.
This was always the case, and never stopped people contributing mingw
support.
msg121768 - (view) Author: Chris Lambacher (lambacck) * Date: 2010-11-20 20:53
I just compiled the zope.interface c speedups with MinGW on Python 2.7 and 2.6. 

There is a patch being tracked in the MinGW patch tracker <http://sourceforge.net/tracker/index.php?func=detail&aid=2134161&group_id=2435&atid=302435> related to the localtime linking issue, but there is no indication that the patch was accepted.

My experience with MinGW has been that it almost always works except where C++ is used or MinGW itself trips on a MSVCRT issue. Perhaps a note about that would be sufficient to close this bug?
msg121789 - (view) Author: Chris Lambacher (lambacck) * Date: 2010-11-20 21:57
I'm attaching a patch that includes a disclaimer about some extensions not being able to compile and mentioning some of Martin's specifics.

I also reorganized the instructions to more directly reflect the current state. This puts the common instructions front and center and makes it more clear which instructions are directed at users of old python and MingGW versions. We might want to take those instructions out altogether given that the versions mentioned are pretty old (circa 2005).
msg121792 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-20 22:07
distutils docs only get changes that fix a bug (e.g. an example that does not work), not improvements or reorganization.  Your patch is in a gray area; I think we should not accept it in distutils but re-target it at distutils2.  Even if you refresh it against distutils2, I will wait for an agreement between Jean-Paul and Martin before committing it, since I can’t assess the situation alone.  Thank your for your wanting to help.
msg121805 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-11-20 22:41
The changes look fine to me.
msg121812 - (view) Author: Chris Lambacher (lambacck) * Date: 2010-11-20 23:20
Eric,

This documentation is "Installing Python Modules" which is focused on Distutils, but presumably we would continue to want such a document and account for both Disutils and Disutils2 (once people start using it). 

I think my patch addresses the misleading content regarding the need to use pexports and dlltool and more directly instructs people that want to install the vast majority of current Python packages. If it is pertinent to update the docs for distutils2 I'll look at that as well but I think it is still useful to provide meaningful docs for what exists in distutils.
msg121862 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-21 04:26
Thanks for the reply Martin.  Tarek has pronounced in favor of this change, so I will commit it tomorrow.
msg124077 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-15 22:21
Patch applied after small editions in [a8e0f46fccbd] (distutils2), r87283 (3.2), r87285 (3.1), r87287 (2.7).
History
Date User Action Args
2010-12-15 22:21:18eric.araujosetstatus: pending -> closed
title: distutils tricks you into thinking you can build extensions with mingw -> Add disclaimer about MinGW compat in distutils docs
nosy: loewis, exarkun, pitrou, tarek, eric.araujo, lambacck
messages: + msg124077

resolution: accepted -> fixed
stage: resolved
2010-11-21 04:26:57eric.araujosetstatus: open -> pending

assignee: tarek -> eric.araujo
components: + Distutils2
versions: + 3rd party, Python 3.1, Python 2.7, Python 3.2, - Python 2.6
nosy: loewis, exarkun, pitrou, tarek, eric.araujo, lambacck
messages: + msg121862
resolution: accepted
2010-11-20 23:20:06lambaccksetmessages: + msg121812
2010-11-20 22:41:56loewissetmessages: + msg121805
2010-11-20 22:07:11eric.araujosetnosy: + eric.araujo

messages: + msg121792
title: distutils tricks you into thinking you can build extensions with mingw -> distutils tricks you into thinking you can build extensions with mingw
2010-11-20 21:57:38lambaccksetfiles: + updated_mingw_docs.patch
keywords: + patch
messages: + msg121789
2010-11-20 20:53:10lambaccksetnosy: + lambacck
messages: + msg121768
2009-05-13 18:47:46loewissetmessages: + msg87701
title: distutils tricks you into thinking you can build extensions with mingw -> distutils tricks you into thinking you can build extensions with mingw
2009-05-13 12:14:33exarkunsetmessages: + msg87680
2009-05-13 03:03:36loewissetnosy: + loewis
title: distutils tricks you into thinking you can build extensions with mingw -> distutils tricks you into thinking you can build extensions with mingw
messages: + msg87667
2009-05-12 21:47:07pitrousetnosy: + pitrou
messages: + msg87661
2009-05-12 21:45:42exarkuncreate