Commit 32c2d184 authored by Adam Kallai's avatar Adam Kallai Committed by Commit Bot

Fix MSVC toolset selection issue

Windows ARM64 build bot is broken on copying runtime dlls.
A recent change switches the MSVC version to VS 2019 as preferred
( https://chromium-review.googlesource.com/c/chromium/src/+/1836195 ).
This affects the search of runtime dlls, since currently VC141
toolset is selected.

As a workaround select the proper toolset directory based on VS version.

Bug: 1013508
Change-Id: Iaebee100be727f60d7bd651202af725abf4726d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1855966Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705633}
parent 87be7af4
......@@ -29,6 +29,11 @@ MSVS_VERSIONS = collections.OrderedDict([
('2017', '15.0'),
])
# List of preferred VC toolset version based on MSVS
MSVC_TOOLSET_VERSION = {
'2019' : 'VC142',
'2017' : 'VC141',
}
def SetEnvironmentAndGetRuntimeDllDirs():
"""Sets up os.environ to use the depot_tools VS toolchain with gyp, and
......@@ -241,14 +246,19 @@ def _CopyUCRTRuntime(target_dir, source_dir, target_cpu, dll_pattern, suffix):
exist, but the target directory does exist."""
if target_cpu == 'arm64':
# Windows ARM64 VCRuntime is located at {toolchain_root}/VC/Redist/MSVC/
# {x.y.z}/[debug_nonredist/]arm64/Microsoft.VC141.CRT/.
# {x.y.z}/[debug_nonredist/]arm64/Microsoft.VC14x.CRT/.
# Select VC toolset directory based on Visual Studio version
vc_redist_root = FindVCRedistRoot()
if suffix.startswith('.'):
vc_toolset_dir = 'Microsoft.{}.CRT' \
.format(MSVC_TOOLSET_VERSION[GetVisualStudioVersion()])
source_dir = os.path.join(vc_redist_root,
'arm64', 'Microsoft.VC141.CRT')
'arm64', vc_toolset_dir)
else:
vc_toolset_dir = 'Microsoft.{}.DebugCRT' \
.format(MSVC_TOOLSET_VERSION[GetVisualStudioVersion()])
source_dir = os.path.join(vc_redist_root, 'debug_nonredist',
'arm64', 'Microsoft.VC141.DebugCRT')
'arm64', vc_toolset_dir)
for file_part in ('msvcp', 'vccorlib', 'vcruntime'):
dll = dll_pattern % file_part
target = os.path.join(target_dir, dll)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment