mirror of
https://github.com/servo/servo.git
synced 2025-07-05 14:33:38 +01:00
Fix "rustup is not installed" message
This commit is contained in:
parent
d0b3525474
commit
e0f8f09c05
1 changed files with 8 additions and 9 deletions
|
@ -323,15 +323,8 @@ class CommandBase(object):
|
||||||
|
|
||||||
def call_rustup_run(self, args, **kwargs):
|
def call_rustup_run(self, args, **kwargs):
|
||||||
if self.config["tools"]["use-rustup"]:
|
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:
|
try:
|
||||||
return call(args, **kwargs)
|
version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"])
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
|
if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
|
||||||
print "It looks like rustup is not installed. See instructions at " \
|
print "It looks like rustup is not installed. See instructions at " \
|
||||||
|
@ -339,9 +332,15 @@ class CommandBase(object):
|
||||||
print
|
print
|
||||||
return 1
|
return 1
|
||||||
raise
|
raise
|
||||||
|
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
|
||||||
else:
|
else:
|
||||||
args[0] += BIN_SUFFIX
|
args[0] += BIN_SUFFIX
|
||||||
return call(args, **kwargs)
|
return call(args, **kwargs)
|
||||||
|
|
||||||
def get_top_dir(self):
|
def get_top_dir(self):
|
||||||
return self.context.topdir
|
return self.context.topdir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue