Index: build/toolchain/win/tool_wrapper.py |
diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py |
index 281298c65c2aabe4100ad320917c2cc7aaeecbc3..4e69deafb5f92ad6f9d635df7d90b0433b262f13 100644 |
--- a/build/toolchain/win/tool_wrapper.py |
+++ b/build/toolchain/win/tool_wrapper.py |
@@ -133,13 +133,14 @@ class WinTool(object): |
# non-Windows don't do that there. |
link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env, |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
- out, _ = link.communicate() |
- for line in out.splitlines(): |
+ # Read output one line at a time as it shows up to avoid OOM failures when |
+ # GBs of output is produced. |
+ for line in link.stdout: |
if (not line.startswith(' Creating library ') and |
not line.startswith('Generating code') and |
not line.startswith('Finished generating code')): |
- print line |
- return link.returncode |
+ print line, |
+ return link.wait() |
def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, |
mt, rc, intermediate_manifest, *manifests): |