summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbrucedawson <brucedawson@chromium.org>2016-03-23 13:31:13 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 20:32:43 +0000
commit13856ebb7cb3b75dd9d40bb394ffa567ab4a524a (patch)
tree68e0334f1157a8bad402cb4f92bcd1bd385bae71 /build
parented9670f405fec16b8126708ed1f17ee5c2fb47cb (diff)
downloadchromium_src-13856ebb7cb3b75dd9d40bb394ffa567ab4a524a.zip
chromium_src-13856ebb7cb3b75dd9d40bb394ffa567ab4a524a.tar.gz
chromium_src-13856ebb7cb3b75dd9d40bb394ffa567ab4a524a.tar.bz2
Detect and warn on missing vcvarsall.bat
VC++ 2015 defaults to *not* installing the C++ toolchain. Several developers have failed to notice this and then hit cryptic errors when building Chrome. This detects the problem and gives a more informative error message for gn builds. crrev.com/1832593002 does this for gyp builds. BUG=440500 Review URL: https://codereview.chromium.org/1822383002 Cr-Commit-Position: refs/heads/master@{#382915}
Diffstat (limited to 'build')
-rw-r--r--build/toolchain/win/setup_toolchain.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
index 4dd077c..a766cc1 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -117,9 +117,13 @@ def _LoadToolchainEnv(cpu, sdk_dir):
if 'GYP_MSVS_OVERRIDE_PATH' not in os.environ:
os.environ['GYP_MSVS_OVERRIDE_PATH'] = _DetectVisualStudioPath()
# We only support x64-hosted tools.
- args = [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'],
- 'VC/vcvarsall.bat')),
- 'amd64_x86' if cpu == 'x86' else 'amd64']
+ script_path = os.path.normpath(os.path.join(
+ os.environ['GYP_MSVS_OVERRIDE_PATH'],
+ 'VC/vcvarsall.bat'))
+ if not os.path.exists(script_path):
+ raise Exception('%s is missing - make sure VC++ tools are installed.' %
+ script_path)
+ args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64']
variables = _LoadEnvFromBat(args)
return _ExtractImportantEnvironment(variables)