aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-04-19 13:47:43 +0200
committerSimon Sapin <simon.sapin@exyr.org>2017-04-24 00:34:46 +0200
commit84558ff23fd731c216e9ce1d7d84119025e31920 (patch)
tree4a1195003bd4d1a9133bb9a1a9407430eab8d0a1 /python/servo/devenv_commands.py
parenta26079d3229beefa90949a93e13ff374649374cc (diff)
downloadservo-84558ff23fd731c216e9ce1d7d84119025e31920.tar.gz
servo-84558ff23fd731c216e9ce1d7d84119025e31920.zip
Add `./mach rustup`
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index a3e14bee652..d414a3324bc 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -11,6 +11,8 @@ from __future__ import print_function, unicode_literals
from os import path, getcwd, listdir
import sys
+import urllib2
+import json
from mach.decorators import (
CommandArgument,
@@ -223,6 +225,22 @@ class MachCommands(CommandBase):
["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js', ':(exclude)*.min.css'],
env=self.build_env())
+ @Command('rustup',
+ description='Update the Rust version to latest master',
+ category='devenv')
+ def rustup(self):
+ url = "https://api.github.com/repos/rust-lang/rust/git/refs/heads/master"
+ commit = json.load(urllib2.urlopen(url))["object"]["sha"]
+ filename = path.join(self.context.topdir, "rust-commit-hash")
+ with open(filename, "w") as f:
+ f.write(commit)
+
+ # Reset self.config["tools"]["rust-root"]
+ self._rust_version = None
+ self.set_use_stable_rust(False)
+
+ self.fetch()
+
@Command('fetch',
description='Fetch Rust, Cargo and Cargo dependencies',
category='devenv')