mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #11067 - autrilla:mach-errors, r=mbrubeck
Mach now shows stderr when a virtualenv or pip call fails (fixes #11055) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11067) <!-- Reviewable:end -->
This commit is contained in:
commit
c226bf85a9
1 changed files with 16 additions and 8 deletions
|
@ -106,10 +106,14 @@ def _activate_virtualenv(topdir):
|
||||||
if virtualenv is None:
|
if virtualenv is None:
|
||||||
sys.exit("Python virtualenv is not installed. Please install it prior to running mach.")
|
sys.exit("Python virtualenv is not installed. Please install it prior to running mach.")
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(
|
||||||
subprocess.check_call([virtualenv, "-p", python, virtualenv_path])
|
[virtualenv, "-p", python, virtualenv_path],
|
||||||
except (subprocess.CalledProcessError, OSError):
|
stdout=subprocess.PIPE,
|
||||||
sys.exit("Python virtualenv failed to execute properly.")
|
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)))
|
execfile(activate_path, dict(__file__=quote(activate_path)))
|
||||||
|
|
||||||
|
@ -138,10 +142,14 @@ def _activate_virtualenv(topdir):
|
||||||
if pip is None:
|
if pip is None:
|
||||||
sys.exit("Python pip is not installed. Please install it prior to running mach.")
|
sys.exit("Python pip is not installed. Please install it prior to running mach.")
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(
|
||||||
subprocess.check_call([pip, "install", "-q", "-r", req_path])
|
[pip, "install", "-q", "-r", req_path],
|
||||||
except (subprocess.CalledProcessError, OSError):
|
stdout=subprocess.PIPE,
|
||||||
sys.exit("Pip failed to execute properly.")
|
stderr=subprocess.PIPE)
|
||||||
|
process.wait()
|
||||||
|
if process.returncode:
|
||||||
|
sys.exit("Pip failed to execute properly: {}"
|
||||||
|
.format(process.communicate()[1]))
|
||||||
|
|
||||||
open(marker_path, 'w').close()
|
open(marker_path, 'w').close()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue