aboutsummaryrefslogtreecommitdiffstats
path: root/python/mach_bootstrap.py
diff options
context:
space:
mode:
authorAdrian Utrilla <adrianutrilla@gmail.com>2016-05-07 17:36:27 +0200
committerAdrian Utrilla <adrianutrilla@gmail.com>2016-05-07 17:36:27 +0200
commit0fff10c7e94b34a0244c834fc61a208fc467a311 (patch)
tree637860ca9496ef1ebf316c437609371407a64006 /python/mach_bootstrap.py
parenta09b2374f9d0a54b5ca02ee7b219cd30b5841eb4 (diff)
downloadservo-0fff10c7e94b34a0244c834fc61a208fc467a311.tar.gz
servo-0fff10c7e94b34a0244c834fc61a208fc467a311.zip
Mach now shows stderr when a virtualenv or pip call fails (fixes #11055)
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r--python/mach_bootstrap.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py
index 57e6472e5c8..a22d2aea9af 100644
--- a/python/mach_bootstrap.py
+++ b/python/mach_bootstrap.py
@@ -106,10 +106,14 @@ def _activate_virtualenv(topdir):
if virtualenv is None:
sys.exit("Python virtualenv is not installed. Please install it prior to running mach.")
- try:
- subprocess.check_call([virtualenv, "-p", python, virtualenv_path])
- except (subprocess.CalledProcessError, OSError):
- sys.exit("Python virtualenv failed to execute properly.")
+ process = subprocess.Popen(
+ [virtualenv, "-p", python, virtualenv_path],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ process.wait()
+ if process.returncode:
+ sys.exit("Python virtualenv failed to execute properly: {}"
+ .format(process.communicate()[1]))
execfile(activate_path, dict(__file__=quote(activate_path)))
@@ -138,10 +142,14 @@ def _activate_virtualenv(topdir):
if pip is None:
sys.exit("Python pip is not installed. Please install it prior to running mach.")
- try:
- subprocess.check_call([pip, "install", "-q", "-r", req_path])
- except (subprocess.CalledProcessError, OSError):
- sys.exit("Pip failed to execute properly.")
+ process = subprocess.Popen(
+ [pip, "install", "-q", "-r", req_path],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ process.wait()
+ if process.returncode:
+ sys.exit("Pip failed to execute properly: {}"
+ .format(process.communicate()[1]))
open(marker_path, 'w').close()