• brucedawson's avatar
    Change ExecLinkWrapper to not buffer all tool output · 81dfeb7b
    brucedawson authored
    /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().
    
    This fixes the previous attempt which omitted the vital link.wait() call
    which meant that error codes were not propagated.
    
    R=scottmg@chromium.org
    BUG=672182,672841
    
    Review-Url: https://codereview.chromium.org/2568563002
    Cr-Commit-Position: refs/heads/master@{#437696}
    81dfeb7b
tool_wrapper.py 13.4 KB