Fix ucrt source path when packaging the Windows toolchain

Recent versions of the 10.0.17763 SDK have rearranged the redist
directory. This change adjusts the packaging so that we can package the
SDK with and without this change. The script looks first in the
versioned directory and if that doesn't exist then it falls back to the
unversioned directory.

See also http://crrev.com/c/1371017 for the build\vs_toolchain.py
version of this change.

Change-Id: I835bf45f613a0aebb56eb1e8e63e6ffa5252edf0
Reviewed-on: https://chromium-review.googlesource.com/c/1370609
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/09/1370609/5
Bruce Dawson 7 years ago committed by Commit Bot
parent 762a25693f
commit fed2cb39c3

@ -207,8 +207,13 @@ def BuildFileList(override_dir):
result.append((combined, to))
# Copy the x86 ucrt DLLs to all directories with x86 binaries that are
# added to the path by SetEnv.cmd, and to sys32.
ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x86\*'))
# added to the path by SetEnv.cmd, and to sys32. Starting with the 17763
# SDK the ucrt files are in WIN_VERSION\ucrt instead of just ucrt.
ucrt_dir = os.path.join(sdk_path, 'redist', WIN_VERSION, r'ucrt\dlls\x86')
if not os.path.exists(ucrt_dir):
ucrt_dir = os.path.join(sdk_path, r'redist\ucrt\dlls\x86')
ucrt_paths = glob.glob(ucrt_dir + r'\*')
assert(len(ucrt_paths) > 0)
for ucrt_path in ucrt_paths:
ucrt_file = os.path.split(ucrt_path)[1]
for dest_dir in [ r'win_sdk\bin\x86', 'sys32' ]:
@ -216,7 +221,11 @@ def BuildFileList(override_dir):
# Copy the x64 ucrt DLLs to all directories with x64 binaries that are
# added to the path by SetEnv.cmd, and to sys64.
ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x64\*'))
ucrt_dir = os.path.join(sdk_path, 'redist', WIN_VERSION, r'ucrt\dlls\x64')
if not os.path.exists(ucrt_dir):
ucrt_dir = os.path.join(sdk_path, r'redist\ucrt\dlls\x64')
ucrt_paths = glob.glob(ucrt_dir + r'\*')
assert(len(ucrt_paths) > 0)
for ucrt_path in ucrt_paths:
ucrt_file = os.path.split(ucrt_path)[1]
for dest_dir in [ r'VC\bin\amd64_x86', r'VC\bin\amd64',

Loading…
Cancel
Save