11 August 2017

test_distutils

See this post.

After writing this patch for use on Windows 10 64bit I realised that 32bit installations
are not allocated for, that considered an IF block might be more appropriate, however
it is beyond the scope of this post to assess the frequency among that OS versions'
users running 32bit releases. Furthermore, as I'm on 64bit I an uninformed whether
VS2017 on 32bit factually has an HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7
Registry key.

I'll probably subsequent to error resolution merge this content with the vim-notebook post.

A more VS2017 specific solution would be to add a new Registry key pointing to the
'Build' directory, and then modify the _msvccompiler.py file to contain that new key.

As VS2017 has a Registry key as follows

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7

Value name:
15.0

Value data:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\

copying %VSINSTALLDIR%VC\Auxiliary\Build\vcvarsall.bat

to %VSINSTALLDIR%

and modifying Python-3.6.2\Lib\distutils\_msvccompiler.py

- r"Software\Microsoft\VisualStudio\SxS\VC7",
+ r"SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7",

then opening an x64 Native Tools Command Prompt for VS 2017 and running test_distutils
and test_distutils.py (verbose mode) produced the following output.

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Windows\System32>CD \Python-3.6.2\PCBuild

C:\Python-3.6.2\PCbuild>rt.bat -x64 test_distutils

...

test test_distutils failed -- Traceback (most recent call last):
  File "C:\Python-3.6.2\lib\distutils\tests\test_msvccompiler.py", line 79, in test_vcruntime_skip_copy
    self.assertTrue(os.path.isfile(dll))
AssertionError: False is not true

test_distutils failed

1 test failed:
    test_distutils

Total duration: 11 sec
Tests result: FAILURE

C:\Python-3.6.2\PCbuild>

C:\Python-3.6.2\PCbuild>CD amd64

C:\Python-3.6.2\PCbuild\amd64>python.exe ..\..\Lib\test\test_distutils.py

...

======================================================================
FAIL: test_vcruntime_skip_copy (distutils.tests.test_msvccompiler.msvccompilerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python-3.6.2\lib\distutils\tests\test_msvccompiler.py", line 79, in test_vcruntime_skip_copy
    self.assertTrue(os.path.isfile(dll))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 236 tests in 14.125s
FAILED (failures=1, skipped=26)
Traceback (most recent call last):
  File "..\..\Lib\test\test_distutils.py", line 18, in <module>
    test_main()
  File "..\..\Lib\test\test_distutils.py", line 13, in test_main
    test.support.run_unittest(distutils.tests.test_suite())
  File "C:\Python-3.6.2\lib\test\support\__init__.py", line 1929, in run_unittest
    _run_suite(suite)
  File "C:\Python-3.6.2\lib\test\support\__init__.py", line 1898, in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "C:\Python-3.6.2\lib\distutils\tests\test_msvccompiler.py", line 79, in test_vcruntime_skip_copy
    self.assertTrue(os.path.isfile(dll))
AssertionError: False is not true

C:\Python-3.6.2\PCbuild\amd64>

https://github.com/python/cpython/blob/master/Lib/distutils/_msvccompiler.py
https://github.com/python/cpython/blob/master/Lib/distutils/tests/test_msvccompiler.py

No comments:

Post a Comment