Skip to content

Commit

Permalink
Simplify run_rustc.py output.
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jul 26, 2018
1 parent b39a71d commit 6b49944
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/run_rustc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import argparse
import subprocess
import util


# Updates the path of the main target in the depfile to the relative path
Expand All @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion tools/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import shutil
import stat
import sys
import subprocess

executable_suffix = ".exe" if os.name == "nt" else ""
Expand All @@ -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):
Expand Down

0 comments on commit 6b49944

Please sign in to comment.