From b99bc3e190bc9c3d9abf95887c9b74bed3f1e384 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Fri, 10 Mar 2017 16:29:48 -0800 Subject: [PATCH] Cleanup VS 2013/2015 confusion in toolchain script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The get-toolchain script still contained leftover goop for installing the UCRT, even though that misguided plan was abandoned last year. This change deletes that. The get-toolchain script also confusingly used the vs2013_files directory for anything that wasn't VS 2015. It doesn't technically make any difference now that we use hashes for the toolchain directories, but it was confusing when experimenting with VS 2017. R=sebmarchand@chromium.org BUG=683729 Change-Id: Ie0d3eccffe4796d4c5e23a28276acdd757e290d4 Reviewed-on: https://chromium-review.googlesource.com/453122 Reviewed-by: Sébastien Marchand Commit-Queue: Bruce Dawson --- win_toolchain/get_toolchain_if_necessary.py | 42 ++------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py index 5d8e01891..d55674f3b 100755 --- a/win_toolchain/get_toolchain_if_necessary.py +++ b/win_toolchain/get_toolchain_if_necessary.py @@ -366,39 +366,6 @@ def RemoveUnusedToolchains(root): RemoveToolchain(root, toolchain[1], True) -def GetInstallerName(): - """Return the name of the Windows 10 Universal C Runtime installer for the - current platform, or None if installer is not needed or not applicable. - The registry has to be used instead of sys.getwindowsversion() because - Python 2.7 is only manifested as being compatible up to Windows 8, so the - version APIs helpfully return a maximum of 6.2 (Windows 8). - """ - key_name = r'Software\Microsoft\Windows NT\CurrentVersion' - key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_name) - value, keytype = winreg.QueryValueEx(key, "CurrentVersion") - key.Close() - if keytype != winreg.REG_SZ: - raise Exception("Unexpected type in registry") - if value == '6.1': - # Windows 7 and Windows Server 2008 R2 - return 'Windows6.1-KB2999226-x64.msu' - elif value == '6.2': - # Windows 8 and Windows Server 2012 - return 'Windows8-RT-KB2999226-x64.msu' - elif value == '6.3': - # Windows 8.1, Windows Server 2012 R2, and Windows 10. - # The Windows 8.1 installer doesn't work on Windows 10, but it will never - # be used because the UCRT is always installed on Windows 10. - return 'Windows8.1-KB2999226-x64.msu' - else: - # Some future OS. - return None - - -def InstallUniversalCRTIfNeeded(abs_target_dir): - return - - def EnableCrashDumpCollection(): """Tell Windows Error Reporting to record crash dumps so that we can diagnose linker crashes and other toolchain failures. Documented at: @@ -451,10 +418,10 @@ def main(): # the downloader script is. os.chdir(os.path.normpath(os.path.join(BASEDIR))) toolchain_dir = '.' - if os.environ.get('GYP_MSVS_VERSION') == '2015': - target_dir = os.path.normpath(os.path.join(toolchain_dir, 'vs_files')) - else: + if os.environ.get('GYP_MSVS_VERSION') == '2013': target_dir = os.path.normpath(os.path.join(toolchain_dir, 'vs2013_files')) + else: + target_dir = os.path.normpath(os.path.join(toolchain_dir, 'vs_files')) if not os.path.isdir(target_dir): os.mkdir(target_dir) toolchain_target_dir = os.path.join(target_dir, desired_hash) @@ -536,9 +503,6 @@ def main(): EnableCrashDumpCollection() - if os.environ.get('GYP_MSVS_VERSION') == '2015': - InstallUniversalCRTIfNeeded(abs_toolchain_target_dir) - RemoveUnusedToolchains(target_dir) return 0