diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2016-05-24 10:56:22 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2016-05-27 14:43:55 -0700 |
commit | 8587ec4278671bff9de76d765fdf726ea3340371 (patch) | |
tree | 576aad470f4a67cb4cb14fc92078ba8d64d0b7cb /python/servo | |
parent | e4fe0db8fd5f0b5431ba3856b4931613a96e924e (diff) | |
download | servo-8587ec4278671bff9de76d765fdf726ea3340371.tar.gz servo-8587ec4278671bff9de76d765fdf726ea3340371.zip |
Default to the same Cargo features in all build commands
Fixes #8308 and #7327.
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/build_commands.py | 8 | ||||
-rw-r--r-- | python/servo/command_base.py | 7 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 4 |
3 files changed, 17 insertions, 2 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 369918595ce..48f293a21f3 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -147,7 +147,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 [] @@ -194,7 +194,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: @@ -265,6 +265,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 921825dbf96..2feb5c07445 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -415,6 +415,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 7a821a08679..7872976cff3 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" |