summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/run_rustc.py4
-rw-r--r--tools/util.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/tools/run_rustc.py b/tools/run_rustc.py
index 9e7284c26..81841eff9 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 436630401..904b6ed70 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):