| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 """A tool to build chrome, executed by buildbot. | 6 """A tool to build chrome, executed by buildbot. |
| 7 | 7 |
| 8 When this is run, the current directory (cwd) should be the outer build | 8 When this is run, the current directory (cwd) should be the outer build |
| 9 directory (e.g., chrome-release/build/). | 9 directory (e.g., chrome-release/build/). |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 env['GOMA_COMPILER_INFO_CACHE_FILE'] = 'goma-compiler-info.cache' | 170 env['GOMA_COMPILER_INFO_CACHE_FILE'] = 'goma-compiler-info.cache' |
| 171 | 171 |
| 172 if options.build_data_dir: | 172 if options.build_data_dir: |
| 173 env['GOMA_DUMP_STATS_FILE'] = os.path.join(options.build_data_dir, | 173 env['GOMA_DUMP_STATS_FILE'] = os.path.join(options.build_data_dir, |
| 174 'goma_stats_proto') | 174 'goma_stats_proto') |
| 175 | 175 |
| 176 # goma is requested. | 176 # goma is requested. |
| 177 goma_key = os.path.join(options.goma_dir, 'goma.key') | 177 goma_key = os.path.join(options.goma_dir, 'goma.key') |
| 178 if os.path.exists(goma_key): | 178 if os.path.exists(goma_key): |
| 179 env['GOMA_API_KEY_FILE'] = goma_key | 179 env['GOMA_API_KEY_FILE'] = goma_key |
| 180 if options.goma_service_account_json_file: |
| 181 env['GOMA_SERVICE_ACCOUNT_JSON_FILE'] = \ |
| 182 options.goma_service_account_json_file |
| 180 if chromium_utils.IsWindows(): | 183 if chromium_utils.IsWindows(): |
| 181 env['GOMA_RPC_EXTRA_PARAMS'] = '?win' | 184 env['GOMA_RPC_EXTRA_PARAMS'] = '?win' |
| 182 goma_start_command = ['restart'] if options.clobber else ['ensure_start'] | 185 goma_start_command = ['restart'] if options.clobber else ['ensure_start'] |
| 183 goma_ctl_cmd = [sys.executable, | 186 goma_ctl_cmd = [sys.executable, |
| 184 os.path.join(options.goma_dir, 'goma_ctl.py')] | 187 os.path.join(options.goma_dir, 'goma_ctl.py')] |
| 185 result = chromium_utils.RunCommand(goma_ctl_cmd + goma_start_command, env=env) | 188 result = chromium_utils.RunCommand(goma_ctl_cmd + goma_start_command, env=env) |
| 186 if not result: | 189 if not result: |
| 187 # goma started sucessfully. | 190 # goma started sucessfully. |
| 188 return True | 191 return True |
| 189 | 192 |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 help='Enable goma remote link.') | 1261 help='Enable goma remote link.') |
| 1259 option_parser.add_option('--goma-enable-compiler-info-cache', | 1262 option_parser.add_option('--goma-enable-compiler-info-cache', |
| 1260 action='store_true', | 1263 action='store_true', |
| 1261 help='Enable goma CompilerInfo cache') | 1264 help='Enable goma CompilerInfo cache') |
| 1262 option_parser.add_option('--goma-store-local-run-output', default=None, | 1265 option_parser.add_option('--goma-store-local-run-output', default=None, |
| 1263 help='Store local run output to goma servers.') | 1266 help='Store local run output to goma servers.') |
| 1264 option_parser.add_option('--goma-fail-fast', action='store_true') | 1267 option_parser.add_option('--goma-fail-fast', action='store_true') |
| 1265 option_parser.add_option('--goma-disable-local-fallback', action='store_true') | 1268 option_parser.add_option('--goma-disable-local-fallback', action='store_true') |
| 1266 option_parser.add_option('--goma-jsonstatus', | 1269 option_parser.add_option('--goma-jsonstatus', |
| 1267 help='Specify a file to dump goma_ctl jsonstatus.') | 1270 help='Specify a file to dump goma_ctl jsonstatus.') |
| 1271 option_parser.add_option('--goma-service-account-json-file', |
| 1272 help='Specify a file containing goma service account' |
| 1273 ' credentials') |
| 1268 option_parser.add_option('--verbose', action='store_true') | 1274 option_parser.add_option('--verbose', action='store_true') |
| 1269 option_parser.add_option('--gsutil-py-path', | 1275 option_parser.add_option('--gsutil-py-path', |
| 1270 help='Specify path to gsutil.py script.') | 1276 help='Specify path to gsutil.py script.') |
| 1271 option_parser.add_option('--ninja-path', default='ninja', | 1277 option_parser.add_option('--ninja-path', default='ninja', |
| 1272 help='Specify path to the ninja tool.') | 1278 help='Specify path to the ninja tool.') |
| 1273 option_parser.add_option('--ninja-ensure-up-to-date', action='store_true', | 1279 option_parser.add_option('--ninja-ensure-up-to-date', action='store_true', |
| 1274 help='Checks the output of the ninja builder to ' | 1280 help='Checks the output of the ninja builder to ' |
| 1275 'confirm that a second compile immediately ' | 1281 'confirm that a second compile immediately ' |
| 1276 'the first is a no-op.') | 1282 'the first is a no-op.') |
| 1277 | 1283 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1345 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) | 1351 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) |
| 1346 return 2 | 1352 return 2 |
| 1347 | 1353 |
| 1348 options.target_output_dir = get_target_build_dir(args, options) | 1354 options.target_output_dir = get_target_build_dir(args, options) |
| 1349 | 1355 |
| 1350 return main(options, args) | 1356 return main(options, args) |
| 1351 | 1357 |
| 1352 | 1358 |
| 1353 if '__main__' == __name__: | 1359 if '__main__' == __name__: |
| 1354 sys.exit(real_main()) | 1360 sys.exit(real_main()) |
| OLD | NEW |