Skip to content

Commit

Permalink
bpo-37201: fix test_distutils failures for Windows ARM64 (pythonGH-13902
Browse files Browse the repository at this point in the history
)
  • Loading branch information
paulmon authored and zooba committed Jun 12, 2019
1 parent 5287022 commit daf6262
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Lib/distutils/_msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def _find_vc2017():
'x86' : 'x86',
'x86_amd64' : 'x64',
'x86_arm' : 'arm',
'x86_arm64' : 'arm64'
}

def _find_vcvarsall(plat_spec):
Expand Down Expand Up @@ -190,6 +191,7 @@ def _find_exe(exe, paths=None):
'win32' : 'x86',
'win-amd64' : 'x86_amd64',
'win-arm32' : 'x86_arm',
'win-arm64' : 'x86_arm64'
}

# A set containing the DLLs that are guaranteed to be available for
Expand Down
4 changes: 4 additions & 0 deletions Lib/distutils/tests/test_bdist_wininst.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"""Tests for distutils.command.bdist_wininst."""
import sys
import platform
import unittest
from test.support import run_unittest

from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support

@unittest.skipIf(sys.platform == 'win32' and platform.machine() == 'ARM64',
'bdist_wininst is not supported in this install')
@unittest.skipIf(getattr(bdist_wininst, '_unsupported', False),
'bdist_wininst is not supported in this install')
class BuildWinInstTestCase(support.TempdirManager,
Expand Down
2 changes: 2 additions & 0 deletions Lib/distutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def get_host_platform():
return 'win-amd64'
if '(arm)' in sys.version.lower():
return 'win-arm32'
if '(arm64)' in sys.version.lower():
return 'win-arm64'
return sys.platform

# Set for cross builds explicitly
Expand Down
2 changes: 2 additions & 0 deletions Lib/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ def get_platform():
return 'win-amd64'
if '(arm)' in sys.version.lower():
return 'win-arm32'
if '(arm64)' in sys.version.lower():
return 'win-arm64'
return sys.platform

if os.name != "posix" or not hasattr(os, 'uname'):
Expand Down
6 changes: 3 additions & 3 deletions PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ WIN32 is still required for the locale module.
#if defined(_M_X64) || defined(_M_AMD64)
#if defined(__INTEL_COMPILER)
#define COMPILER ("[ICC v." _Py_STRINGIZE(__INTEL_COMPILER) " 64 bit (amd64) with MSC v." _Py_STRINGIZE(_MSC_VER) " CRT]")
#elif defined(_M_ARM64)
#define COMPILER _Py_PASTE_VERSION("64 bit (ARM)")
#define PYD_PLATFORM_TAG "win_arm64"
#else
#define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
#endif /* __INTEL_COMPILER */
#define PYD_PLATFORM_TAG "win_amd64"
#elif defined(_M_ARM64)
#define COMPILER _Py_PASTE_VERSION("64 bit (ARM64)")
#define PYD_PLATFORM_TAG "win_arm64"
#else
#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
#endif
Expand Down

0 comments on commit daf6262

Please sign in to comment.