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

Christian Heimes christian at python.org
Thu Feb 1 07:14:43 EST 2018


On 2018-02-01 10:19, Oleg Sivokon wrote:
> 
>> so why shouldn’t the one with the most users?
> 
> Because it makes compilation difficult, and cross-compilatin completely impossible?  Why is it difficult: a package maintainer needs to (1) buy MS Windows (2) create a special workflow for compiling on a different machine.  This is both costly and inconsistent with free-as-in-freedom...  It makes cross-compilation impossible because libraries produced by any tool that can run on all target platforms are incompatible with Python binaries on MS Windows.
> 
> Again, many languages (i.e. projects similar in size an purpose to CPython) took a different approach: they use GNU compilers to be able to compile cross-platform.  This is true for Ruby and Go at least.  I would need to investigate further, but I think these two examples should be enough.
> 
>> I’m likely biased because I work there and I’m the main intermediary with python-dev, but these days Microsoft is one of the strongest supporters of CPython. We employ the most core developers of any private company and we all are allowed work time to contribute, we provide full access to our development tools and platforms to all core developers and some prominent projects, we’ve made fixes, enhancements and releases or core products such as the CRT, MSVC, Visual Studio, Visual Studio Code, and Azure SPECIFICALLY to support CPython development and users. As far as I know, ALL the Windows buildbots are running on Azure subscriptions that Microsoft provides (though managed by some awesome volunteers). You’ll see us at PyCon US under the biggest banner and we’ll have a booth filled with engineers and not recruiters. Crash reports from thousands of opted-in users come into our systems and have directly lead to both CPython and Windows bug fixes.
> 
> Oh, so this is the real reason... well, corporate interests are hard to argue against.  But, this is an interesting statistic nevertheless.  Thanks for letting me know.

You are drawing the wrong conclusion here. CPython has been using MSVC
many years before Microsoft even started to sponsor MSDN subscriptions
for core developers. MSVC is the default Windows compiler for over 20
years now. IIRC Microsoft started to donate MSDN subscription for about
5 years and Steve has been helping out with Windows improvement for
about 5 years.

Christian





More information about the Python-Dev mailing list