diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-13 03:09:51 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-13 03:09:51 +0530 |
commit | 088963f774f5068ec8dc0f3bd88579bc1e84c18d (patch) | |
tree | 92c31a67b85a936141156dbaabdfd6dc70c75dbd /python/servo/command_base.py | |
parent | 520ca258d4f979500f839e13a278bee35bfcc00a (diff) | |
parent | 0df4118db9da4d44d79109f6d441f66200efb0bf (diff) | |
download | servo-088963f774f5068ec8dc0f3bd88579bc1e84c18d.tar.gz servo-088963f774f5068ec8dc0f3bd88579bc1e84c18d.zip |
Auto merge of #9611 - danlrobertson:i9557, r=larsbergstrom
Download extra stdlib only when required: #9557
Split [`ensure_bootstrap`](https://github.com/danlrobertson/servo/blob/i9557/python/servo/command_base.py#L397-L422) into two phases including a phase checking the compiler, and a phase checking for target libraries. E.g.
```
# should download the stdlib for "i686-unknown-linux-gnu", "arm-linux-androideabi"
# and the hosts target
./mach build -d --target i686-unknown-linux-gnu --android
# should only download the stdlib for the hosts target
./mach build -d
```
Let me know if I missed anything! There are a few parts of this patch in its current state that I'm not a huge fan of, but I couldn't think of a better way in the moment.
Still new to working on servo, so any comments or critiques are welcome!
Fix #9557
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9611)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 450403e903b..d43c3ab4eda 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -394,18 +394,21 @@ class CommandBase(object): def android_build_dir(self, dev): return path.join(self.get_target_dir(), "arm-linux-androideabi", "debug" if dev else "release") - def ensure_bootstrapped(self): + def ensure_bootstrapped(self, targets=[]): if self.context.bootstrapped: return Registrar.dispatch("update-submodules", context=self.context) if not self.config["tools"]["system-rust"] and \ - not path.exists(path.join( - self.config["tools"]["rust-root"], "rustc", "bin", "rustc" + BIN_SUFFIX)): + (not path.exists(path.join( + self.config["tools"]["rust-root"], "rustc", "bin", "rustc" + BIN_SUFFIX)) or + not all([path.exists(path.join( + self.config["tools"]["rust-root"], "rustc", "lib", "rustlib", x + )) for x in targets])): print("looking for rustc at %s" % path.join( self.config["tools"]["rust-root"], "rustc", "bin", "rustc" + BIN_SUFFIX)) - Registrar.dispatch("bootstrap-rust", context=self.context) + Registrar.dispatch("bootstrap-rust", context=self.context, target=targets) if not self.config["tools"]["system-cargo"] and \ not path.exists(path.join( self.config["tools"]["cargo-root"], "cargo", "bin", "cargo" + BIN_SUFFIX)): |