From cbff54b4acccd596d4faf34636a687c2cdbf11b9 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 30 Sep 2019 18:58:38 +0000 Subject: [PATCH] Fail to repackage if win_sdk\Debuggers doesn't exist. This is easy to miss and a toolchain package without win_sdk\Debuggers will not work as expected so this CL adds a check to stop the packaging/repacking process as soon as possible. Bug: 1006238 Change-Id: I272fbaf3e1cbde48a3e260e38e34ffc10d6c86df Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1829272 Commit-Queue: Mirko Bonadei Reviewed-by: Bruce Dawson --- win_toolchain/package_from_installed.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/win_toolchain/package_from_installed.py b/win_toolchain/package_from_installed.py index f36b09158..ec37c850b 100644 --- a/win_toolchain/package_from_installed.py +++ b/win_toolchain/package_from_installed.py @@ -79,6 +79,12 @@ def BuildRepackageFileList(src_dir): # Strip off a trailing slash if present if src_dir.endswith('\\'): src_dir = src_dir[:-1] + + # Ensure .\win_sdk\Debuggers exists and fail to repackage if it doesn't. + debuggers_path = os.path.join(src_dir, 'win_sdk', 'Debuggers') + if not os.path.exists(debuggers_path): + raise Exception('Repacking failed. Missing %s.' % (debuggers_path)) + result = [] for root, _, files in os.walk(src_dir): for f in files: @@ -166,6 +172,10 @@ def BuildFileList(override_dir, include_arm): result.append((final_from, dest)) sdk_path = r'C:\Program Files (x86)\Windows Kits\10' + debuggers_path = os.path.join(sdk_path, 'Debuggers') + if not os.path.exists(debuggers_path): + raise Exception('Packaging failed. Missing %s.' % (debuggers_path)) + for root, _, files in os.walk(sdk_path): for f in files: combined = os.path.normpath(os.path.join(root, f))