Skip to content
Permalink
Browse files

Remove `./mach cargo`.

Not all cargo subcommands take `--manifest-path`.
Use plain `cargo` instead (rustup reads the `rust-toolchain` file)
or consider adding new mach sub-commands.
  • Loading branch information...
SimonSapin committed Jul 1, 2019
1 parent aa5e559 commit d9dbcd52c3fc0f34d2f5cd4c20aaed794946eb80
Showing with 9 additions and 22 deletions.
  1. +9 −22 python/servo/devenv_commands.py
@@ -31,16 +31,21 @@

@CommandProvider
class MachCommands(CommandBase):
def run_cargo(self, params, check=False):
@Command('check',
description='Run "cargo check"',
category='devenv')
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo check")
def check(self, params):
if not params:
params = []

self.ensure_bootstrapped()
self.ensure_clobbered()
env = self.build_env()

if check:
params = ['check'] + params
params = ['check'] + params

self.add_manifest_path(params)

@@ -50,29 +55,11 @@ def run_cargo(self, params, check=False):

notify_build_done(self.config, elapsed, status == 0)

if check and status == 0:
if status == 0:
print('Finished checking, binary NOT updated. Consider ./mach build before ./mach run')

return status

@Command('cargo',
description='Run Cargo',
category='devenv')
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to Cargo")
def cargo(self, params):
return self.run_cargo(params)

@Command('check',
description='Run "cargo check"',
category='devenv')
@CommandArgument(
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo check")
def check(self, params):
return self.run_cargo(params, check=True)

@Command('cargo-update',
description='Same as update-cargo',
category='devenv')

0 comments on commit d9dbcd5

Please sign in to comment.
You can’t perform that action at this time.