Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: build/check_gn_headers.py

Issue 2925863002: check_gn_headers: use pinned depot_tools (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/check_gn_headers.py
diff --git a/build/check_gn_headers.py b/build/check_gn_headers.py
index c5095e618d5fa6d0e94f615be988d00cb85babae..5da230b3e9280dea56d2a251178b8ae2ccdd706d 100755
--- a/build/check_gn_headers.py
+++ b/build/check_gn_headers.py
@@ -19,12 +19,16 @@ import sys
import tempfile
from multiprocessing import Process, Queue
+SRC_DIR = os.path.abspath(
+ os.path.join(os.path.abspath(os.path.dirname(__file__)), os.path.pardir))
+DEPOT_TOOLS_DIR = os.path.join(SRC_DIR, 'depot_tools')
Dirk Pranke 2017/06/07 01:29:53 This needs to be os.path.join(SRC_DIR, 'third_part
+
def GetHeadersFromNinja(out_dir, q):
"""Return all the header files from ninja_deps"""
def NinjaSource():
- cmd = ['ninja', '-C', out_dir, '-t', 'deps']
+ cmd = [os.path.join(DEPOT_TOOLS_DIR, 'ninja'), '-C', out_dir, '-t', 'deps']
wychen 2017/06/07 01:27:03 I don't have src/depot_tools in my checkout. Is th
Dirk Pranke 2017/06/07 01:29:53 Good catch, see comment above.
wychen 2017/06/07 01:32:20 Ah. I haven't updated to https://chromium-review.g
# A negative bufsize means to use the system default, which usually
# means fully buffered.
popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=-1)
@@ -82,7 +86,8 @@ def GetHeadersFromGN(out_dir, q):
shutil.copy2(os.path.join(out_dir, 'args.gn'),
os.path.join(tmp, 'args.gn'))
# Do "gn gen" in a temp dir to prevent dirtying |out_dir|.
- subprocess.check_call(['gn', 'gen', tmp, '--ide=json', '-q'])
+ subprocess.check_call([
+ os.path.join(DEPOT_TOOLS_DIR, 'gn'), 'gen', tmp, '--ide=json', '-q'])
gn_json = json.load(open(os.path.join(tmp, 'project.json')))
ans = ParseGNProjectJSON(gn_json, out_dir, tmp)
except Exception as e:
@@ -118,9 +123,10 @@ def GetDepsPrefixes(q):
"""Return all the folders controlled by DEPS file"""
prefixes, err = set(), None
try:
- gclient_out = subprocess.check_output(
- ['gclient', 'recurse', '--no-progress', '-j1',
- 'python', '-c', 'import os;print os.environ["GCLIENT_DEP_PATH"]'])
+ gclient_out = subprocess.check_output([
+ os.path.join(DEPOT_TOOLS_DIR, 'gclient'),
+ 'recurse', '--no-progress', '-j1',
+ 'python', '-c', 'import os;print os.environ["GCLIENT_DEP_PATH"]'])
for i in gclient_out.split('\n'):
if i.startswith('src/'):
i = i[4:]
@@ -131,7 +137,7 @@ def GetDepsPrefixes(q):
def IsBuildClean(out_dir):
- cmd = ['ninja', '-C', out_dir, '-n']
+ cmd = [os.path.join(DEPOT_TOOLS_DIR, 'ninja'), '-C', out_dir, '-n']
out = subprocess.check_output(cmd)
return 'no work to do.' in out
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698