aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-27 18:51:56 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-01-10 18:05:44 +0100
commit2f941d8450494895426aa614a15f65e3147d4095 (patch)
treeae5bc4c3e65a0c6106a07c01bbdb8e5fefd76d74
parentf2c398fd5c11362ae2918da7ee12a24e29e3cb6f (diff)
downloadservo-2f941d8450494895426aa614a15f65e3147d4095.tar.gz
servo-2f941d8450494895426aa614a15f65e3147d4095.zip
Print a link to instructions if rustup is not found.
-rw-r--r--python/servo/command_base.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index c1cab4a682c..c6f0aa0601c 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -7,6 +7,7 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
+from errno import ENOENT as NO_SUCH_FILE_OR_DIRECTORY
from glob import glob
import gzip
import itertools
@@ -322,9 +323,18 @@ class CommandBase(object):
def call_rustup_run(self, args, **kwargs):
if self.config["tools"]["use-rustup"]:
args = ["rustup" + BIN_SUFFIX, "run", "--install", self.toolchain()] + args
+ try:
+ return call(args, **kwargs)
+ except OSError as e:
+ if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
+ print "It looks like rustup is not installed. See instructions at " \
+ "https://github.com/servo/servo/#setting-up-your-environment"
+ print
+ return 1
+ raise
else:
args[0] += BIN_SUFFIX
- return call(args, **kwargs)
+ return call(args, **kwargs)
def get_top_dir(self):
return self.context.topdir