[Distutils] The Wheel specification and compatibility tags on Windows

Paul Moore p.f.moore at gmail.com
Wed Feb 27 20:47:39 CET 2013

On 27 February 2013 18:49, Chris Lambacher <chris at kateandchris.net> wrote:
> On Wed, Feb 27, 2013 at 1:01 PM, Vinay Sajip <vinay_sajip at yahoo.co.uk>
> wrote:
>> The trouble is, mistakes happen, and people can upload stuff built with
>> the
>> "wrong" compiler without realising - say, corporates who build their own
>> Pythons, perhaps for embedding scenarios. It may be that in some
>> situations where
>> there's a DLL mismatch, you'd get weird, hard-to-diagnose errors at run
>> time.
> It is pretty hard to do this. For one thing distutils will only use the
> version of visual studio it was built with so as long as people are using
> the official Windows binaries there is not problem. Someone would have to
> self build a version of Python with a different version of Visual Studio and
> the source does not come with build scripts for multiple versions of Visual
> Studio. So while it is possible to get modules built with a different
> version of Visual Studio, it is generally pretty hard to do and unlikely to
> happen "in the wild". I have heard of some companies creating their own
> internal build but then they are totally out of using PyPI at that point
> anyway. Active Python was, last I checked, compatible with the official
> build and I would expect other builds like Enthought to similarly be
> compatible or be excluded from using PyPI.

Agreed, while Vinay has a theoretical point, in any practical sense
it's likely to be a non-issue.

The key on Windows is the version of the MS C runtime. That's what the
version of MSVC determines, in essence. Other than MSVC, only gcc
(mingw) is supported for building extensions, and gcc builds binaries
linking to the same version of the C runtime as the MSVC compiler

Certainly someone could build Python with a different (unsupported)
version of MSVC, but if they did, I believe that they would not be
able to build C extensions unless they also hacked distutils to change
the allowed C compiler version. Again, of course, they could do this.
But the possibility is pretty remote - and even then, before there
would be an issue, they would need to upload generated binaries to
PyPI by accident (we can assume that if they've got this far, they
understand the issue enough not to do so deliberately!)

It's certainly true that the ABI flags are incomplete (there's also
the whole stable ABI to consider). But they are certainly good enough
for the foreseeable future, and if & when we want to implement a more
complete solution, automatically converting to a new scheme is trivial
(as we can determine the MSVCRT version from the Python version for
all existing cases).


More information about the Distutils-SIG mailing list