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

Side by Side Diff: build/scripts/master/factory/gclient_factory.py

Issue 228903003: Set use_goma=1 and gomadir=path in GYP_DEFINES on master. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « build/scripts/master/factory/commands.py ('k') | build/scripts/slave/compile.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 classes to generate and manage a BuildFactory to be passed to a 5 """Utility classes to generate and manage a BuildFactory to be passed to a
6 builder dictionary as the 'factory' member, for each builder in c['builders']. 6 builder dictionary as the 'factory' member, for each builder in c['builders'].
7 7
8 Specifically creates a base BuildFactory that will execute a gclient checkout 8 Specifically creates a base BuildFactory that will execute a gclient checkout
9 first.""" 9 first."""
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 spec += ']' 147 spec += ']'
148 148
149 if self._target_os: 149 if self._target_os:
150 spec += ';target_os = ["' + self._target_os + '"]' 150 spec += ';target_os = ["' + self._target_os + '"]'
151 151
152 return spec 152 return spec
153 153
154 def BaseFactory(self, gclient_spec=None, official_release=False, 154 def BaseFactory(self, gclient_spec=None, official_release=False,
155 factory_properties=None, build_properties=None, 155 factory_properties=None, build_properties=None,
156 delay_compile_step=False, sudo_for_remove=False, 156 delay_compile_step=False, sudo_for_remove=False,
157 gclient_deps=None, slave_type=None): 157 gclient_deps=None, slave_type=None, options=None):
158 if gclient_spec is None: 158 if gclient_spec is None:
159 gclient_spec = self.BuildGClientSpec() 159 gclient_spec = self.BuildGClientSpec()
160 factory_properties = factory_properties or {} 160 factory_properties = factory_properties or {}
161 factory = BuildFactory(build_properties) 161 factory = BuildFactory(build_properties)
162 factory_cmd_obj = commands.FactoryCommands(factory, 162 factory_cmd_obj = commands.FactoryCommands(factory,
163 target_platform=self._target_platform) 163 target_platform=self._target_platform)
164 # First kill any svn.exe tasks so we can update in peace, and 164 # First kill any svn.exe tasks so we can update in peace, and
165 # afterwards use the checked-out script to kill everything else. 165 # afterwards use the checked-out script to kill everything else.
166 if (self._target_platform == 'win32' and 166 if (self._target_platform == 'win32' and
167 not factory_properties.get('no_kill')): 167 not factory_properties.get('no_kill')):
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 no_gclient_branch = factory_properties.get('no_gclient_branch', False) 207 no_gclient_branch = factory_properties.get('no_gclient_branch', False)
208 factory_cmd_obj.AddClobberTreeStep(gclient_spec, env, timeout, 208 factory_cmd_obj.AddClobberTreeStep(gclient_spec, env, timeout,
209 gclient_deps=gclient_deps, gclient_nohooks=self._nohooks_on_update, 209 gclient_deps=gclient_deps, gclient_nohooks=self._nohooks_on_update,
210 no_gclient_branch=no_gclient_branch) 210 no_gclient_branch=no_gclient_branch)
211 else: 211 else:
212 # Revert the tree to a clean (unmodified) state. 212 # Revert the tree to a clean (unmodified) state.
213 factory_cmd_obj.AddGClientRevertStep() 213 factory_cmd_obj.AddGClientRevertStep()
214 if not delay_compile_step: 214 if not delay_compile_step:
215 self.AddUpdateStep(gclient_spec, factory_properties, factory, 215 self.AddUpdateStep(gclient_spec, factory_properties, factory,
216 slave_type, sudo_for_remove, 216 slave_type, sudo_for_remove,
217 gclient_deps=gclient_deps) 217 gclient_deps=gclient_deps, options=options)
218 return factory 218 return factory
219 219
220 def BuildFactory(self, target='Release', clobber=False, tests=None, mode=None, 220 def BuildFactory(self, target='Release', clobber=False, tests=None, mode=None,
221 slave_type='BuilderTester', options=None, 221 slave_type='BuilderTester', options=None,
222 compile_timeout=1200, build_url=None, project=None, 222 compile_timeout=1200, build_url=None, project=None,
223 factory_properties=None, gclient_deps=None, 223 factory_properties=None, gclient_deps=None,
224 target_arch=None, skip_archive_steps=False): 224 target_arch=None, skip_archive_steps=False):
225 if factory_properties is None: 225 if factory_properties is None:
226 factory_properties = {} 226 factory_properties = {}
227 factory_properties.setdefault('gclient_env', {}) 227 factory_properties.setdefault('gclient_env', {})
228 gclient_env = factory_properties['gclient_env'] 228 gclient_env = factory_properties['gclient_env']
229 if options and '--build-tool=ninja' in options: 229 if options and '--build-tool=ninja' in options:
230 gclient_env['GYP_GENERATORS'] = 'ninja' 230 gclient_env['GYP_GENERATORS'] = 'ninja'
231 if options and '--compiler=goma-clang' in options:
232 # Ninja needs CC and CXX set at gyp time.
233 gclient_env['CC'] = 'clang'
234 gclient_env['CXX'] = 'clang++'
235 231
236 # Create the spec for the solutions 232 # Create the spec for the solutions
237 gclient_spec = self.BuildGClientSpec(tests) 233 gclient_spec = self.BuildGClientSpec(tests)
238 234
239 # Initialize the factory with the basic steps. 235 # Initialize the factory with the basic steps.
240 factory = self.BaseFactory(gclient_spec, 236 factory = self.BaseFactory(gclient_spec,
241 factory_properties=factory_properties, 237 factory_properties=factory_properties,
242 slave_type=slave_type, 238 slave_type=slave_type,
243 gclient_deps=gclient_deps) 239 gclient_deps=gclient_deps, options=options)
244 240
245 # Optional repository root (default: 'src'). 241 # Optional repository root (default: 'src').
246 repository_root = factory_properties.get('repository_root', 'src') 242 repository_root = factory_properties.get('repository_root', 'src')
247 243
248 # Get the factory command object to create new steps to the factory. 244 # Get the factory command object to create new steps to the factory.
249 factory_cmd_obj = commands.FactoryCommands(factory, target, 245 factory_cmd_obj = commands.FactoryCommands(factory, target,
250 self._build_dir, 246 self._build_dir,
251 self._target_platform, 247 self._target_platform,
252 target_arch, 248 target_arch,
253 repository_root) 249 repository_root)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 set_properties = factory_properties.get('trigger_set_properties', {}) 310 set_properties = factory_properties.get('trigger_set_properties', {})
315 311
316 # Propagate properties to the children if this is set in the factory. 312 # Propagate properties to the children if this is set in the factory.
317 copy_properties = factory_properties.get('trigger_properties', []) 313 copy_properties = factory_properties.get('trigger_properties', [])
318 factory.addStep(commands.CreateTriggerStep( 314 factory.addStep(commands.CreateTriggerStep(
319 trigger_name=trigger_name, 315 trigger_name=trigger_name,
320 trigger_copy_properties=copy_properties, 316 trigger_copy_properties=copy_properties,
321 trigger_set_properties=set_properties)) 317 trigger_set_properties=set_properties))
322 318
323 def AddUpdateStep(self, gclient_spec, factory_properties, factory, 319 def AddUpdateStep(self, gclient_spec, factory_properties, factory,
324 slave_type, sudo_for_remove=False, gclient_deps=None): 320 slave_type, sudo_for_remove=False, gclient_deps=None,
321 options=None):
325 if gclient_spec is None: 322 if gclient_spec is None:
326 gclient_spec = self.BuildGClientSpec() 323 gclient_spec = self.BuildGClientSpec()
327 factory_properties = factory_properties or {} 324 factory_properties = factory_properties or {}
328 325
329 # Get the factory command object to add update step to the factory. 326 # Get the factory command object to add update step to the factory.
330 factory_cmd_obj = commands.FactoryCommands(factory, 327 factory_cmd_obj = commands.FactoryCommands(factory,
331 target_platform=self._target_platform) 328 target_platform=self._target_platform)
332 329
333 # Get variables needed for the update. 330 # Get variables needed for the update.
334 env = factory_properties.get('gclient_env', {}) 331 env = factory_properties.get('gclient_env', {})
(...skipping 27 matching lines...) Expand all
362 blink_config=blink_config) 359 blink_config=blink_config)
363 360
364 if slave_type in ('AnnotatedTrybot', 'CrosTrybot', 'Trybot', 'Bisect', 361 if slave_type in ('AnnotatedTrybot', 'CrosTrybot', 'Trybot', 'Bisect',
365 'TrybotTester', 'TrybotBuilder'): 362 'TrybotTester', 'TrybotBuilder'):
366 factory_cmd_obj.AddApplyIssueStep( 363 factory_cmd_obj.AddApplyIssueStep(
367 timeout=timeout, 364 timeout=timeout,
368 server=config.Master.Master4.code_review_site, 365 server=config.Master.Master4.code_review_site,
369 revision_mapping=self._revision_mapping) 366 revision_mapping=self._revision_mapping)
370 367
371 if not self._nohooks_on_update: 368 if not self._nohooks_on_update:
372 factory_cmd_obj.AddRunHooksStep(env=env, timeout=timeout) 369 factory_cmd_obj.AddRunHooksStep(env=env, timeout=timeout, options=options)
OLDNEW
« no previous file with comments | « build/scripts/master/factory/commands.py ('k') | build/scripts/slave/compile.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698