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

Side by Side Diff: scripts/slave/recipe_modules/chromium/api.py

Issue 2190883002: Reland "Change PGO recipe to use MB now that it supports multiple phases." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 4 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 | « no previous file | scripts/slave/recipe_modules/pgo/api.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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 import re 5 import re
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 from recipe_engine import util as recipe_util 8 from recipe_engine import util as recipe_util
9 9
10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder): 10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder):
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 env.update(self.c.gyp_env.as_jsonish()) 508 env.update(self.c.gyp_env.as_jsonish())
509 509
510 if self.c.project_generator.tool != 'gyp': 510 if self.c.project_generator.tool != 'gyp':
511 env['GYP_CHROMIUM_NO_ACTION'] = 1 511 env['GYP_CHROMIUM_NO_ACTION'] = 1
512 kwargs['env'] = env 512 kwargs['env'] = env
513 if self.c.TARGET_CROS_BOARD: 513 if self.c.TARGET_CROS_BOARD:
514 # Wrap 'runhooks' through 'cros chrome-sdk' 514 # Wrap 'runhooks' through 'cros chrome-sdk'
515 kwargs['wrapper'] = self.get_cros_chrome_sdk_wrapper(clean=True) 515 kwargs['wrapper'] = self.get_cros_chrome_sdk_wrapper(clean=True)
516 self.m.gclient.runhooks(**kwargs) 516 self.m.gclient.runhooks(**kwargs)
517 517
518 def run_gyp_chromium(self): 518 # No cover because internal recipes use this.
519 def run_gyp_chromium(self): # pragma: no cover
519 gyp_chromium_path = self.m.path['checkout'].join('build', 'gyp_chromium.py') 520 gyp_chromium_path = self.m.path['checkout'].join('build', 'gyp_chromium.py')
520 env = self.get_env() 521 env = self.get_env()
521 env.update(self.c.gyp_env.as_jsonish()) 522 env.update(self.c.gyp_env.as_jsonish())
522 self.m.python(name='gyp_chromium', script=gyp_chromium_path, env=env); 523 self.m.python(name='gyp_chromium', script=gyp_chromium_path, env=env);
523 524
524 def run_gn(self, use_goma=False, gn_path=None, build_dir=None, **kwargs): 525 def run_gn(self, use_goma=False, gn_path=None, build_dir=None, **kwargs):
525 if not gn_path: 526 if not gn_path:
526 gn_path = self.m.path['depot_tools'].join('gn.py') 527 gn_path = self.m.path['depot_tools'].join('gn.py')
527 528
528 gn_args = list(self.c.gn_args) 529 gn_args = list(self.c.gn_args)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 '--args=%s' % ' '.join(gn_args), 571 '--args=%s' % ' '.join(gn_args),
571 ] 572 ]
572 if str(gn_path).endswith('.py'): 573 if str(gn_path).endswith('.py'):
573 self.m.python(name='gn', script=gn_path, args=step_args, **kwargs) 574 self.m.python(name='gn', script=gn_path, args=step_args, **kwargs)
574 else: 575 else:
575 self.m.step(name='gn', cmd=[gn_path] + step_args, **kwargs) 576 self.m.step(name='gn', cmd=[gn_path] + step_args, **kwargs)
576 577
577 def run_mb(self, mastername, buildername, use_goma=True, 578 def run_mb(self, mastername, buildername, use_goma=True,
578 mb_config_path=None, isolated_targets=None, name=None, 579 mb_config_path=None, isolated_targets=None, name=None,
579 build_dir=None, android_version_code=None, 580 build_dir=None, android_version_code=None,
580 android_version_name=None, gyp_script=None, **kwargs): 581 android_version_name=None, gyp_script=None, phase=None,
582 **kwargs):
581 mb_config_path = (mb_config_path or 583 mb_config_path = (mb_config_path or
582 self.m.path['checkout'].join('tools', 'mb', 584 self.m.path['checkout'].join('tools', 'mb',
583 'mb_config.pyl')) 585 'mb_config.pyl'))
584 isolated_targets = isolated_targets or [] 586 isolated_targets = isolated_targets or []
585 587
586 out_dir = 'out' 588 out_dir = 'out'
587 if self.c.TARGET_CROS_BOARD: 589 if self.c.TARGET_CROS_BOARD:
588 out_dir += '_%s' % self.c.TARGET_CROS_BOARD 590 out_dir += '_%s' % self.c.TARGET_CROS_BOARD
589 591
590 build_dir = build_dir or '//%s/%s' % (out_dir, self.c.build_config_fs) 592 build_dir = build_dir or '//%s/%s' % (out_dir, self.c.build_config_fs)
591 593
592 args=[ 594 args=[
593 'gen', 595 'gen',
594 '-m', mastername, 596 '-m', mastername,
595 '-b', buildername, 597 '-b', buildername,
596 '--config-file', mb_config_path, 598 '--config-file', mb_config_path,
597 ] 599 ]
598 600
601 if phase is not None:
602 args += [ '--phase', str(phase) ]
603
599 if use_goma: 604 if use_goma:
600 goma_dir = self.c.compile_py.goma_dir 605 goma_dir = self.c.compile_py.goma_dir
601 if not goma_dir: 606 if not goma_dir:
602 # This method defaults to use_goma=True, which doesn't necessarily 607 # This method defaults to use_goma=True, which doesn't necessarily
603 # match build-side configuration. However, MB is configured 608 # match build-side configuration. However, MB is configured
604 # src-side, and so it might be actually using goma. 609 # src-side, and so it might be actually using goma.
605 self.ensure_goma() 610 self.ensure_goma()
606 goma_dir = self.c.compile_py.goma_dir 611 goma_dir = self.c.compile_py.goma_dir
607 if not goma_dir: # pragma: no cover 612 if not goma_dir: # pragma: no cover
608 # TODO(phajdan.jr): remove fallback when we always use cipd for goma. 613 # TODO(phajdan.jr): remove fallback when we always use cipd for goma.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 })) 789 }))
785 790
786 def get_annotate_by_test_name(self, test_name): 791 def get_annotate_by_test_name(self, test_name):
787 return 'graphing' 792 return 'graphing'
788 793
789 def download_lto_plugin(self): 794 def download_lto_plugin(self):
790 return self.m.python( 795 return self.m.python(
791 name='download LTO plugin', 796 name='download LTO plugin',
792 script=self.m.path['checkout'].join( 797 script=self.m.path['checkout'].join(
793 'build', 'download_gold_plugin.py')) 798 'build', 'download_gold_plugin.py'))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/pgo/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698