From 87240257824d7f8dd6c32e82fb1983f9c7ddb26f Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Tue, 21 Nov 2023 18:46:57 +0000 Subject: [PATCH] Adds a flag to run_binary_size_analysis.py to disable format checks This change is needed for compatibility with the Flutter Engine's use of a new Android NDK. The new Android NDK includes a new clang toolchain which does a better job of classifying various contributors to a binary's size, but which fails the compatibility checks in the script. The intention of the compatibility checks is to exclude versions of tooling that are too old not versions that are too new. The compatibility check is also redundant with failure modes later in the script. To avoid breaking any usage of this script in the Dart tree, however, the check is retained by this change, and instead a flag is added that skips it. This is preferable to expanding on the questionable use of regular expressions that implement the check to capture the strings emitted by a continually updating toolchain. Change-Id: If379e4aa86339a31eada0b6ce3fa90ddc9351804 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337602 Commit-Queue: Zach Anderson Reviewed-by: Ryan Macnak Reviewed-by: Paul Berry Reviewed-by: Siva Annamalai --- .../binary_size/src/run_binary_size_analysis.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/third_party/binary_size/src/run_binary_size_analysis.py b/third_party/binary_size/src/run_binary_size_analysis.py index 18103a13c4c..b90d034fc17 100755 --- a/third_party/binary_size/src/run_binary_size_analysis.py +++ b/third_party/binary_size/src/run_binary_size_analysis.py @@ -620,6 +620,16 @@ def main(): help='the path to the source code of the output binary, ' 'default set to current directory. Used in the' ' disambiguation process.') + parser.add_option( + '--check-support', + dest='check_support', + default=True, + action='store_true', + help='Check that the version of the available tools is sufficient to ' + 'read the data from the library given by --library') + parser.add_option('--no-check-support', + action='store_false', + dest='check_support') opts, _args = parser.parse_args() if ((not opts.library) and @@ -663,7 +673,7 @@ def main(): print('addr2line: %s' % addr2line_binary) print('nm: %s' % nm_binary) - if opts.library: + if opts.library and opts.check_support: CheckDebugFormatSupport(opts.library, addr2line_binary) # Prepare output directory and report guts