Windows: Fix failure in tools/clang/scripts/update.py with custom VS toolchain (issue #2474)

This commit is contained in:
Marshall Greenblatt 2018-07-12 14:43:10 -04:00
parent 6a76bdb040
commit 8e9d736cda
2 changed files with 23 additions and 0 deletions

View File

@ -381,4 +381,11 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2466
'name': 'linux_poll_2466',
},
{
# Fix tools/clang/scripts/update.py failure with custom VS toolchain on
# Windows. This needs to be done in DEPS because it executes during the
# `gclient runhooks` step.
# https://bugs.chromium.org/p/chromium/issues/detail?id=863130
'name': 'DEPS',
}
]

16
patch/patches/DEPS.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git tools/clang/scripts/update.py tools/clang/scripts/update.py
index 226c3981a3bb..560a58070883 100755
--- tools/clang/scripts/update.py
+++ tools/clang/scripts/update.py
@@ -392,7 +392,10 @@ def GetWinSDKDir():
if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))):
dia_path = os.path.join(win_sdk_dir, '..', 'DIA SDK', 'bin', 'amd64')
else:
- vs_path = vs_toolchain.DetectVisualStudioPath()
+ if 'GYP_MSVS_OVERRIDE_PATH' not in os.environ:
+ vs_path = vs_toolchain.DetectVisualStudioPath()
+ else:
+ vs_path = os.environ['GYP_MSVS_OVERRIDE_PATH']
dia_path = os.path.join(vs_path, 'DIA SDK', 'bin', 'amd64')
dia_dll = os.path.join(dia_path, DIA_DLL[msvs_version])