diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-11-28 16:14:41 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-12-13 15:19:41 +0000 |
commit | 61d9742824d54be5693191fe502325a909feca59 (patch) | |
tree | cbf28e779b11338fe52eb75b915684cd8955542c /chromium/build/android/gyp/dex.py | |
parent | 45f9ded08bb7526984b24ccb5a5327aaf6821676 (diff) |
BASELINE: Update Chromium to 108.0.5359.70
Change-Id: I77334ff232b819600f275bd3cfe41fbaa3619230
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/445904
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/android/gyp/dex.py')
-rwxr-xr-x | chromium/build/android/gyp/dex.py | 78 |
1 files changed, 34 insertions, 44 deletions
diff --git a/chromium/build/android/gyp/dex.py b/chromium/build/android/gyp/dex.py index 6cee06f7227..5c597381911 100755 --- a/chromium/build/android/gyp/dex.py +++ b/chromium/build/android/gyp/dex.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright 2013 The Chromium Authors. All rights reserved. +# Copyright 2013 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -23,30 +23,25 @@ from util import zipalign _DEX_XMX = '2G' # Increase this when __final_dex OOMs. _IGNORE_WARNINGS = ( - # Caused by Play Services: - r'Type `libcore.io.Memory` was not found', - # Caused by flogger supporting these as fallbacks. Not needed at runtime. - r'Type `dalvik.system.VMStack` was not found', - r'Type `sun.misc.JavaLangAccess` was not found', - r'Type `sun.misc.SharedSecrets` was not found', - # Caused by jacoco code coverage: - r'Type `java.lang.management.ManagementFactory` was not found', - # Caused when the test apk and the apk under test do not having native libs. + # E.g. Triggers for weblayer_instrumentation_test_apk since both it and its + # apk_under_test have no shared_libraries. + # https://crbug.com/1364192 << To fix this in a better way. r'Missing class org.chromium.build.NativeLibraries', - # Caused by internal annotation: https://crbug.com/1180222 - r'Missing class com.google.errorprone.annotations.RestrictedInheritance', # Caused by internal protobuf package: https://crbug.com/1183971 r'referenced from: com.google.protobuf.GeneratedMessageLite$GeneratedExtension', # pylint: disable=line-too-long - # Caused by using Bazel desugar instead of D8 for desugar, since Bazel - # desugar doesn't preserve interfaces in the same way. This should be - # removed when D8 is used for desugaring. - r'Warning: Cannot emulate interface ', # Desugaring configs may occasionally not match types in our program. This # may happen temporarily until we move over to the new desugared library # json flags. See crbug.com/1302088 - this should be removed when this bug # is fixed. - r'Warning: Specification conversion: The following prefixes do not match any type:', # pylint: disable=line-too-long - # Only relevant for R8 when optimizing an app that doesn't use proto. + r'Warning: Specification conversion: The following', + # Caused by protobuf runtime using -identifiernamestring in a way that + # doesn't work with R8. Looks like: + # Rule matches the static final field `...`, which may have been inlined... + # com.google.protobuf.*GeneratedExtensionRegistryLite { + # static java.lang.String CONTAINING_TYPE_*; + # } + r'GeneratedExtensionRegistryLite.CONTAINING_TYPE_', + # Relevant for R8 when optimizing an app that doesn't use protobuf. r'Ignoring -shrinkunusedprotofields since the protobuf-lite runtime is', ) @@ -124,6 +119,8 @@ def _ParseArgs(args): parser.add_argument('--force-enable-assertions', action='store_true', help='Forcefully enable javac generated assertion code.') + parser.add_argument('--assertion-handler', + help='The class name of the assertion handler class.') parser.add_argument('--warnings-as-errors', action='store_true', help='Treat all warnings as errors.') @@ -136,6 +133,10 @@ def _ParseArgs(args): if options.main_dex_rules_path and not options.multi_dex: parser.error('--main-dex-rules-path is unused if multidex is not enabled') + if options.force_enable_assertions and options.assertion_handler: + parser.error('Cannot use both --force-enable-assertions and ' + '--assertion-handler') + options.class_inputs = build_utils.ParseGnList(options.class_inputs) options.class_inputs_filearg = build_utils.ParseGnList( options.class_inputs_filearg) @@ -150,40 +151,27 @@ def _ParseArgs(args): def CreateStderrFilter(show_desugar_default_interface_warnings): def filter_stderr(output): + # Set this when debugging R8 output. + if os.environ.get('R8_SHOW_ALL_OUTPUT', '0') != '0': + return output + + warnings = re.split(r'^(?=Warning)', output, flags=re.MULTILINE) + preamble, *warnings = warnings + patterns = list(_IGNORE_WARNINGS) - # When using Bazel's Desugar tool to desugar lambdas and interface methods, - # we do not provide D8 with a classpath, which causes a lot of warnings from - # D8's default interface desugaring pass. Not having a classpath makes - # incremental dexing much more effective. D8 still does backported method - # desugaring. - # These warnings are also turned off when bytecode checks are turned off. + # Missing deps can happen for prebuilts that are missing transitive deps + # and have set enable_bytecode_checks=false. if not show_desugar_default_interface_warnings: patterns += ['default or static interface methods'] combined_pattern = '|'.join(re.escape(p) for p in patterns) - output = build_utils.FilterLines(output, combined_pattern) + preamble = build_utils.FilterLines(preamble, combined_pattern) - # Each warning has a prefix line of the file it's from. If we've filtered - # out the warning, then also filter out the file header. - # E.g.: - # Warning in path/to/Foo.class: - # Error message #1 indented here. - # Error message #2 indented here. - output = re.sub(r'^Warning in .*?:\n(?! )', '', output, flags=re.MULTILINE) + compiled_re = re.compile(combined_pattern) + warnings = [w for w in warnings if not compiled_re.search(w)] - # Caused by protobuf runtime using -identifiernamestring in a way that - # doesn't work with R8. Looks like: - # Rule matches ... (very long line) { - # static java.lang.String CONTAINING_TYPE_*; - # } - output = re.sub( - r'Rule matches the static final field `java\.lang\.String ' - r'com\.google\.protobuf.*\{\n.*?\n\}\n?', - '', - output, - flags=re.DOTALL) - return output + return preamble + ''.join(warnings) return filter_stderr @@ -518,6 +506,8 @@ def main(args): if options.desugar_jdk_libs_json: dex_cmd += ['--desugared-lib', options.desugar_jdk_libs_json] input_paths += [options.desugar_jdk_libs_json] + if options.assertion_handler: + dex_cmd += ['--force-assertions-handler:' + options.assertion_handler] if options.force_enable_assertions: dex_cmd += ['--force-enable-assertions'] |