From 6b49944da1e7b06aeba04b1c0ded8e3fdb3c436b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 23 Jul 2018 20:50:11 -0400 Subject: [PATCH] Simplify run_rustc.py output. --- tools/run_rustc.py | 4 ++-- tools/util.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/run_rustc.py b/tools/run_rustc.py index 9e7284c260..81841eff96 100644 --- a/tools/run_rustc.py +++ b/tools/run_rustc.py @@ -8,6 +8,7 @@ import sys import os import argparse import subprocess +import util # Updates the path of the main target in the depfile to the relative path @@ -34,8 +35,7 @@ def main(): required=False) args, rest = parser.parse_known_args() - env = os.environ.copy() - subprocess.check_call(["rustc"] + rest, env=env) + util.run(["rustc"] + rest, quiet=True) if args.depfile and args.output_file: fix_depfile(args.depfile, os.getcwd(), args.output_file) diff --git a/tools/util.py b/tools/util.py index 436630401b..904b6ed70b 100644 --- a/tools/util.py +++ b/tools/util.py @@ -3,6 +3,7 @@ import os import shutil import stat +import sys import subprocess executable_suffix = ".exe" if os.name == "nt" else "" @@ -24,7 +25,9 @@ def run(args, quiet=False, cwd=None, env=None, merge_env={}): print " ".join(args) env = make_env(env=env, merge_env=merge_env) shell = os.name == "nt" # Run through shell to make .bat/.cmd files work. - subprocess.check_call(args, cwd=cwd, env=env, shell=shell) + rc = subprocess.call(args, cwd=cwd, env=env, shell=shell) + if rc != 0: + sys.exit(rc) def remove_and_symlink(target, name, target_is_dir=False):