Преглед изворни кода

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 <mbonadei@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Mirko Bonadei пре 5 година
родитељ
комит
cbff54b4ac
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      win_toolchain/package_from_installed.py

+ 10 - 0
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))