wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright 2017 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Find header files missing in GN. |
| 7 | |
| 8 | This script gets all the header files from ninja_deps, which is from the true |
| 9 | dependency generated by the compiler, and report if they don't exist in GN. |
| 10 | """ |
| 11 | |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 12 | from __future__ import print_function |
| 13 | |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 14 | import argparse |
| 15 | import json |
| 16 | import os |
| 17 | import re |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 18 | import shutil |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 19 | import subprocess |
| 20 | import sys |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 21 | import tempfile |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 22 | from multiprocessing import Process, Queue |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 23 | |
nodir | 6a40e940 | 2017-06-07 05:49:03 | [diff] [blame] | 24 | SRC_DIR = os.path.abspath( |
| 25 | os.path.join(os.path.abspath(os.path.dirname(__file__)), os.path.pardir)) |
| 26 | DEPOT_TOOLS_DIR = os.path.join(SRC_DIR, 'third_party', 'depot_tools') |
| 27 | |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 28 | |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 29 | def GetHeadersFromNinja(out_dir, skip_obj, q): |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 30 | """Return all the header files from ninja_deps""" |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 31 | |
| 32 | def NinjaSource(): |
nodir | 6a40e940 | 2017-06-07 05:49:03 | [diff] [blame] | 33 | cmd = [os.path.join(DEPOT_TOOLS_DIR, 'ninja'), '-C', out_dir, '-t', 'deps'] |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 34 | # A negative bufsize means to use the system default, which usually |
| 35 | # means fully buffered. |
| 36 | popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=-1) |
| 37 | for line in iter(popen.stdout.readline, ''): |
| 38 | yield line.rstrip() |
| 39 | |
| 40 | popen.stdout.close() |
| 41 | return_code = popen.wait() |
| 42 | if return_code: |
| 43 | raise subprocess.CalledProcessError(return_code, cmd) |
| 44 | |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 45 | ans, err = set(), None |
| 46 | try: |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 47 | ans = ParseNinjaDepsOutput(NinjaSource(), out_dir, skip_obj) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 48 | except Exception as e: |
| 49 | err = str(e) |
| 50 | q.put((ans, err)) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 51 | |
| 52 | |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 53 | def ParseNinjaDepsOutput(ninja_out, out_dir, skip_obj): |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 54 | """Parse ninja output and get the header files""" |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 55 | all_headers = {} |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 56 | |
wychen | 97580de | 2017-06-13 00:52:44 | [diff] [blame] | 57 | # Ninja always uses "/", even on Windows. |
| 58 | prefix = '../../' |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 59 | |
| 60 | is_valid = False |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 61 | obj_file = '' |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 62 | for line in ninja_out: |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 63 | if line.startswith(' '): |
| 64 | if not is_valid: |
| 65 | continue |
| 66 | if line.endswith('.h') or line.endswith('.hh'): |
| 67 | f = line.strip() |
| 68 | if f.startswith(prefix): |
| 69 | f = f[6:] # Remove the '../../' prefix |
| 70 | # build/ only contains build-specific files like build_config.h |
| 71 | # and buildflag.h, and system header files, so they should be |
| 72 | # skipped. |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 73 | if f.startswith(out_dir) or f.startswith('out'): |
| 74 | continue |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 75 | if not f.startswith('build'): |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 76 | all_headers.setdefault(f, []) |
| 77 | if not skip_obj: |
| 78 | all_headers[f].append(obj_file) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 79 | else: |
| 80 | is_valid = line.endswith('(VALID)') |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 81 | obj_file = line.split(':')[0] |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 82 | |
| 83 | return all_headers |
| 84 | |
| 85 | |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 86 | def GetHeadersFromGN(out_dir, q): |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 87 | """Return all the header files from GN""" |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 88 | |
| 89 | tmp = None |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 90 | ans, err = set(), None |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 91 | try: |
wychen | 97580de | 2017-06-13 00:52:44 | [diff] [blame] | 92 | # Argument |dir| is needed to make sure it's on the same drive on Windows. |
| 93 | # dir='' means dir='.', but doesn't introduce an unneeded prefix. |
| 94 | tmp = tempfile.mkdtemp(dir='') |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 95 | shutil.copy2(os.path.join(out_dir, 'args.gn'), |
| 96 | os.path.join(tmp, 'args.gn')) |
| 97 | # Do "gn gen" in a temp dir to prevent dirtying |out_dir|. |
wychen | 97580de | 2017-06-13 00:52:44 | [diff] [blame] | 98 | gn_exe = 'gn.bat' if sys.platform == 'win32' else 'gn' |
nodir | 6a40e940 | 2017-06-07 05:49:03 | [diff] [blame] | 99 | subprocess.check_call([ |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 100 | os.path.join(DEPOT_TOOLS_DIR, gn_exe), 'gen', tmp, '--ide=json', '-q']) |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 101 | gn_json = json.load(open(os.path.join(tmp, 'project.json'))) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 102 | ans = ParseGNProjectJSON(gn_json, out_dir, tmp) |
| 103 | except Exception as e: |
| 104 | err = str(e) |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 105 | finally: |
| 106 | if tmp: |
| 107 | shutil.rmtree(tmp) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 108 | q.put((ans, err)) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 109 | |
| 110 | |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 111 | def ParseGNProjectJSON(gn, out_dir, tmp_out): |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 112 | """Parse GN output and get the header files""" |
| 113 | all_headers = set() |
| 114 | |
| 115 | for _target, properties in gn['targets'].iteritems(): |
wychen | 5523578 | 2017-04-28 01:59:15 | [diff] [blame] | 116 | sources = properties.get('sources', []) |
| 117 | public = properties.get('public', []) |
| 118 | # Exclude '"public": "*"'. |
| 119 | if type(public) is list: |
| 120 | sources += public |
| 121 | for f in sources: |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 122 | if f.endswith('.h') or f.endswith('.hh'): |
| 123 | if f.startswith('//'): |
| 124 | f = f[2:] # Strip the '//' prefix. |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 125 | if f.startswith(tmp_out): |
| 126 | f = out_dir + f[len(tmp_out):] |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 127 | all_headers.add(f) |
| 128 | |
| 129 | return all_headers |
| 130 | |
| 131 | |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 132 | def GetDepsPrefixes(q): |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 133 | """Return all the folders controlled by DEPS file""" |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 134 | prefixes, err = set(), None |
| 135 | try: |
wychen | 97580de | 2017-06-13 00:52:44 | [diff] [blame] | 136 | gclient_exe = 'gclient.bat' if sys.platform == 'win32' else 'gclient' |
nodir | 6a40e940 | 2017-06-07 05:49:03 | [diff] [blame] | 137 | gclient_out = subprocess.check_output([ |
wychen | 97580de | 2017-06-13 00:52:44 | [diff] [blame] | 138 | os.path.join(DEPOT_TOOLS_DIR, gclient_exe), |
| 139 | 'recurse', '--no-progress', '-j1', |
| 140 | 'python', '-c', 'import os;print os.environ["GCLIENT_DEP_PATH"]'], |
| 141 | universal_newlines=True) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 142 | for i in gclient_out.split('\n'): |
| 143 | if i.startswith('src/'): |
| 144 | i = i[4:] |
| 145 | prefixes.add(i) |
| 146 | except Exception as e: |
| 147 | err = str(e) |
| 148 | q.put((prefixes, err)) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 149 | |
| 150 | |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 151 | def IsBuildClean(out_dir): |
nodir | 6a40e940 | 2017-06-07 05:49:03 | [diff] [blame] | 152 | cmd = [os.path.join(DEPOT_TOOLS_DIR, 'ninja'), '-C', out_dir, '-n'] |
wychen | 67aabe0 | 2017-06-17 00:12:04 | [diff] [blame] | 153 | try: |
| 154 | out = subprocess.check_output(cmd) |
| 155 | return 'no work to do.' in out |
| 156 | except Exception as e: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 157 | print(e) |
wychen | 67aabe0 | 2017-06-17 00:12:04 | [diff] [blame] | 158 | return False |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 159 | |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 160 | def ParseWhiteList(whitelist): |
| 161 | out = set() |
| 162 | for line in whitelist.split('\n'): |
| 163 | line = re.sub(r'#.*', '', line).strip() |
| 164 | if line: |
| 165 | out.add(line) |
| 166 | return out |
| 167 | |
| 168 | |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 169 | def FilterOutDepsedRepo(files, deps): |
| 170 | return {f for f in files if not any(f.startswith(d) for d in deps)} |
| 171 | |
| 172 | |
| 173 | def GetNonExistingFiles(lst): |
| 174 | out = set() |
| 175 | for f in lst: |
| 176 | if not os.path.isfile(f): |
| 177 | out.add(f) |
| 178 | return out |
| 179 | |
| 180 | |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 181 | def main(): |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 182 | |
| 183 | def DumpJson(data): |
| 184 | if args.json: |
| 185 | with open(args.json, 'w') as f: |
| 186 | json.dump(data, f) |
| 187 | |
| 188 | def PrintError(msg): |
| 189 | DumpJson([]) |
| 190 | parser.error(msg) |
| 191 | |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 192 | parser = argparse.ArgumentParser(description=''' |
| 193 | NOTE: Use ninja to build all targets in OUT_DIR before running |
| 194 | this script.''') |
| 195 | parser.add_argument('--out-dir', metavar='OUT_DIR', default='out/Release', |
| 196 | help='output directory of the build') |
| 197 | parser.add_argument('--json', |
| 198 | help='JSON output filename for missing headers') |
| 199 | parser.add_argument('--whitelist', help='file containing whitelist') |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 200 | parser.add_argument('--skip-dirty-check', action='store_true', |
| 201 | help='skip checking whether the build is dirty') |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 202 | parser.add_argument('--verbose', action='store_true', |
| 203 | help='print more diagnostic info') |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 204 | |
| 205 | args, _extras = parser.parse_known_args() |
| 206 | |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 207 | if not os.path.isdir(args.out_dir): |
| 208 | parser.error('OUT_DIR "%s" does not exist.' % args.out_dir) |
| 209 | |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 210 | if not args.skip_dirty_check and not IsBuildClean(args.out_dir): |
| 211 | dirty_msg = 'OUT_DIR looks dirty. You need to build all there.' |
| 212 | if args.json: |
| 213 | # Assume running on the bots. Silently skip this step. |
| 214 | # This is possible because "analyze" step can be wrong due to |
| 215 | # underspecified header files. See crbug.com/725877 |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 216 | print(dirty_msg) |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 217 | DumpJson([]) |
| 218 | return 0 |
| 219 | else: |
| 220 | # Assume running interactively. |
| 221 | parser.error(dirty_msg) |
| 222 | |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 223 | d_q = Queue() |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 224 | d_p = Process(target=GetHeadersFromNinja, args=(args.out_dir, True, d_q,)) |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 225 | d_p.start() |
| 226 | |
| 227 | gn_q = Queue() |
| 228 | gn_p = Process(target=GetHeadersFromGN, args=(args.out_dir, gn_q,)) |
| 229 | gn_p.start() |
| 230 | |
| 231 | deps_q = Queue() |
| 232 | deps_p = Process(target=GetDepsPrefixes, args=(deps_q,)) |
| 233 | deps_p.start() |
| 234 | |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 235 | d, d_err = d_q.get() |
| 236 | gn, gn_err = gn_q.get() |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 237 | missing = set(d.keys()) - gn |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 238 | nonexisting = GetNonExistingFiles(gn) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 239 | |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 240 | deps, deps_err = deps_q.get() |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 241 | missing = FilterOutDepsedRepo(missing, deps) |
| 242 | nonexisting = FilterOutDepsedRepo(nonexisting, deps) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 243 | |
wychen | ef74ec99 | 2017-04-27 06:28:25 | [diff] [blame] | 244 | d_p.join() |
| 245 | gn_p.join() |
| 246 | deps_p.join() |
| 247 | |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 248 | if d_err: |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 249 | PrintError(d_err) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 250 | if gn_err: |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 251 | PrintError(gn_err) |
wychen | 09692cd | 2017-05-26 01:57:16 | [diff] [blame] | 252 | if deps_err: |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 253 | PrintError(deps_err) |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 254 | if len(GetNonExistingFiles(d)) > 0: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 255 | print('Non-existing files in ninja deps:', GetNonExistingFiles(d)) |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 256 | PrintError('Found non-existing files in ninja deps. You should ' + |
| 257 | 'build all in OUT_DIR.') |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 258 | if len(d) == 0: |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 259 | PrintError('OUT_DIR looks empty. You should build all there.') |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 260 | if any((('/gen/' in i) for i in nonexisting)): |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 261 | PrintError('OUT_DIR looks wrong. You should build all there.') |
wychen | 0362911 | 2017-05-25 20:37:18 | [diff] [blame] | 262 | |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 263 | if args.whitelist: |
| 264 | whitelist = ParseWhiteList(open(args.whitelist).read()) |
| 265 | missing -= whitelist |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 266 | nonexisting -= whitelist |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 267 | |
| 268 | missing = sorted(missing) |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 269 | nonexisting = sorted(nonexisting) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 270 | |
wychen | 0735fd76 | 2017-06-03 07:53:26 | [diff] [blame] | 271 | DumpJson(sorted(missing + nonexisting)) |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 272 | |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 273 | if len(missing) == 0 and len(nonexisting) == 0: |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 274 | return 0 |
| 275 | |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 276 | if len(missing) > 0: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 277 | print('\nThe following files should be included in gn files:') |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 278 | for i in missing: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 279 | print(i) |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 280 | |
| 281 | if len(nonexisting) > 0: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 282 | print('\nThe following non-existing files should be removed from gn files:') |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 283 | for i in nonexisting: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 284 | print(i) |
wychen | e7a3d648 | 2017-04-29 07:12:17 | [diff] [blame] | 285 | |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 286 | if args.verbose: |
| 287 | # Only get detailed obj dependency here since it is slower. |
| 288 | GetHeadersFromNinja(args.out_dir, False, d_q) |
| 289 | d, d_err = d_q.get() |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 290 | print('\nDetailed dependency info:') |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 291 | for f in missing: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 292 | print(f) |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 293 | for cc in d[f]: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 294 | print(' ', cc) |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 295 | |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 296 | print('\nMissing headers sorted by number of affected object files:') |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 297 | count = {k: len(v) for (k, v) in d.iteritems()} |
| 298 | for f in sorted(count, key=count.get, reverse=True): |
| 299 | if f in missing: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 300 | print(count[f], f) |
wychen | 8cc3123 | 2017-06-13 10:21:23 | [diff] [blame] | 301 | |
Wei-Yin Chen (陳威尹) | df00f5d | 2019-03-04 21:25:22 | [diff] [blame] | 302 | if args.json: |
| 303 | # Assume running on the bots. Temporarily return 0 before |
| 304 | # https://crbug.com/937847 is fixed. |
| 305 | return 0 |
wychen | 037f6e9e | 2017-01-10 17:14:56 | [diff] [blame] | 306 | return 1 |
| 307 | |
| 308 | |
| 309 | if __name__ == '__main__': |
| 310 | sys.exit(main()) |