Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mach now shows stderr when a virtualenv or pip call fails (fixes #11055) #11067

Merged
merged 1 commit into from May 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 16 additions & 8 deletions python/mach_bootstrap.py
Expand Up @@ -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)))

Expand Down Expand Up @@ -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()

Expand Down