Re: [Python-Dev] Is distutils.util.get_platform() the "current" or the "target" platform
[Any reason for dropping python-dev?]
Sorry. just clicked the wrong button.
And the answer is a resounding "yes, it returns the target platform"? It seems you're saying this, but the wording of your email sounds just enough of a question that I'm not sure whether you are definitively answering it or not.
The answer is yes indeed, it returns the target platform. This is a listing of the non-obvious steps that lead to this conclusion. Xavier On 2/19/19 8:45 PM, Steve Dower wrote:
[Any reason for dropping python-dev?]
On 19Feb2019 1139, Xavier de Gaye wrote:
Is distutils.util.get_platform() the "current" or the "target" platform ?
I *think* you're answering this below, yes?
* When cross-compiling on posix platforms using autoconf, configure is run with the '--host=host-type' [1] command line option to specify the target platform.
* The AC_CANONICAL_HOST macro is used by configure.ac to get the canonical variables `host' and `host_cpu' [2]. Those variables are used to compute _PYTHON_HOST_PLATFORM.
* The Makefile generated by configure runs setup.py, generate-posix-vars, etc... on the build platform using PYTHON_FOR_BUILD, a native python interpreter that is set to run with the _PYTHON_HOST_PLATFORM environment variable.
* get_platform() in setup.py and in Lib/distutils/util.py returns the value of _PYTHON_HOST_PLATFORM when cross-compiling.
So the process of cross-compilation on posix platforms has get_platform() return the target ('host' in autoconf terminology) platform.
[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/htm... [2] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/htm...
And the answer is a resounding "yes, it returns the target platform"? It seems you're saying this, but the wording of your email sounds just enough of a question that I'm not sure whether you are definitively answering it or not.
Cheers, Steve
Thanks for the feedback. I updated the PR to use get_platform and get_host_platform. More testing is still needed before it's ready to merge to make sure it still does what it was intended to do. -----Original Message----- From: Python-Dev <python-dev-bounces+paulmon=microsoft.com@python.org> On Behalf Of Xavier de Gaye Sent: Tuesday, February 19, 2019 12:06 PM To: Steve Dower <steve.dower@python.org>; python-dev@python.org Subject: Re: [Python-Dev] Is distutils.util.get_platform() the "current" or the "target" platform
[Any reason for dropping python-dev?]
Sorry. just clicked the wrong button.
And the answer is a resounding "yes, it returns the target platform"? It seems you're saying this, but the wording of your email sounds just enough of a question that I'm not sure whether you are definitively answering it or not.
The answer is yes indeed, it returns the target platform. This is a listing of the non-obvious steps that lead to this conclusion. Xavier On 2/19/19 8:45 PM, Steve Dower wrote:
[Any reason for dropping python-dev?]
On 19Feb2019 1139, Xavier de Gaye wrote:
Is distutils.util.get_platform() the "current" or the "target" platform ?
I *think* you're answering this below, yes?
* When cross-compiling on posix platforms using autoconf, configure is run with the '--host=host-type' [1] command line option to specify the target platform.
* The AC_CANONICAL_HOST macro is used by configure.ac to get the canonical variables `host' and `host_cpu' [2]. Those variables are used to compute _PYTHON_HOST_PLATFORM.
* The Makefile generated by configure runs setup.py, generate-posix-vars, etc... on the build platform using PYTHON_FOR_BUILD, a native python interpreter that is set to run with the _PYTHON_HOST_PLATFORM environment variable.
* get_platform() in setup.py and in Lib/distutils/util.py returns the value of _PYTHON_HOST_PLATFORM when cross-compiling.
So the process of cross-compilation on posix platforms has get_platform() return the target ('host' in autoconf terminology) platform.
[1] https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.gnu.or... [2] https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.gnu.or...
And the answer is a resounding "yes, it returns the target platform"? It seems you're saying this, but the wording of your email sounds just enough of a question that I'm not sure whether you are definitively answering it or not.
Cheers, Steve
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.pytho... Unsubscribe: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.pytho...
participants (2)
-
Paul Monson
-
Xavier de Gaye