Commit e639d462 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Use a flag file when dexing

Dex command was hitting length limits.

Bug: 1092918
Change-Id: Idcaf0706bf57882178440d9c8597985daa315d49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237713
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarSam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776567}
parent 91c187cc
......@@ -159,9 +159,18 @@ def _RunD8(dex_cmd, input_paths, output_path):
output = re.sub(r'^Warning in .*?:\n(?! )', '', output, flags=re.MULTILINE)
return output
# stdout sometimes spams with things like:
# Stripped invalid locals information from 1 method.
build_utils.CheckOutput(dex_cmd, stderr_filter=stderr_filter)
with tempfile.NamedTemporaryFile() as flag_file:
# Chosen arbitrarily. Needed to avoid command-line length limits.
MAX_ARGS = 50
if len(dex_cmd) > MAX_ARGS:
flag_file.write('\n'.join(dex_cmd[MAX_ARGS:]))
flag_file.flush()
dex_cmd = dex_cmd[:MAX_ARGS]
dex_cmd.append('@' + flag_file.name)
# stdout sometimes spams with things like:
# Stripped invalid locals information from 1 method.
build_utils.CheckOutput(dex_cmd, stderr_filter=stderr_filter)
def _EnvWithArtLibPath(binary_path):
......
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