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

Side by Side Diff: tools/dev/gm.py

Issue 2754253002: [tools] gm.py: start goma when it isn't running (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2017 the V8 project authors. All rights reserved. 2 # Copyright 2017 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """\ 5 """\
6 Convenience wrapper for compiling V8 with gn/ninja and running tests. 6 Convenience wrapper for compiling V8 with gn/ninja and running tests.
7 Sets up build output directories if they don't exist. 7 Sets up build output directories if they don't exist.
8 Produces simulator builds for non-Intel target architectures. 8 Produces simulator builds for non-Intel target architectures.
9 Uses Goma by default if it is detected (at output directory setup time). 9 Uses Goma by default if it is detected (at output directory setup time).
10 Expects to be run from the root of a V8 checkout. 10 Expects to be run from the root of a V8 checkout.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 "message": "d8", 73 "message": "d8",
74 "mjsunit": "d8", 74 "mjsunit": "d8",
75 "mozilla": "d8", 75 "mozilla": "d8",
76 "preparser": "d8", 76 "preparser": "d8",
77 "test262": "d8", 77 "test262": "d8",
78 "unittests": "unittests", 78 "unittests": "unittests",
79 "webkit": "d8"} 79 "webkit": "d8"}
80 80
81 OUTDIR = "out" 81 OUTDIR = "out"
82 82
83 IS_GOMA_MACHINE = (os.path.exists(os.path.expanduser("~/goma")) or 83 def DetectGoma():
84 os.environ.get('GOMADIR')) 84 home_goma = os.path.expanduser("~/goma")
85 if os.path.exists(home_goma):
86 return home_goma
87 if os.environ.get("GOMADIR"):
88 return os.environ.get("GOMADIR")
89 return None
90
91 GOMADIR = DetectGoma()
92 IS_GOMA_MACHINE = GOMADIR is not None
85 93
86 USE_GOMA = "true" if IS_GOMA_MACHINE else "false" 94 USE_GOMA = "true" if IS_GOMA_MACHINE else "false"
87 BUILD_OPTS = BUILD_OPTS_GOMA if IS_GOMA_MACHINE else BUILD_OPTS_DEFAULT 95 BUILD_OPTS = BUILD_OPTS_GOMA if IS_GOMA_MACHINE else BUILD_OPTS_DEFAULT
88 96
89 RELEASE_ARGS_TEMPLATE = """\ 97 RELEASE_ARGS_TEMPLATE = """\
90 is_component_build = false 98 is_component_build = false
91 is_debug = false 99 is_debug = false
92 %s 100 %s
93 use_goma = {GOMA} 101 use_goma = {GOMA}
94 v8_enable_backtrace = true 102 v8_enable_backtrace = true
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 self.ParseArg(argstring) 287 self.ParseArg(argstring)
280 self.ProcessGlobalActions() 288 self.ProcessGlobalActions()
281 for c in self.configs: 289 for c in self.configs:
282 self.configs[c].Extend(self.global_targets, self.global_tests) 290 self.configs[c].Extend(self.global_targets, self.global_tests)
283 return self.configs 291 return self.configs
284 292
285 def Main(argv): 293 def Main(argv):
286 parser = ArgumentParser() 294 parser = ArgumentParser()
287 configs = parser.ParseArguments(argv[1:]) 295 configs = parser.ParseArguments(argv[1:])
288 return_code = 0 296 return_code = 0
297 # If we have Goma but it is not running, start it.
298 if (GOMADIR is not None and
299 _Call("ps -e | grep compiler_proxy > /dev/null", silent=True) != 0):
300 _Call("%s/goma_ctl.py ensure_start" % GOMADIR)
289 for c in configs: 301 for c in configs:
290 return_code += configs[c].Build() 302 return_code += configs[c].Build()
291 if return_code == 0: 303 if return_code == 0:
292 for c in configs: 304 for c in configs:
293 return_code += configs[c].RunTests() 305 return_code += configs[c].RunTests()
294 if return_code == 0: 306 if return_code == 0:
295 _Call("notify-send 'Done!' 'V8 compilation finished successfully.'", 307 _Call("notify-send 'Done!' 'V8 compilation finished successfully.'",
296 silent=True) 308 silent=True)
297 else: 309 else:
298 _Call("notify-send 'Error!' 'V8 compilation finished with errors.'", 310 _Call("notify-send 'Error!' 'V8 compilation finished with errors.'",
299 silent=True) 311 silent=True)
300 return return_code 312 return return_code
301 313
302 if __name__ == "__main__": 314 if __name__ == "__main__":
303 sys.exit(Main(sys.argv)) 315 sys.exit(Main(sys.argv))
OLDNEW
« 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