win: Fix current toolchain path with old packaging
I broke boringssl's use of depot_tools toolchain as I changed the
name of the sdk path key. This happened to work in Chrome because
src/ has fallback behaviour.
Restore the 'win8sdk' name when unpacking a current/old-style
toolchain package (i.e. what everyone is still using).
TBR=dpranke@chromium.org
R=davidben@chromium.org
Review URL: https://codereview.chromium.org/1159433006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295492 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py
index cb4b5da..5bda1ee 100755
--- a/win_toolchain/get_toolchain_if_necessary.py
+++ b/win_toolchain/get_toolchain_if_necessary.py
@@ -290,7 +290,16 @@
got_new_toolchain = True
- win_sdk = os.path.join(abs_target_dir, 'win_sdk')
+ data = {
+ 'path': abs_target_dir,
+ 'win_sdk': os.path.join(abs_target_dir, 'win_sdk'),
+ 'wdk': os.path.join(abs_target_dir, 'wdk'),
+ 'runtime_dirs': [
+ os.path.join(abs_target_dir, 'sys64'),
+ os.path.join(abs_target_dir, 'sys32'),
+ ],
+ }
+
try:
with open(os.path.join(target_dir, 'VS_VERSION'), 'rb') as f:
vs_version = f.read().strip()
@@ -298,18 +307,10 @@
# Older toolchains didn't have the VS_VERSION file, and used 'win8sdk'
# instead of just 'win_sdk'.
vs_version = '2013'
- win_sdk = os.path.join(abs_target_dir, 'win8sdk')
+ data['win8sdk'] = os.path.join(abs_target_dir, 'win8sdk')
- data = {
- 'path': abs_target_dir,
- 'version': vs_version,
- 'win_sdk': win_sdk,
- 'wdk': os.path.join(abs_target_dir, 'wdk'),
- 'runtime_dirs': [
- os.path.join(abs_target_dir, 'sys64'),
- os.path.join(abs_target_dir, 'sys32'),
- ],
- }
+ data['version'] = vs_version
+
with open(os.path.join(target_dir, '..', 'data.json'), 'w') as f:
json.dump(data, f)