diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-11 12:35:32 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-11 12:35:32 -0700 |
commit | 7f76e3ba74a11f1f4bb46f12e17c06270175908f (patch) | |
tree | ee50017ad6a073a1fbd946bc13fea986f440e265 /python/servo | |
parent | fcebfcc1130b7b3e74f14c8375f825f148e0f152 (diff) | |
parent | b2e874e151548930d674a64940506f29a58541b8 (diff) | |
download | servo-7f76e3ba74a11f1f4bb46f12e17c06270175908f.tar.gz servo-7f76e3ba74a11f1f4bb46f12e17c06270175908f.zip |
Auto merge of #11122 - mbrubeck:unify-builds, r=larsbergstrom
Use the same build environment and features for CEF, Servo, Gonk, Geckolib
* Remove unnecessary dependencies and features from top-level Cargo.tomls. The features for each crate will be computed based on the union of features specified in the dependency graph. Specifying the same ones again just adds more ways for them to get out of sync.
* Move all cargo build environment variables into CommandBase
Fixes #11112. r? @metajack
(Not included: CI test to make sure #11112 doesn't regress again.)
<!-- 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/11122)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/build_commands.py | 17 | ||||
-rw-r--r-- | python/servo/command_base.py | 12 |
2 files changed, 13 insertions, 16 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 40db368bfe8..3dca0f3fae6 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -197,19 +197,11 @@ class MachCommands(CommandBase): if debug_mozjs or self.config["build"]["debug-mozjs"]: features += ["script/debugmozjs"] - if android: - features += ["android_glue"] - if features: opts += ["--features", "%s" % ' '.join(features)] build_start = time() - env = self.build_env() - - # Ensure Rust uses hard floats and SIMD on ARM devices - if target: - if target.startswith('arm') or target.startswith('aarch64'): - env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C target-feature=+neon" + env = self.build_env(target=target) if android: # Build OpenSSL for android @@ -225,7 +217,7 @@ class MachCommands(CommandBase): with cd(openssl_dir): status = call( make_cmd + ["-f", "openssl.makefile"], - env=self.build_env(), + env=env, verbose=verbose) if status: return status @@ -234,11 +226,6 @@ class MachCommands(CommandBase): env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include") env['OPENSSL_STATIC'] = 'TRUE' - if not (self.config["build"]["ccache"] == ""): - env['CCACHE'] = self.config["build"]["ccache"] - - env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -W unused-extern-crates" - status = call( ["cargo", "build"] + opts, env=env, cwd=self.servo_crate(), verbose=verbose) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 492aefda254..921825dbf96 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -256,7 +256,7 @@ class CommandBase(object): " --release" if release else "")) sys.exit() - def build_env(self, gonk=False, hosts_file_path=None): + def build_env(self, gonk=False, hosts_file_path=None, target=None): """Return an extended environment dictionary.""" env = os.environ.copy() if sys.platform == "win32" and type(env['PATH']) == unicode: @@ -400,6 +400,16 @@ class CommandBase(object): if subprocess.call(['which', 'ld.gold'], stdout=PIPE, stderr=PIPE) == 0: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C link-args=-fuse-ld=gold" + if not (self.config["build"]["ccache"] == ""): + env['CCACHE'] = self.config["build"]["ccache"] + + # Ensure Rust uses hard floats and SIMD on ARM devices + if target: + if target.startswith('arm') or target.startswith('aarch64'): + env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C target-feature=+neon" + + env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -W unused-extern-crates" + return env def servo_crate(self): |