diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2017-11-28 17:38:36 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-01-10 18:05:45 +0100 |
commit | e0f8f09c0561be31cfb02c008f31fefe6fab48dc (patch) | |
tree | 704f448a547cd3d760500252e3cf8822ab9e6a1b /python/servo/command_base.py | |
parent | d0b3525474fe55a2d0449ee136e7fc6cf2c2856d (diff) | |
download | servo-e0f8f09c0561be31cfb02c008f31fefe6fab48dc.tar.gz servo-e0f8f09c0561be31cfb02c008f31fefe6fab48dc.zip |
Fix "rustup is not installed" message
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 29968e766ad..c7d6f51d1f9 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -323,15 +323,8 @@ 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) + version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"]) except OSError as e: if e.errno == NO_SUCH_FILE_OR_DIRECTORY: print "It looks like rustup is not installed. See instructions at " \ @@ -339,9 +332,15 @@ class CommandBase(object): print return 1 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: args[0] += BIN_SUFFIX - return call(args, **kwargs) + return call(args, **kwargs) def get_top_dir(self): return self.context.topdir |