OLD | NEW |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 "test262": "d8", | 80 "test262": "d8", |
81 "unittests": "unittests", | 81 "unittests": "unittests", |
82 "webkit": "d8"} | 82 "webkit": "d8"} |
83 | 83 |
84 OUTDIR = "out" | 84 OUTDIR = "out" |
85 | 85 |
86 def DetectGoma(): | 86 def DetectGoma(): |
87 home_goma = os.path.expanduser("~/goma") | 87 home_goma = os.path.expanduser("~/goma") |
88 if os.path.exists(home_goma): | 88 if os.path.exists(home_goma): |
89 return home_goma | 89 return home_goma |
| 90 if os.environ.get("GOMA_DIR"): |
| 91 return os.environ.get("GOMA_DIR") |
90 if os.environ.get("GOMADIR"): | 92 if os.environ.get("GOMADIR"): |
91 return os.environ.get("GOMADIR") | 93 return os.environ.get("GOMADIR") |
92 return None | 94 return None |
93 | 95 |
94 GOMADIR = DetectGoma() | 96 GOMADIR = DetectGoma() |
95 IS_GOMA_MACHINE = GOMADIR is not None | 97 IS_GOMA_MACHINE = GOMADIR is not None |
96 | 98 |
97 USE_GOMA = "true" if IS_GOMA_MACHINE else "false" | 99 USE_GOMA = "true" if IS_GOMA_MACHINE else "false" |
98 BUILD_OPTS = BUILD_OPTS_GOMA if IS_GOMA_MACHINE else BUILD_OPTS_DEFAULT | 100 BUILD_OPTS = BUILD_OPTS_GOMA if IS_GOMA_MACHINE else BUILD_OPTS_DEFAULT |
99 | 101 |
100 RELEASE_ARGS_TEMPLATE = """\ | 102 RELEASE_ARGS_TEMPLATE = """\ |
101 is_component_build = false | 103 is_component_build = false |
102 is_debug = false | 104 is_debug = false |
103 %s | 105 %s |
104 use_goma = {GOMA} | 106 use_goma = {GOMA} |
| 107 goma_dir = \"{GOMA_DIR}\" |
105 v8_enable_backtrace = true | 108 v8_enable_backtrace = true |
106 v8_enable_disassembler = true | 109 v8_enable_disassembler = true |
107 v8_enable_object_print = true | 110 v8_enable_object_print = true |
108 v8_enable_verify_heap = true | 111 v8_enable_verify_heap = true |
109 """.replace("{GOMA}", USE_GOMA) | 112 """.replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", GOMADIR) |
110 | 113 |
111 DEBUG_ARGS_TEMPLATE = """\ | 114 DEBUG_ARGS_TEMPLATE = """\ |
112 is_component_build = true | 115 is_component_build = true |
113 is_debug = true | 116 is_debug = true |
114 symbol_level = 2 | 117 symbol_level = 2 |
115 %s | 118 %s |
116 use_goma = {GOMA} | 119 use_goma = {GOMA} |
| 120 goma_dir = \"{GOMA_DIR}\" |
117 v8_enable_backtrace = true | 121 v8_enable_backtrace = true |
118 v8_enable_slow_dchecks = true | 122 v8_enable_slow_dchecks = true |
119 v8_optimized_debug = false | 123 v8_optimized_debug = false |
120 """.replace("{GOMA}", USE_GOMA) | 124 """.replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", GOMADIR) |
121 | 125 |
122 OPTDEBUG_ARGS_TEMPLATE = """\ | 126 OPTDEBUG_ARGS_TEMPLATE = """\ |
123 is_component_build = true | 127 is_component_build = true |
124 is_debug = true | 128 is_debug = true |
125 symbol_level = 1 | 129 symbol_level = 1 |
126 %s | 130 %s |
127 use_goma = {GOMA} | 131 use_goma = {GOMA} |
| 132 goma_dir = \"{GOMA_DIR}\" |
128 v8_enable_backtrace = true | 133 v8_enable_backtrace = true |
129 v8_enable_verify_heap = true | 134 v8_enable_verify_heap = true |
130 v8_optimized_debug = true | 135 v8_optimized_debug = true |
131 """.replace("{GOMA}", USE_GOMA) | 136 """.replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", GOMADIR) |
132 | 137 |
133 ARGS_TEMPLATES = { | 138 ARGS_TEMPLATES = { |
134 "release": RELEASE_ARGS_TEMPLATE, | 139 "release": RELEASE_ARGS_TEMPLATE, |
135 "debug": DEBUG_ARGS_TEMPLATE, | 140 "debug": DEBUG_ARGS_TEMPLATE, |
136 "optdebug": OPTDEBUG_ARGS_TEMPLATE | 141 "optdebug": OPTDEBUG_ARGS_TEMPLATE |
137 } | 142 } |
138 | 143 |
139 def PrintHelpAndExit(): | 144 def PrintHelpAndExit(): |
140 print(__doc__) | 145 print(__doc__) |
141 print(HELP) | 146 print(HELP) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 for c in configs: | 365 for c in configs: |
361 return_code += configs[c].RunTests() | 366 return_code += configs[c].RunTests() |
362 if return_code == 0: | 367 if return_code == 0: |
363 _Notify('Done!', 'V8 compilation finished successfully.') | 368 _Notify('Done!', 'V8 compilation finished successfully.') |
364 else: | 369 else: |
365 _Notify('Error!', 'V8 compilation finished with errors.') | 370 _Notify('Error!', 'V8 compilation finished with errors.') |
366 return return_code | 371 return return_code |
367 | 372 |
368 if __name__ == "__main__": | 373 if __name__ == "__main__": |
369 sys.exit(Main(sys.argv)) | 374 sys.exit(Main(sys.argv)) |
OLD | NEW |