| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 except NotImplementedError: | 140 except NotImplementedError: |
| 141 print 'cpu_count() is not implemented, using default value.' | 141 print 'cpu_count() is not implemented, using default value.' |
| 142 number_of_processors = 1 | 142 number_of_processors = 1 |
| 143 if number_of_processors > 3: | 143 if number_of_processors > 3: |
| 144 max_subprocs = str(number_of_processors - 1) | 144 max_subprocs = str(number_of_processors - 1) |
| 145 max_heavy_subprocs = str(number_of_processors / 2) | 145 max_heavy_subprocs = str(number_of_processors / 2) |
| 146 env['GOMA_BURST_MAX_SUBPROCS'] = max_subprocs | 146 env['GOMA_BURST_MAX_SUBPROCS'] = max_subprocs |
| 147 env['GOMA_BURST_MAX_SUBPROCS_LOW'] = max_subprocs | 147 env['GOMA_BURST_MAX_SUBPROCS_LOW'] = max_subprocs |
| 148 env['GOMA_BURST_MAX_SUBPROCS_HEAVY'] = max_heavy_subprocs | 148 env['GOMA_BURST_MAX_SUBPROCS_HEAVY'] = max_heavy_subprocs |
| 149 | 149 |
| 150 # Allow to wait initial ping 30 seconds with 10 seconds interval. | |
| 151 # Since retrying should cost more than 30 seconds, it should be better | |
| 152 # to wait initial ping longer than default (10 seconds). | |
| 153 env['GOMA_PING_TIMEOUT_SEC'] = '30' | |
| 154 env['GOMA_PING_RETRY_INTERVAL'] = '10' | |
| 155 | |
| 156 # Caches CRLs in GOMA_CACHE_DIR. | 150 # Caches CRLs in GOMA_CACHE_DIR. |
| 157 # Since downloading CRLs is usually slow, caching them may improves | 151 # Since downloading CRLs is usually slow, caching them may improves |
| 158 # compiler_proxy start time. | 152 # compiler_proxy start time. |
| 159 if not os.path.exists(options.goma_cache_dir): | 153 if not os.path.exists(options.goma_cache_dir): |
| 160 os.mkdir(options.goma_cache_dir, 0700) | 154 os.mkdir(options.goma_cache_dir, 0700) |
| 161 env['GOMA_CACHE_DIR'] = options.goma_cache_dir | 155 env['GOMA_CACHE_DIR'] = options.goma_cache_dir |
| 162 | 156 |
| 163 # Enable DepsCache. DepsCache caches the list of files to send goma server. | 157 # Enable DepsCache. DepsCache caches the list of files to send goma server. |
| 164 # This will greatly improve build speed when cache is warmed. | 158 # This will greatly improve build speed when cache is warmed. |
| 165 # The cache file is stored in the target output directory. | 159 # The cache file is stored in the target output directory. |
| (...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) | 1329 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) |
| 1336 return 2 | 1330 return 2 |
| 1337 | 1331 |
| 1338 options.target_output_dir = get_target_build_dir(args, options) | 1332 options.target_output_dir = get_target_build_dir(args, options) |
| 1339 | 1333 |
| 1340 return main(options, args) | 1334 return main(options, args) |
| 1341 | 1335 |
| 1342 | 1336 |
| 1343 if '__main__' == __name__: | 1337 if '__main__' == __name__: |
| 1344 sys.exit(real_main()) | 1338 sys.exit(real_main()) |
| OLD | NEW |