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

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

Issue 2165643005: Change PGO recipe to use MB now that it supports multiple phases. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 5 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
« 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):
519 gyp_chromium_path = self.m.path['checkout'].join('build', 'gyp_chromium.py')
520 env = self.get_env()
521 env.update(self.c.gyp_env.as_jsonish())
522 self.m.python(name='gyp_chromium', script=gyp_chromium_path, env=env);
523
524 def run_gn(self, use_goma=False, gn_path=None, build_dir=None, **kwargs): 518 def run_gn(self, use_goma=False, gn_path=None, build_dir=None, **kwargs):
525 if not gn_path: 519 if not gn_path:
526 gn_path = self.m.path['depot_tools'].join('gn.py') 520 gn_path = self.m.path['depot_tools'].join('gn.py')
527 521
528 gn_args = list(self.c.gn_args) 522 gn_args = list(self.c.gn_args)
529 523
530 # TODO(dpranke): Figure out if we should use the '_x64' thing to 524 # TODO(dpranke): Figure out if we should use the '_x64' thing to
531 # consistent w/ GYP, or drop it to be consistent w/ the other platforms. 525 # consistent w/ GYP, or drop it to be consistent w/ the other platforms.
532 build_dir = build_dir or '//out/%s' % self.c.build_config_fs 526 build_dir = build_dir or '//out/%s' % self.c.build_config_fs
533 527
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 '--args=%s' % ' '.join(gn_args), 564 '--args=%s' % ' '.join(gn_args),
571 ] 565 ]
572 if str(gn_path).endswith('.py'): 566 if str(gn_path).endswith('.py'):
573 self.m.python(name='gn', script=gn_path, args=step_args, **kwargs) 567 self.m.python(name='gn', script=gn_path, args=step_args, **kwargs)
574 else: 568 else:
575 self.m.step(name='gn', cmd=[gn_path] + step_args, **kwargs) 569 self.m.step(name='gn', cmd=[gn_path] + step_args, **kwargs)
576 570
577 def run_mb(self, mastername, buildername, use_goma=True, 571 def run_mb(self, mastername, buildername, use_goma=True,
578 mb_config_path=None, isolated_targets=None, name=None, 572 mb_config_path=None, isolated_targets=None, name=None,
579 build_dir=None, android_version_code=None, 573 build_dir=None, android_version_code=None,
580 android_version_name=None, gyp_script=None, **kwargs): 574 android_version_name=None, gyp_script=None, phase=None,
575 **kwargs):
581 mb_config_path = (mb_config_path or 576 mb_config_path = (mb_config_path or
582 self.m.path['checkout'].join('tools', 'mb', 577 self.m.path['checkout'].join('tools', 'mb',
583 'mb_config.pyl')) 578 'mb_config.pyl'))
584 isolated_targets = isolated_targets or [] 579 isolated_targets = isolated_targets or []
585 580
586 out_dir = 'out' 581 out_dir = 'out'
587 if self.c.TARGET_CROS_BOARD: 582 if self.c.TARGET_CROS_BOARD:
588 out_dir += '_%s' % self.c.TARGET_CROS_BOARD 583 out_dir += '_%s' % self.c.TARGET_CROS_BOARD
589 584
590 build_dir = build_dir or '//%s/%s' % (out_dir, self.c.build_config_fs) 585 build_dir = build_dir or '//%s/%s' % (out_dir, self.c.build_config_fs)
591 586
592 args=[ 587 args=[
593 'gen', 588 'gen',
594 '-m', mastername, 589 '-m', mastername,
595 '-b', buildername, 590 '-b', buildername,
596 '--config-file', mb_config_path, 591 '--config-file', mb_config_path,
597 ] 592 ]
598 593
594 if phase is not None:
595 args += [ '--phase', str(phase) ]
596
599 if use_goma: 597 if use_goma:
600 goma_dir = self.c.compile_py.goma_dir 598 goma_dir = self.c.compile_py.goma_dir
601 if not goma_dir: 599 if not goma_dir:
602 # This method defaults to use_goma=True, which doesn't necessarily 600 # This method defaults to use_goma=True, which doesn't necessarily
603 # match build-side configuration. However, MB is configured 601 # match build-side configuration. However, MB is configured
604 # src-side, and so it might be actually using goma. 602 # src-side, and so it might be actually using goma.
605 self.ensure_goma() 603 self.ensure_goma()
606 goma_dir = self.c.compile_py.goma_dir 604 goma_dir = self.c.compile_py.goma_dir
607 if not goma_dir: # pragma: no cover 605 if not goma_dir: # pragma: no cover
608 # TODO(phajdan.jr): remove fallback when we always use cipd for goma. 606 # 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 })) 782 }))
785 783
786 def get_annotate_by_test_name(self, test_name): 784 def get_annotate_by_test_name(self, test_name):
787 return 'graphing' 785 return 'graphing'
788 786
789 def download_lto_plugin(self): 787 def download_lto_plugin(self):
790 return self.m.python( 788 return self.m.python(
791 name='download LTO plugin', 789 name='download LTO plugin',
792 script=self.m.path['checkout'].join( 790 script=self.m.path['checkout'].join(
793 'build', 'download_gold_plugin.py')) 791 '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