aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-27 23:18:54 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-01-10 18:05:44 +0100
commita3339f97c3313cfd57f5e673b88dd165215c0450 (patch)
treea085cf00db0c2275a1c76f52c3b73cf1fa394c2e /python
parent2f941d8450494895426aa614a15f65e3147d4095 (diff)
downloadservo-a3339f97c3313cfd57f5e673b88dd165215c0450.tar.gz
servo-a3339f97c3313cfd57f5e673b88dd165215c0450.zip
Print a better error message when rustup is too old
Diffstat (limited to 'python')
-rw-r--r--python/servo/command_base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index c6f0aa0601c..29968e766ad 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -14,6 +14,7 @@ import itertools
import locale
import os
from os import path
+import re
import contextlib
import subprocess
from subprocess import PIPE
@@ -322,6 +323,12 @@ class CommandBase(object):
def call_rustup_run(self, args, **kwargs):
if self.config["tools"]["use-rustup"]:
+ version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"])
+ version = tuple(map(int, re.match("rustup (\d+)\.(\d+)\.(\d+)", version_line).groups()))
+ if version < (1, 8, 0):
+ print "rustup is at version %s.%s.%s, Servo requires 1.8.0 or more recent." % version
+ print "Try running 'rustup self update'."
+ return 1
args = ["rustup" + BIN_SUFFIX, "run", "--install", self.toolchain()] + args
try:
return call(args, **kwargs)