Commit 8e0b754f authored by scottmg's avatar scottmg Committed by Commit bot

Revert of Change ExecLinkWrapper to not buffer all tool output (patchset #2...

Revert of Change ExecLinkWrapper to not buffer all tool output (patchset #2 id:20001 of https://codereview.chromium.org/2558153002/ )

Reason for revert:
Reverting under suspicion for crbug.com/672841.

Original issue's description:
> Change ExecLinkWrapper to not buffer all tool output
>
> /verbose linking of chrome.dll creates over one GB of output. This
> causes ExecLinkWrapper to consume over two GB of memory which leads to
> an OOM failure in the 32-bit depot_tools python, and the loss of all
> of the valuable output. This change modifies ExecLinkWrapper to
> process the output one line at a time, thus avoiding the OOM.
>
> I've tested that this handles the 1.1 GB of output which the previous
> version of this function failed on and I've visually confirmed that the
> output looks the same - no extraneous blank lines, for instance, when
> displaying warnings, errors, or 1.9 million lines of verbose output.
>
> I also verified that the script stays idle when waiting for output -
> blocking on .readline().
>
> BUG=672182
>
> Committed: https://crrev.com/5d0d1b0bf01acb3ebe3a5ef27ebf2f3180ab1d1d
> Cr-Commit-Position: refs/heads/master@{#437126}

TBR=brucedawson@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=672182

Review-Url: https://codereview.chromium.org/2564893002
Cr-Commit-Position: refs/heads/master@{#437572}
parent 2f32a659
...@@ -133,13 +133,12 @@ class WinTool(object): ...@@ -133,13 +133,12 @@ class WinTool(object):
# non-Windows don't do that there. # non-Windows don't do that there.
link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env, link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# Read output one line at a time as it shows up to avoid OOM failures when out, _ = link.communicate()
# GBs of output is produced. for line in out.splitlines():
for line in link.stdout:
if (not line.startswith(' Creating library ') and if (not line.startswith(' Creating library ') and
not line.startswith('Generating code') and not line.startswith('Generating code') and
not line.startswith('Finished generating code')): not line.startswith('Finished generating code')):
print line, print line
return link.returncode return link.returncode
def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment