Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Utility class to build the chromium master BuildFactory's. | 5 """Utility class to build the chromium master BuildFactory's. |
| 6 | 6 |
| 7 Based on gclient_factory.py and adds chromium-specific steps.""" | 7 Based on gclient_factory.py and adds chromium-specific steps.""" |
| 8 | 8 |
| 9 import re | 9 import re |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 def FixForGomaWin(options, target, gclient_env): | 63 def FixForGomaWin(options, target, gclient_env): |
| 64 """Fix gyp variables required for goma on Windows, | 64 """Fix gyp variables required for goma on Windows, |
| 65 unless it is already set. | 65 unless it is already set. |
| 66 | 66 |
| 67 Args: | 67 Args: |
| 68 options: a list of string for factory options. | 68 options: a list of string for factory options. |
| 69 target: a string of build target (e.g. Debug, Release). | 69 target: a string of build target (e.g. Debug, Release). |
| 70 gclient_env: a dict for gclient_env. | 70 gclient_env: a dict for gclient_env. |
| 71 """ | 71 """ |
| 72 options = options or {} | 72 options = options or {} |
| 73 if (not '--compiler=goma' in options and | 73 if ('--compiler=goma' not in options and |
| 74 not '--compiler=goma-clang' in options): | 74 '--compiler=goma-clang' not in options): |
| 75 return | 75 return |
| 76 gyp_defines = gclient_env.get('GYP_DEFINES', '') | 76 gyp_defines = gclient_env.get('GYP_DEFINES', '') |
| 77 # goma couldn't work with pdbserv. | 77 # goma couldn't work with pdbserv. |
| 78 if 'fastbuild=1' not in gyp_defines and 'win_z7=1' not in gyp_defines: | 78 if 'fastbuild=1' not in gyp_defines and 'win_z7=1' not in gyp_defines: |
| 79 if target.startswith('Debug'): | 79 if target.startswith('Debug'): |
| 80 gyp_defines += ' win_z7=1' | 80 gyp_defines += ' win_z7=1' |
| 81 else: | 81 else: |
| 82 gyp_defines += ' fastbuild=1' | 82 gyp_defines += ' fastbuild=1' |
| 83 # goma couldn't handle precompiled headers. | 83 # goma couldn't handle precompiled headers. |
| 84 if 'chromium_win_pch=0' not in gyp_defines: | 84 if 'chromium_win_pch=0' not in gyp_defines: |
| 85 gyp_defines += ' chromium_win_pch=0' | 85 gyp_defines += ' chromium_win_pch=0' |
| 86 gclient_env['GYP_DEFINES'] = gyp_defines | 86 gclient_env['GYP_DEFINES'] = gyp_defines |
| 87 | 87 |
| 88 | 88 |
| 89 def SetGomaGypDefines(options, gclient_env, target_platform): | |
| 90 """Adds goma flags to GYP_DEFINES.""" | |
| 91 options = options or {} | |
| 92 if ('--compiler=goma' not in options and | |
| 93 '--compiler=goma-clang' not in options and | |
| 94 '--compiler=jsonclang' not in options): | |
| 95 return | |
| 96 if target_platform == 'win32': | |
| 97 gomadir = r'C:\b\build\goma' | |
| 98 else: | |
| 99 gomadir = '/b/build/goma' | |
|
iannucci
2014/04/08 20:45:50
!!!!!! :(
This terrifies me (and won't actually w
Nico
2014/04/08 20:51:09
We could add a gyp_chromium wrapper script. It's c
| |
| 100 gyp_defines = gclient_env.get('GYP_DEFINES', '') | |
| 101 gyp_defines += ' use_goma=1 gomadir=%s' % gomadir | |
| 102 gclient_env['GYP_DEFINES'] = gyp_defines | |
| 103 | |
| 104 | |
| 89 class ChromiumFactory(gclient_factory.GClientFactory): | 105 class ChromiumFactory(gclient_factory.GClientFactory): |
| 90 """Encapsulates data and methods common to the chromium master.cfg files.""" | 106 """Encapsulates data and methods common to the chromium master.cfg files.""" |
| 91 | 107 |
| 92 DEFAULT_TARGET_PLATFORM = config.Master.default_platform | 108 DEFAULT_TARGET_PLATFORM = config.Master.default_platform |
| 93 | 109 |
| 94 MEMORY_TOOLS_GYP_DEFINES = 'build_for_tool=memcheck' | 110 MEMORY_TOOLS_GYP_DEFINES = 'build_for_tool=memcheck' |
| 95 | 111 |
| 96 # gclient custom vars | 112 # gclient custom vars |
| 97 CUSTOM_VARS_GOOGLECODE_URL = ('googlecode_url', config.Master.googlecode_url) | 113 CUSTOM_VARS_GOOGLECODE_URL = ('googlecode_url', config.Master.googlecode_url) |
| 98 CUSTOM_VARS_SOURCEFORGE_URL = ('sourceforge_url', | 114 CUSTOM_VARS_SOURCEFORGE_URL = ('sourceforge_url', |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 981 # revision in their filename. For this to work correctly, the testers | 997 # revision in their filename. For this to work correctly, the testers |
| 982 # need to be on a Triggerable that's activated by their builder. | 998 # need to be on a Triggerable that's activated by their builder. |
| 983 factory_properties.setdefault('webkit_dir', 'third_party/WebKit/Source') | 999 factory_properties.setdefault('webkit_dir', 'third_party/WebKit/Source') |
| 984 | 1000 |
| 985 factory_properties['gclient_env'] = \ | 1001 factory_properties['gclient_env'] = \ |
| 986 factory_properties.get('gclient_env', {}).copy() | 1002 factory_properties.get('gclient_env', {}).copy() |
| 987 # Defaults gyp to VS2010. | 1003 # Defaults gyp to VS2010. |
| 988 if self._target_platform == 'win32': | 1004 if self._target_platform == 'win32': |
| 989 factory_properties['gclient_env'].setdefault('GYP_MSVS_VERSION', '2010') | 1005 factory_properties['gclient_env'].setdefault('GYP_MSVS_VERSION', '2010') |
| 990 FixForGomaWin(options, target, factory_properties['gclient_env']) | 1006 FixForGomaWin(options, target, factory_properties['gclient_env']) |
| 1007 SetGomaGypDefines( | |
| 1008 options, factory_properties['gclient_env'], self._target_platform) | |
| 991 tests = tests or [] | 1009 tests = tests or [] |
| 992 | 1010 |
| 993 if factory_properties.get('needs_valgrind'): | 1011 if factory_properties.get('needs_valgrind'): |
| 994 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND] | 1012 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND] |
| 995 elif factory_properties.get('needs_tsan_win'): | 1013 elif factory_properties.get('needs_tsan_win'): |
| 996 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN] | 1014 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN] |
| 997 elif factory_properties.get('needs_drmemory'): | 1015 elif factory_properties.get('needs_drmemory'): |
| 998 if 'drmemory.DEPS' not in [s.name for s in self._solutions]: | 1016 if 'drmemory.DEPS' not in [s.name for s in self._solutions]: |
| 999 self._solutions.append(gclient_factory.GClientSolution( | 1017 self._solutions.append(gclient_factory.GClientSolution( |
| 1000 config.Master.trunk_url + | 1018 config.Master.trunk_url + |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1389 mode=None, slave_type='BuilderTester', options=None, | 1407 mode=None, slave_type='BuilderTester', options=None, |
| 1390 compile_timeout=1200, build_url=None, project=None, | 1408 compile_timeout=1200, build_url=None, project=None, |
| 1391 factory_properties=None): | 1409 factory_properties=None): |
| 1392 # Make sure the solution is not already there. | 1410 # Make sure the solution is not already there. |
| 1393 if 'cros_deps' not in [s.name for s in self._solutions]: | 1411 if 'cros_deps' not in [s.name for s in self._solutions]: |
| 1394 self._solutions.append(gclient_factory.GClientSolution( | 1412 self._solutions.append(gclient_factory.GClientSolution( |
| 1395 config.Master.trunk_url + '/src/tools/cros.DEPS', name='cros_deps')) | 1413 config.Master.trunk_url + '/src/tools/cros.DEPS', name='cros_deps')) |
| 1396 return self.ChromiumFactory(target, clobber, tests, mode, slave_type, | 1414 return self.ChromiumFactory(target, clobber, tests, mode, slave_type, |
| 1397 options, compile_timeout, build_url, project, | 1415 options, compile_timeout, build_url, project, |
| 1398 factory_properties) | 1416 factory_properties) |
| OLD | NEW |