[Python-Dev] Is distutils.util.get_platform() the "current" or the "target" platform

Steve Dower steve.dower at python.org
Sat Feb 16 12:29:15 EST 2019


On 16Feb.2019 0831, Nick Coghlan wrote:
> On Sat, 16 Feb 2019 at 08:06, Steve Dower <steve.dower at python.org> wrote:
>> I'm inclined to say that nobody but us uses this API :) Does that make
>> it seem more okay to "clarify" that it's returning target platform?
> 
> I've always treated the situation as "Cross-compilation doesn't work,
> build on the target platform, using a VM if you have to", and I
> suspect a lot of folks have approached the status quo the same way.

For platforms where pyconfig.h is generated, this is still going to be
true, at least until the compiler classes learn to add a
platform-specific include path.

On Windows, we have a static pyconfig.h that changes behaviour based on
compiler and Windows SDK provided preprocessor directives, so we can
quite comfortably use the same file.

> So if there are functions you can change to make cross-compilation
> actually work without requiring changes to a lot of other projects,
> that seems like a good thing to me.

Okay Paul (Monson), that's your cue to update the PR :)

Cheers,
Steve


More information about the Python-Dev mailing list