aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py8
-rw-r--r--python/servo/command_base.py3
-rw-r--r--python/servo/devenv_commands.py2
-rw-r--r--python/servo/post_build_commands.py2
-rw-r--r--python/servo/testing_commands.py2
5 files changed, 10 insertions, 7 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 7b8e2d4351c..1352877d048 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -73,7 +73,7 @@ class MachCommands(CommandBase):
else:
status = subprocess.call(
["cargo", "build"] + opts,
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
elapsed = time() - build_start
print("Build completed in %0.2fs" % elapsed)
@@ -106,7 +106,7 @@ class MachCommands(CommandBase):
build_start = time()
with cd(path.join("ports", "cef")):
ret = subprocess.call(["cargo", "build"],
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
elapsed = time() - build_start
print("CEF build completed in %0.2fs" % elapsed)
@@ -126,7 +126,7 @@ class MachCommands(CommandBase):
opts += ["-j", jobs]
return subprocess.call(
["cargo", "test", "--no-run"],
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
@Command('clean',
description='Clean the build directory.',
@@ -147,4 +147,4 @@ class MachCommands(CommandBase):
opts += ["-v"]
return subprocess.call(["cargo", "clean"] + opts,
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 8dc872e8656..a34104b734e 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -142,6 +142,9 @@ class CommandBase(object):
return env
+ def servo_crate(self):
+ return path.join(self.context.topdir, "components", "servo")
+
def ensure_bootstrapped(self):
if self.context.bootstrapped:
return
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index 82db7f34efa..a6b9b997c18 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -22,7 +22,7 @@ class MachCommands(CommandBase):
help="Command-line arguments to be passed through to Cargo")
def cargo(self, params):
return subprocess.call(["cargo"] + params,
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
@Command('update-cargo',
description='Update Cargo dependencies',
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index faa4ba127af..972dea7429b 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -71,7 +71,7 @@ class MachCommands(CommandBase):
def doc(self, params):
self.ensure_bootstrapped()
return subprocess.call(["cargo", "doc"] + params,
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
@Command('serve-docs',
description='Locally serve Servo and Rust documentation',
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index aa091f9bc06..7d32d1e4808 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -107,7 +107,7 @@ class MachCommands(CommandBase):
def cargo_test(component):
return 0 != subprocess.call(
["cargo", "test", "-p", component] + test_name,
- env=self.build_env(), cwd="components/servo")
+ env=self.build_env(), cwd=self.servo_crate())
for component in os.listdir("components"):
ret = ret or cargo_test(component)