aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py7
-rw-r--r--python/servo/command_base.py1
-rw-r--r--python/servo/post_build_commands.py9
3 files changed, 14 insertions, 3 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index e248c4a74fe..7b8819583c3 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -161,7 +161,10 @@ class MachCommands(CommandBase):
@CommandArgument('--verbose', '-v',
action='store_true',
help='Print verbose output')
- def clean(self, manifest_path, verbose=False):
+
+ @CommandArgument('params', nargs='...',
+ help="Command-line arguments to be passed through to Cargo")
+ def clean(self, manifest_path, params, verbose=False):
self.ensure_bootstrapped()
opts = []
@@ -169,6 +172,6 @@ class MachCommands(CommandBase):
opts += ["--manifest-path", manifest_path]
if verbose:
opts += ["-v"]
-
+ opts += params
return subprocess.call(["cargo", "clean"] + opts,
env=self.build_env(), cwd=self.servo_crate())
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 3b151affdd0..0f86edcb541 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -166,6 +166,7 @@ class CommandBase(object):
if self.context.bootstrapped:
return
+ subprocess.check_call(["git", "submodule", "sync"])
submodules = subprocess.check_output(["git", "submodule", "status"])
for line in submodules.split('\n'):
components = line.strip().split(' ')
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index 7cec97f0d0a..d427fe1181f 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -75,7 +75,14 @@ class MachCommands(CommandBase):
else:
args = args + params
- subprocess.check_call(args, env=env)
+ try:
+ subprocess.check_call(args, env=env)
+ except OSError as e:
+ if e.errno == 2:
+ print("Servo Binary can't be found! Run './mach build'"
+ " and try again!")
+ else:
+ raise e
@Command('doc',
description='Generate documentation',