mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Print a better error message when rustup is too old
This commit is contained in:
parent
2f941d8450
commit
a3339f97c3
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue