[Python-Dev] Why is Python for Windows compiled with MSVC?

Oleg Sivokon olegs at traiana.com
Thu Feb 1 04:50:01 EST 2018


> I would also point out that CPython (distutils, specifically)
supported mingw builds (that's the original mingw 32-bit version) for
a long time. Support for that bit-rotted as the mingw project
fragmented with various 64-bit versions, and slow progress from the
mingw project(s) for supporting newer CRTs on Windows. No-one from the
community who used mingw was providing patches back to distutils or
Python, and so the support for mingw was (I believe) dropped. It
sounds as if people have since then got things to a point where
building extensions with (some form of ) mingw is possible, but I
don't know the details, and I'm not aware of any documentation that's
been contributed back to Python on how "mingw support for building
extensions" works these days.

The question isn't whether I can build Python with MinGW: I know I can.  The problem is that if I do that, I make the users of my package depend on my special build of Python.  This also means that the packages built by others (who are unaware of my special build of Python) may or may not work for them.  In practice, if I want to make sure that the users of my packages can actually use them, I cannot allow myself to link them against a Python binary of my choice.  It has to be their choice.

We'd be more than happy to support building extensions with
alternative compilers (such as one of the various gcc builds that go
under the banner of "mingw") - that's a completely different matter
than switching the CPython build process to use mingw - but it's down
to the community of users of such a compiler to contribute that
support. Expecting "someone else", and particularly someone who
doesn't need it, to provide that support, is unreasonable.

Well, guys, since you are here, I assumed you were in the business of deciding which compiler to compile your code with.  I really, just asked a question.  It's obvious that I don't agree with your decision, but I wanted to hear your argument.  Nowhere did I suggest that you should do any work for me or anything of that kind.  All I wanted was information to make an informed decision about using Python and its extensions ecosystem.  I've got my answers, for which I'm thankful.

I'm sorry for the disclaimer that follows this email.  Unfortunately, I'm too a slave of circumstances, s.a. my employer and the IT department that would not let me send an email without this legal mumbo-jumbo.

Best.

Oleg
This communication and all information contained in or attached to it is confidential, intended solely for the addressee, may be legally privileged and is the intellectual property of one of the companies of NEX Group plc ("NEX") or third parties. If you are not the intended addressee or receive this message in error, please immediately delete all copies of it and notify the sender. We have taken precautions to minimise the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachments. We do not accept liability for any loss or damage caused by software viruses. NEX reserves the right to monitor all communications. We do not accept any legal responsibility for the content of communications, and no communication shall be considered legally binding. Furthermore, if the content of this communication is personal or unconnected with our business, we accept no liability or responsibility for it. NEX Group plc is a public limited company registered in England and Wales under number 10013770 and certain of its affiliates are authorised and regulated by regulatory authorities. For further regulatory information please see www.NEX.com.


More information about the Python-Dev mailing list