Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mach: Fix cargo-geckolib check / cargo-geckolib build after #19476. #19539

Merged
merged 2 commits into from Dec 14, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

mach: Fix cargo-geckolib check / cargo-geckolib build after #19476.

  • Loading branch information
emilio committed Dec 10, 2017
commit f2314c10ca4b012205092666abaa8fd3d3cbd569
@@ -29,22 +29,31 @@
@CommandProvider
class MachCommands(CommandBase):
def run_cargo(self, params, geckolib=False, check=False):
if geckolib:
self.set_use_stable_rust()
crate_dir = path.join('ports', 'geckolib')
else:
crate_dir = path.join('ports', 'servo')
if not params:
params = []

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

if not params:
params = []

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

if geckolib:
# for c in $(cargo --list | tail -$(($(cargo --list | wc -l) - 1))); do
# (cargo help $c 2>&1 | grep "\\--package" >/dev/null 2>&1) && echo $c
# done
if params[0] and params[0] in [
'bench', 'build', 'check', 'clean', 'doc', 'fmt', 'pkgid',
'run', 'rustc', 'rustdoc', 'test', 'update',
]:
params[1:1] = ['--package', 'geckoservo']

self.set_use_stable_rust()
crate_dir = path.join('ports', 'geckolib')
else:
crate_dir = path.join('ports', 'servo')

build_start = time()
if self.context.topdir == getcwd():
with cd(crate_dir):
@@ -94,7 +103,7 @@ def check(self, params):
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo check")
def check_geckolib(self, params):
return self.run_cargo(["-p", "geckoservo"] + (params or []), check=True, geckolib=True)
return self.run_cargo(params, check=True, geckolib=True)

@Command('cargo-update',
description='Same as update-cargo',
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.