diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2024-08-28 14:07:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 12:07:02 +0000 |
commit | fe4401000065185b4d4feca4bffc5dc469848b4a (patch) | |
tree | 8ed93422a77d793e891caad93a931c8f1490810a /python/servo/command_base.py | |
parent | b29b614775b562cc57d420d29ea190d5bafef014 (diff) | |
download | servo-fe4401000065185b4d4feca4bffc5dc469848b4a.tar.gz servo-fe4401000065185b4d4feca4bffc5dc469848b4a.zip |
mach: Extract binary select into common_command_arguments (#33205)
* Extract binary select into common_command_arguments
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fixups
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Small English edit
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 01dac1ca7fb..d5b1881618b 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -520,9 +520,9 @@ class CommandBase(object): return env @staticmethod - def common_command_arguments(build_configuration=False, build_type=False): + def common_command_arguments(build_configuration=False, build_type=False, binary_selection=False): decorators = [] - if build_type: + if build_type or binary_selection: decorators += [ CommandArgumentGroup('Build Type'), CommandArgument('--release', '-r', group="Build Type", @@ -591,9 +591,18 @@ class CommandBase(object): ) ] + if binary_selection: + decorators += [ + CommandArgumentGroup('Binary selection'), + CommandArgument('--bin', default=None, + help='Launch with specific binary'), + CommandArgument('--nightly', '-n', default=None, + help='Specify a YYYY-MM-DD nightly build to run'), + ] + def decorator_function(original_function): def configuration_decorator(self, *args, **kwargs): - if build_type: + if build_type or binary_selection: # If `build_type` already exists in kwargs we are doing a recursive dispatch. if 'build_type' not in kwargs: kwargs['build_type'] = self.configure_build_type( @@ -609,6 +618,18 @@ class CommandBase(object): self.features = kwargs.get("features", None) or [] self.enable_media = self.is_media_enabled(kwargs['media_stack']) + if binary_selection: + if 'servo_binary' not in kwargs: + kwargs['servo_binary'] = (kwargs.get('bin') + or self.get_nightly_binary_path(kwargs.get('nightly')) + or self.get_binary_path(kwargs.get('build_type'), + asan=kwargs.get('with_asan'))) + kwargs.pop('bin') + kwargs.pop('nightly') + if not build_type: + kwargs.pop('build_type') + kwargs.pop('with_asan') + return original_function(self, *args, **kwargs) decorators.reverse() |