Chromium Code Reviews| 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..4adfe92ccd54bd8b6f94b8adb4e2add10afe55b8 100644 |
| --- a/build/toolchain/win/tool_wrapper.py |
| +++ b/build/toolchain/win/tool_wrapper.py |
| @@ -133,12 +133,17 @@ 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. |
| + while True: |
| + line = link.stdout.readline() |
| + if len(line) == 0: # Read of zero bytes means EOF |
|
scottmg
2016/12/07 22:20:56
I'm not sure about the loop termination...
for li
brucedawson
2016/12/07 23:00:24
Agreed. I started with a solution that read stderr
|
| + break |
| if (not line.startswith(' Creating library ') and |
| not line.startswith('Generating code') and |
| not line.startswith('Finished generating code')): |
| - print line |
| + print line, |
| + link.wait() |
| return link.returncode |
| def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, |