Account for managed solution in src when finding ninja

At present when looking for ninja, main only searches in two locations, gclient root and src. The Electron project lists Chromium’s src as a dependency in its DEPS file, so Ninja won’t be in the primary solution’s path (as it’s a transitive dependency, not a direct dependency of Chromium). This change adapts existing logic to account for that case.

Change-Id: I35aea29135d5968722a308bfb6dbb8a727550b42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4203207
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
changes/07/4203207/10
Shelley Vohr 2 years ago committed by LUCI CQ
parent 3d072ab6fb
commit 106754b269

@ -67,7 +67,12 @@ def main(args):
# Get gclient root + src.
primary_solution_path = gclient_paths.GetPrimarySolutionPath()
gclient_root_path = gclient_paths.FindGclientRoot(os.getcwd())
for base_path in [primary_solution_path, gclient_root_path]:
gclient_src_root_path = None
if gclient_root_path:
gclient_src_root_path = os.path.join(gclient_root_path, 'src')
for base_path in set(
[primary_solution_path, gclient_root_path, gclient_src_root_path]):
if not base_path:
continue
ninja_path = os.path.join(base_path, 'third_party', 'ninja',

Loading…
Cancel
Save