]> granicus.if.org Git - python/commitdiff
bpo-37201: fix test_distutils failures for Windows ARM64 (GH-13902)
authorPaul Monson <paulmon@users.noreply.github.com>
Wed, 12 Jun 2019 17:16:49 +0000 (10:16 -0700)
committerSteve Dower <steve.dower@python.org>
Wed, 12 Jun 2019 17:16:49 +0000 (10:16 -0700)
Lib/distutils/_msvccompiler.py
Lib/distutils/tests/test_bdist_wininst.py
Lib/distutils/util.py
Lib/sysconfig.py
PC/pyconfig.h

index c7ac3f049ebf227e26c3932381c31c955dd28d28..6e14f330d7f4d2345e17a94e6fca3a31398000fc 100644 (file)
@@ -93,6 +93,7 @@ PLAT_SPEC_TO_RUNTIME = {
     'x86' : 'x86',
     'x86_amd64' : 'x64',
     'x86_arm' : 'arm',
+    'x86_arm64' : 'arm64'
 }
 
 def _find_vcvarsall(plat_spec):
@@ -190,6 +191,7 @@ PLAT_TO_VCVARS = {
     '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
index 4c19bbab219baf866cb91348a551bdfaedff0ff7..163f1cc97bf9a8c75e38c114e8317c233e9139f0 100644 (file)
@@ -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,
index 50550e1893418cd5e17c5411f06b4a8f325038e2..17a94bc42832415e46f88c3ffafbd70598342fb7 100644 (file)
@@ -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
index 8446c8deb2427e3b106f254869c7e99733e93435..e76e6927cb1ff32f24c2d6bdd423752a01e2d76f 100644 (file)
@@ -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'):
index 122591276b4a7db687d28a15ecd8d3a4ed2c5e6a..9228923cbea831c846162efaea4a0a4f3830960c 100644 (file)
@@ -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