Commit 6c92556c authored by Richard Townsend's avatar Richard Townsend Committed by Commit Bot

build: workaround for VC v14.25 / MSVC 19.25

Adds a temporary fix to vs_toolchain.py to use the previous version of
MSVC's header files and documents how to install the previous version
alongside 19.25.

Bug: 1058860
Change-Id: I6e96af3c71b23e5c5430237d00125a5830c37855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117732
Commit-Queue: Richard Townsend <richard.townsend@arm.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753998}
parent 66f3e836
......@@ -158,6 +158,11 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store):
if (target_store):
args.append(['store'])
variables = _LoadEnvFromBat(args)
# Check for faulty 14.25 version of system headers (see crbug.com/1058860).
if "14.25" in _ExtractImportantEnvironment(variables)["LIB"]:
# If detected, switch back to 14.24.
args.append(["-vcvars_ver=14.24"])
variables = _LoadEnvFromBat(args)
return _ExtractImportantEnvironment(variables)
......
......@@ -320,11 +320,21 @@ def FindVCComponentRoot(component):
vc_component_msvc_contents = os.listdir(vc_component_msvc_root)
# Select the most recent toolchain if there are several.
_SortByHighestVersionNumberFirst(vc_component_msvc_contents)
acceptable_msvc_version_found = False
for directory in vc_component_msvc_contents:
if directory.startswith('14.25'):
print(
"Warning: known issue affecting the headers distributed with VC version {}."
.format(directory))
print("See https://crbug.com/1063424 for details.")
continue
acceptable_msvc_version_found = True
if not os.path.isdir(os.path.join(vc_component_msvc_root, directory)):
continue
if re.match(r'14\.\d+\.\d+', directory):
return os.path.join(vc_component_msvc_root, directory)
if not acceptable_msvc_version_found:
raise Exception("Unable to find a suitable VC version.")
raise Exception('Unable to find the VC %s directory.' % component)
......
......@@ -61,6 +61,22 @@ Software Development Kit" → Change → Change → Check "Debugging Tools For
Windows" → Change. Or, you can download the standalone SDK installer and use it
to install the Debugging Tools.
### Known issue with Visual Studio 16.5.0
Visual Studio 16.5.0 includes some header files which are incompatible with the
C++ standard used in Chromium (see [crbug.com/1063424](https://crbug.com/1063424)
for details.) A workaround is to install the older command-line tools:
```shell
$ PATH_TO_INSTALLER.exe ^
--add "Microsoft.VisualStudio.Component.VC.14.24.ARM64" ^
--add "Microsoft.VisualStudio.Component.VC.14.24.x86.x64" ^
--add "Microsoft.VisualStudio.Component.VC.14.24.ATL.ARM64" ^
--add "Microsoft.VisualStudio.Component.VC.14.24.ATL" ^
--add "Microsoft.VisualStudio.Component.VC.14.24.MFC.ARM64" ^
--add "Microsoft.VisualStudio.Component.VC.14.24.MFC" ^
--includeRecommended
```
## Install `depot_tools`
Download the [depot_tools bundle](https://storage.googleapis.com/chrome-infra/depot_tools.zip)
......
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