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 all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -8,7 +8,7 @@
# except according to those terms.

from __future__ import print_function, unicode_literals
from os import path, getcwd, listdir
from os import path, listdir
from time import time

import sys
@@ -29,28 +29,30 @@
@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()

build_start = time()
if self.context.topdir == getcwd():
with cd(crate_dir):
status = call(['cargo'] + params, env=env)
else:
status = call(['cargo'] + params, env=env)
status = call(['cargo'] + params, env=env)
elapsed = time() - build_start

notify_build_done(self.config, elapsed, status == 0)
@@ -94,7 +96,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.