aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 17:15:24 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-27 17:15:24 -0500
commit2d4941660bd3a4a91f82145a3a468fbf165eaf94 (patch)
tree21680ee70306b78b16f531d2c363d8a3ed0474ff /python/servo
parentfc1e74c55044e8291ad1dc8524a643a557b89b18 (diff)
parent8587ec4278671bff9de76d765fdf726ea3340371 (diff)
downloadservo-2d4941660bd3a4a91f82145a3a468fbf165eaf94.tar.gz
servo-2d4941660bd3a4a91f82145a3a468fbf165eaf94.zip
Auto merge of #11378 - mbrubeck:debug-mozjs, r=larsbergstrom
Default to the same Cargo features in all build commands Fixes #8308 and #7327. r? @larsbergstrom <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11378) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py8
-rw-r--r--python/servo/command_base.py7
-rw-r--r--python/servo/testing_commands.py4
3 files changed, 17 insertions, 2 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index d10be83e0a7..817dd6f66f1 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -151,7 +151,7 @@ class MachCommands(CommandBase):
features=None, android=None, verbose=False, debug_mozjs=False, params=None):
if android is None:
android = self.config["build"]["android"]
- features = features or []
+ features = features or self.servo_features()
opts = params or []
@@ -198,7 +198,7 @@ class MachCommands(CommandBase):
self.ensure_bootstrapped(target=target)
- if debug_mozjs or self.config["build"]["debug-mozjs"]:
+ if debug_mozjs:
features += ["script/debugmozjs"]
if features:
@@ -271,6 +271,10 @@ class MachCommands(CommandBase):
if release:
opts += ["--release"]
+ servo_features = self.servo_features()
+ if servo_features:
+ opts += ["--features", "%s" % ' '.join("servo/" + x for x in servo_features)]
+
build_start = time()
with cd(path.join("ports", "cef")):
ret = call(["cargo", "build"] + opts,
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 79e1fb8f3c1..0fb5d86955d 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -418,6 +418,13 @@ class CommandBase(object):
def servo_crate(self):
return path.join(self.context.topdir, "components", "servo")
+ def servo_features(self):
+ """Return a list of optional features to enable for the Servo crate"""
+ features = []
+ if self.config["build"]["debug-mozjs"]:
+ features += ["script/debugmozjs"]
+ return features
+
def android_support_dir(self):
return path.join(self.context.topdir, "support", "android")
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 4495b40c667..4a3e0b844bc 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -178,6 +178,10 @@ class MachCommands(CommandBase):
args += ["-p", "%s_tests" % crate]
args += test_patterns
+ features = self.servo_features()
+ if features:
+ args += ["--features", "%s" % ' '.join(features)]
+
env = self.build_env()
env["RUST_BACKTRACE"] = "1"