[issue46427] Correct MSBuild's configuration for _freeze_module.exe

neonene report at bugs.python.org
Thu Jan 20 18:41:45 EST 2022


neonene <nicesalmon at gmail.com> added the comment:

> When cross-compiling, tools that are executed as part of the build need to be built for the tool platform, not the target platform.

My PR does not against that at this point, as proposed codes are based on your PR28322 (09b4ad11f323f8702cde795e345b75e0fbb1a9a5).
If we now need to prepare for future MSVC *on* ARM, then current _freeze_module configurations in "pcbuild.sln" also need to be reconsidered:

{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM.ActiveCfg = Debug|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM.Build.0 = Debug|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM64.ActiveCfg = Debug|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM64.Build.0 = Debug|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM.ActiveCfg = Release|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM.Build.0 = Release|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM64.ActiveCfg = Release|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM64.Build.0 = Release|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|ARM.ActiveCfg = Release|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|ARM64.ActiveCfg = Release|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM.ActiveCfg = Release|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM.Build.0 = Release|Win32
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM64.ActiveCfg = Release|x64
{19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM64.Build.0 = Release|x64


Anyway, what I care about is the usage of "PreferredToolArchitecture" property in the current configuration.
The property has nothing to do with whether the host is ARM* or not. Another property will do in the future.

When building x86 python with 64bit compiler (set PreferredToolArchitecture=x64), _freeze_module gets a x64 executable.

The following change is acceptable?

-      <Platform>$(PreferredToolArchitecture)</Platform>
+      <Platform></Platform>

They are the same with no envvar. _freeze_module is always 32bit, though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46427>
_______________________________________


More information about the Python-bugs-list mailing list