Make node script's gclient dependency platform-independent.

This is a small step towards making node build on Windows.

Bug: v8:6105

R=machenbach@chromium.org

Change-Id: I8d3a9b1830bb012d846a791fddc8d1d8d830515e
Reviewed-on: https://chromium-review.googlesource.com/980950
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52400}
This commit is contained in:
Yang Guo 2018-04-05 16:03:46 +02:00 committed by Commit Bot
parent 595f14281f
commit 424461cc9c
2 changed files with 6 additions and 6 deletions

View File

@ -73,10 +73,11 @@ def FetchDeps(v8_path):
env = os.environ.copy()
# gclient needs to have depot_tools in the PATH.
env["PATH"] = depot_tools + os.pathsep + env["PATH"]
gclient = os.path.join(depot_tools, "gclient.py")
spec = "solutions = %s" % GCLIENT_SOLUTION
subprocess.check_call(["gclient", "sync", "--spec", spec],
cwd=os.path.join(v8_path, os.path.pardir),
env=env)
subprocess.check_call([sys.executable, gclient, "sync", "--spec", spec],
cwd=os.path.join(v8_path, os.path.pardir),
env=env)
except:
raise
finally:

View File

@ -15,9 +15,8 @@ def EnsureDepotTools(v8_path, fetch_if_not_exist):
def _Get(v8_path):
depot_tools = os.path.join(v8_path, "_depot_tools")
try:
gclient_path = os.path.join(depot_tools, "gclient")
gclient_check = subprocess.check_output([gclient_path, "--version"])
if "gclient.py" in gclient_check:
gclient_path = os.path.join(depot_tools, "gclient.py")
if os.path.isfile(gclient_path):
return depot_tools
except:
pass