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

Side by Side Diff: build/toolchain/win/tool_wrapper.py

Issue 2564893002: Revert of Change ExecLinkWrapper to not buffer all tool output (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Utility functions for Windows builds. 5 """Utility functions for Windows builds.
6 6
7 This file is copied to the build directory as part of toolchain setup and 7 This file is copied to the build directory as part of toolchain setup and
8 is used to set up calls to tools used by the build that need wrappers. 8 is used to set up calls to tools used by the build that need wrappers.
9 """ 9 """
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 # https://docs.python.org/2/library/subprocess.html: 126 # https://docs.python.org/2/library/subprocess.html:
127 # "On Unix with shell=True [...] if args is a sequence, the first item 127 # "On Unix with shell=True [...] if args is a sequence, the first item
128 # specifies the command string, and any additional items will be treated as 128 # specifies the command string, and any additional items will be treated as
129 # additional arguments to the shell itself. That is to say, Popen does the 129 # additional arguments to the shell itself. That is to say, Popen does the
130 # equivalent of: 130 # equivalent of:
131 # Popen(['/bin/sh', '-c', args[0], args[1], ...])" 131 # Popen(['/bin/sh', '-c', args[0], args[1], ...])"
132 # For that reason, since going through the shell doesn't seem necessary on 132 # For that reason, since going through the shell doesn't seem necessary on
133 # non-Windows don't do that there. 133 # non-Windows don't do that there.
134 link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env, 134 link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env,
135 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 135 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
136 # Read output one line at a time as it shows up to avoid OOM failures when 136 out, _ = link.communicate()
137 # GBs of output is produced. 137 for line in out.splitlines():
138 for line in link.stdout:
139 if (not line.startswith(' Creating library ') and 138 if (not line.startswith(' Creating library ') and
140 not line.startswith('Generating code') and 139 not line.startswith('Generating code') and
141 not line.startswith('Finished generating code')): 140 not line.startswith('Finished generating code')):
142 print line, 141 print line
143 return link.returncode 142 return link.returncode
144 143
145 def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, 144 def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
146 mt, rc, intermediate_manifest, *manifests): 145 mt, rc, intermediate_manifest, *manifests):
147 """A wrapper for handling creating a manifest resource and then executing 146 """A wrapper for handling creating a manifest resource and then executing
148 a link command.""" 147 a link command."""
149 # The 'normal' way to do manifests is to have link generate a manifest 148 # The 'normal' way to do manifests is to have link generate a manifest
150 # based on gathering dependencies from the object files, then merge that 149 # based on gathering dependencies from the object files, then merge that
151 # manifest with other manifests supplied as sources, convert the merged 150 # manifest with other manifests supplied as sources, convert the merged
152 # manifest to a resource, and then *relink*, including the compiled 151 # manifest to a resource, and then *relink*, including the compiled
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 project_dir = os.path.relpath(project_dir, BASE_DIR) 320 project_dir = os.path.relpath(project_dir, BASE_DIR)
322 selected_files = selected_files.split(';') 321 selected_files = selected_files.split(';')
323 ninja_targets = [os.path.join(project_dir, filename) + '^^' 322 ninja_targets = [os.path.join(project_dir, filename) + '^^'
324 for filename in selected_files] 323 for filename in selected_files]
325 cmd = ['ninja.exe'] 324 cmd = ['ninja.exe']
326 cmd.extend(ninja_targets) 325 cmd.extend(ninja_targets)
327 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) 326 return subprocess.call(cmd, shell=True, cwd=BASE_DIR)
328 327
329 if __name__ == '__main__': 328 if __name__ == '__main__':
330 sys.exit(main(sys.argv[1:])) 329 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698