aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-08-14 12:21:29 +0200
committerGitHub <noreply@github.com>2023-08-14 10:21:29 +0000
commit1d79f5dad2a8b006bddf1cabec519f21a1fe6d31 (patch)
tree819a12982b155029db401716d7e37ee2ac5db0dd /python/servo/devenv_commands.py
parentcc86854c4efefe21dbcd2746a05c379b8f1fb479 (diff)
downloadservo-1d79f5dad2a8b006bddf1cabec519f21a1fe6d31.tar.gz
servo-1d79f5dad2a8b006bddf1cabec519f21a1fe6d31.zip
Make the `--release`/`--dev` more consistent and less surprising (#30091)
There were some issues with the way that the `--release` and `--dev` arguments were handled in mach commands. - Not all commands accepted them in the same way. For instance `./mach test-wpt` didn't really accept them at all. - If you did not pass either of them, mach would try to guess which build you meant. This guess was often quite surprising as it wasn't printed and it depended on the state of the your target directory, which is difficult to remember. - The `dev` profile is colloquially called a "debug" profile and some commands accepted `-d` or `--debug...` like arguments, but `--debug` with `./mach run` meant run in a debugger. It was easy to mix this up. This change: - Centralizes where build type argument processing happens. Now it the same shared decorator in CommandBase. - Uses a `BuildType` enum instead of passing around two different booleans. This reduces the error checking for situations where both are true. - Be much less clever about guessing what build to use. Now if you don't specify a build type, `--dev` is chosen. I think this behavior matches cargo. - Makes it so that `./mach test-wpt` accepts the exact same arguments and has the same behavior as other commands. In addition, the suite correct for `test-wpt` is removed. There are only two suites now and it's quite unlikely that people will confuse WPT tests for rust unit tests.
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index 86563a13624..0ce5c7da6f0 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -44,7 +44,7 @@ class MachCommands(CommandBase):
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo check")
- @CommandBase.build_like_command_arguments
+ @CommandBase.common_command_arguments(build_configuration=True, build_type=False)
def check(self, params, **kwargs):
if not params:
params = []
@@ -129,7 +129,7 @@ class MachCommands(CommandBase):
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo-fix")
- @CommandBase.build_like_command_arguments
+ @CommandBase.common_command_arguments(build_configuration=True, build_type=False)
def cargo_fix(self, params, **kwargs):
if not params:
params = []
@@ -144,7 +144,7 @@ class MachCommands(CommandBase):
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo-clippy")
- @CommandBase.build_like_command_arguments
+ @CommandBase.common_command_arguments(build_configuration=True, build_type=False)
def cargo_clippy(self, params, **kwargs):
if not params:
params = []