Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: build/win/message_compiler.py

Issue 1433093002: Roll buildtools 4a95614772..3ba3ca22ec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/allocator/prep_libc.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the 5 # Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the
6 # GN build, which can only run Python and not native binaries. 6 # GN build, which can only run Python and not native binaries.
7 # 7 #
8 # Usage: message_compiler.py <environment_file> [<args to mc.exe>*] 8 # Usage: message_compiler.py <environment_file> [<args to mc.exe>*]
9 9
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 12
13 # Read the environment block from the file. This is stored in the format used 13 # Read the environment block from the file. This is stored in the format used
14 # by CreateProcess. Drop last 2 NULs, one for list terminator, one for trailing 14 # by CreateProcess. Drop last 2 NULs, one for list terminator, one for trailing
15 # vs. separator. 15 # vs. separator.
16 env_pairs = open(sys.argv[1]).read()[:-2].split('\0') 16 env_pairs = open(sys.argv[1]).read()[:-2].split('\0')
17 env_dict = dict([item.split('=', 1) for item in env_pairs]) 17 env_dict = dict([item.split('=', 1) for item in env_pairs])
18 18
19 # mc writes to stderr, so this explicitly redirects to stdout and eats it. 19 # mc writes to stderr, so this explicitly redirects to stdout and eats it.
20 try: 20 try:
21 # This needs shell=True to search the path in env_dict for the mc executable.
21 subprocess.check_output(["mc.exe"] + sys.argv[2:], 22 subprocess.check_output(["mc.exe"] + sys.argv[2:],
22 env=env_dict, 23 env=env_dict,
23 stderr=subprocess.STDOUT) 24 stderr=subprocess.STDOUT,
25 shell=True)
24 except subprocess.CalledProcessError as e: 26 except subprocess.CalledProcessError as e:
25 print e.output 27 print e.output
26 sys.exit(e.returncode) 28 sys.exit(e.returncode)
OLDNEW
« no previous file with comments | « base/allocator/prep_libc.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698