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

Side by Side Diff: scripts/slave/recipes/chromium_gn.py

Issue 782043003: Add a new chromium.mojo master (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: add chromium_mojo recipe, refactor chromium_gn recipe Created 6 years 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 DEPS = [ 5 DEPS = [
6 'bot_update', 6 'bot_update',
7 'chromium', 7 'chromium',
8 'gclient',
9 'path',
10 'platform', 8 'platform',
11 'properties', 9 'properties',
12 'step',
13 'tryserver',
14 ] 10 ]
15 11
16 12
17 BUILDERS = { 13 BUILDERS = {
18 'chromium.mac': { 14 'chromium.mac': {
19 'builders': { 15 'builders': {
20 'Mac GN': { 16 'Mac GN': {
21 'chromium_config_kwargs': { 17 'chromium_config_kwargs': {
22 'BUILD_CONFIG': 'Release', 18 'BUILD_CONFIG': 'Release',
23 'TARGET_PLATFORM': 'mac', 19 'TARGET_PLATFORM': 'mac',
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 'chromium_lkcr', 266 'chromium_lkcr',
271 'show_v8_revision', 267 'show_v8_revision',
272 ], 268 ],
273 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, 269 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'},
274 }, 270 },
275 }, 271 },
276 }, 272 },
277 } 273 }
278 274
279 def GenSteps(api): 275 def GenSteps(api):
280 # TODO: crbug.com/358481 . The build_config should probably be a property 276 buildername, bot_config = api.chromium.configure_bot(BUILDERS, ['gn'])
281 # passed in from slaves.cfg, but that doesn't exist today, so we need a
282 # lookup mechanism to map bot name to build_config.
283 mastername = api.properties.get('mastername')
284 buildername = api.properties.get('buildername')
285 master_dict = BUILDERS.get(mastername, {})
286 bot_config = master_dict.get('builders', {}).get(buildername)
287
288 api.chromium.set_config('chromium',
289 **bot_config.get('chromium_config_kwargs', {}))
290 for c in bot_config.get('chromium_apply_config', []):
291 api.chromium.apply_config(c)
292
293 api.chromium.apply_config('gn')
294
295 # Note that we have to call gclient.set_config() and apply_config() *after*
296 # calling chromium.set_config(), above, because otherwise the chromium
297 # call would reset the gclient config to its defaults.
298 api.gclient.set_config('chromium')
299 for c in bot_config.get('gclient_apply_config', []):
300 api.gclient.apply_config(c)
301
302 if bot_config.get('set_component_rev'):
303 # If this is a component build and the main revision is e.g. blink,
304 # webrtc, or v8, the custom deps revision of this component must be
305 # dynamically set to either:
306 # (1) 'revision' from the waterfall, or
307 # (2) 'HEAD' for forced builds with unspecified 'revision'.
308 component_rev = api.properties.get('revision') or 'HEAD'
309 dep = bot_config.get('set_component_rev')
310 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev
311
312 if api.tryserver.is_tryserver:
313 api.step.auto_resolve_conflicts = True
314 277
315 api.bot_update.ensure_checkout( 278 api.bot_update.ensure_checkout(
316 force=True, patch_root=bot_config.get('root_override')) 279 force=True, patch_root=bot_config.get('root_override'))
317 280
318 api.chromium.runhooks() 281 api.chromium.runhooks()
319 282
320 # TODO(scottmg): goma doesn't work on windows GN builds yet. 283 # TODO(dpranke): goma doesn't work on windows GN builds yet.
321 is_windows = ('Win8' in buildername or 'win8_' in buildername) 284 is_windows = ('Win' in buildername or 'win' in buildername)
322 api.chromium.run_gn(use_goma=not is_windows) 285 api.chromium.run_gn(use_goma=not is_windows)
323 if is_windows: 286 if is_windows:
324 api.chromium.c.compile_py.compiler = None 287 api.chromium.c.compile_py.compiler = None
325 api.chromium.c.compile_py.goma_dir = None 288 api.chromium.c.compile_py.goma_dir = None
326 289
327 api.chromium.compile(targets=['all']) 290 api.chromium.compile(targets=['all'])
328 291
329 if bot_config.get('should_run_gn_gyp_compare', False): 292 if bot_config.get('should_run_gn_gyp_compare', False):
330 api.chromium.run_gn_compare() 293 api.chromium.run_gn_compare()
331 294
332 # TODO(dpranke): crbug.com/353854. Run gn_unittests and other tests 295 # TODO(dpranke): crbug.com/353854. Run gn_unittests and other tests
333 # when they are also being run as part of the try jobs. 296 # when they are also being run as part of the try jobs.
334 if bot_config.get('should_run_mojo_tests', False): 297 if bot_config.get('should_run_mojo_tests', False):
335 api.chromium.runtest('html_viewer_unittests') 298 api.chromium.runtest('html_viewer_unittests')
336 299
337 300
338 def _sanitize_nonalpha(text):
339 return ''.join(c if c.isalnum() else '_' for c in text)
340
341
342 def GenTests(api): 301 def GenTests(api):
343 # TODO: crbug.com/354674. Figure out where to put "simulation" 302 for test in api.chromium.gen_tests_for_builders(BUILDERS):
344 # tests. We should have one test for each bot this recipe runs on. 303 yield test
345
346 for mastername in BUILDERS:
347 for buildername in BUILDERS[mastername]['builders']:
348 if 'mac' in buildername or 'Mac' in buildername:
349 platform_name = 'mac'
350 elif 'win' in buildername or 'Win' in buildername:
351 platform_name = 'win'
352 else:
353 platform_name = 'linux'
354 test = (
355 api.test('full_%s_%s' % (_sanitize_nonalpha(mastername),
356 _sanitize_nonalpha(buildername))) +
357 api.platform.name(platform_name)
358 )
359 if mastername.startswith('tryserver'):
360 test += api.properties.tryserver(buildername=buildername,
361 mastername=mastername)
362 else:
363 test += api.properties.generic(buildername=buildername,
364 mastername=mastername)
365 yield test
366 304
367 yield ( 305 yield (
368 api.test('compile_failure') + 306 api.test('compile_failure') +
369 api.platform.name('linux') + 307 api.platform.name('linux') +
370 api.properties.tryserver( 308 api.properties.tryserver(
371 buildername='linux_chromium_gn_rel', 309 buildername='linux_chromium_gn_rel',
372 mastername='tryserver.chromium.linux') + 310 mastername='tryserver.chromium.linux') +
373 api.step_data('compile', retcode=1) 311 api.step_data('compile', retcode=1)
374 ) 312 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698