diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-08-31 07:47:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 07:47:34 -0500 |
commit | c4800a6c83e6fdabaf7c4eff70a24487d16f18ff (patch) | |
tree | 6155ae297d32ae63e217edab3f5d128c1ed1d978 /python/servo/devenv_commands.py | |
parent | ed9fb55366845fdcfae9a7418acd73052a0d4757 (diff) | |
parent | 56b4f3ae70a217834f88a4233eb9989ff9cfec92 (diff) | |
download | servo-c4800a6c83e6fdabaf7c4eff70a24487d16f18ff.tar.gz servo-c4800a6c83e6fdabaf7c4eff70a24487d16f18ff.zip |
Auto merge of #18325 - servo:rustup-toolchain, r=nox
Switch back to pinning Rust by Nightly date instead of commit hash…
… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file
And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)
----
Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.
CC https://github.com/servo/servo/issues/11361
Unlike https://github.com/servo/servo/pull/17927, this does not make mach use rustup directly. That should wait until https://github.com/rust-lang-nursery/rustup.rs/issues/1099 is fixed.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18325)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r-- | python/servo/devenv_commands.py | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index dae6a38b0ba..cbecb471c0d 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -136,7 +136,6 @@ class MachCommands(CommandBase): if dry_run: import toml - import json import httplib import colorama @@ -262,31 +261,16 @@ class MachCommands(CommandBase): @Command('rustup', description='Update the Rust version to latest Nightly', category='devenv') - @CommandArgument('--master', - action='store_true', - help='Use the latest commit of the "master" branch') - def rustup(self, master=False): - if master: - url = "https://api.github.com/repos/rust-lang/rust/git/refs/heads/master" - commit = json.load(urllib2.urlopen(url))["object"]["sha"] - else: - import toml - import re - url = "https://static.rust-lang.org/dist/channel-rust-nightly.toml" - version = toml.load(urllib2.urlopen(url))["pkg"]["rustc"]["version"] - short_commit = re.search("\(([0-9a-f]+) ", version).group(1) - url = "https://api.github.com/repos/rust-lang/rust/commits/" + short_commit - commit = json.load(urllib2.urlopen(url))["sha"] - filename = path.join(self.context.topdir, "rust-commit-hash") + def rustup(self): + url = "https://static.rust-lang.org/dist/channel-rust-nightly-date.txt" + nightly_date = urllib2.urlopen(url).read() + filename = path.join(self.context.topdir, "rust-toolchain") with open(filename, "w") as f: - f.write(commit + "\n") + f.write("nightly-%s\n" % nightly_date) - # Reset self.config["tools"]["rust-root"] - self._rust_version = None + # Reset self.config["tools"]["rust-root"] and self.config["tools"]["cargo-root"] + self._rust_nightly_date = None self.set_use_stable_rust(False) - - # Reset self.config["tools"]["cargo-root"] - self._cargo_build_id = None self.set_cargo_root() self.fetch() |