Skip to content

Commit

Permalink
Update build from Chromium 92.0.4515.157
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlstrom-g committed Dec 15, 2023
2 parents 9ac239b + 4e3b5e6 commit d313a5a
Show file tree
Hide file tree
Showing 81 changed files with 538 additions and 300 deletions.
4 changes: 2 additions & 2 deletions build/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ third_party {
}
url {
type: GIT
value: "https://chromium.googlesource.com/chromium/src/build"
value: "https://chromium.googlesource.com/chromium/src"
}
version: "cfaca2819f0d31f6bb086250f240ae9fc4a07074"
version: "92.0.4515.157"
last_upgrade_date {
year: 2021
month: 5
Expand Down
2 changes: 1 addition & 1 deletion build/OWNERS.setnoparent
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ file://chrome/android/java/src/org/chromium/chrome/browser/searchwidget/COMPLIAN
# Notification channels appear in system UI and are persisted forever by
# Android, so should not be added or removed lightly, and the proper
# deprecation and versioning steps must be taken when doing so.
file://chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS
file://chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS

# The Weblayer API is supposed to be stable and will be used outside of the
# chromium repository.
Expand Down
2 changes: 1 addition & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ projects, and so should be avoided.

Changes to `//build` should be landed in the Chromium repo. They will then be
replicated to the stand-alone [build repo](https://chromium.googlesource.com/chromium/src/build)
by the [gsubtreed tool.](https://chromium.googlesource.com/infra/infra/+/master/infra/services/gsubtreed)
by the [gsubtreed tool.](https://chromium.googlesource.com/infra/infra/+/main/infra/services/gsubtreed)
Note: You can find all directories already available through gsubtreed in the
[list of all chromium repos](https://chromium.googlesource.com/).

Expand Down
2 changes: 1 addition & 1 deletion build/android/adb_gdb
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ EOF
echo "GDB wrapper script: $SYM_GDB"
echo "App executable: $SYM_EXE"
echo "gdbinit: $SYM_INIT"
echo "Connect with vscode: https://chromium.googlesource.com/chromium/src/+/master/docs/vscode.md#Launch-Commands"
echo "Connect with vscode: https://chromium.googlesource.com/chromium/src/+/main/docs/vscode.md#Launch-Commands"
echo "Showing gdbserver logs. Press Ctrl-C to disconnect."
tail -f "$GDBSERVER_LOG"
else
Expand Down
4 changes: 2 additions & 2 deletions build/android/docs/build_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ build/android/gyp/write_build_config.py \
python tools/md_browser/md_browser.py -d /tmp /tmp/format.md
```

[build/android/gyp/]: https://chromium.googlesource.com/chromium/src/build/+/master/android/gyp/
[build/android/gyp/]: https://chromium.googlesource.com/chromium/src/build/+/main/android/gyp/
[gn_write_build_config]: https://cs.chromium.org/chromium/src/build/config/android/internal_rules.gni?q=write_build_config&sq=package:chromium
[write_build_config_py]: https://chromium.googlesource.com/chromium/src/build/+/master/android/gyp/write_build_config.py
[write_build_config_py]: https://chromium.googlesource.com/chromium/src/build/+/main/android/gyp/write_build_config.py
4 changes: 4 additions & 0 deletions build/android/docs/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class files and runtime **.exec** files. Then we need to process them using the
3. The coverage results of JUnit and instrumentation tests will be merged
automatically if they are in the same directory.

4. If generating coverage and there are duplicate class files, as can happen
when generating coverage for downstream targets, use the
--include-substr-filter option to choose jars in the desired directory.

## How to generate coverage report

1. Now we have generated .exec files already. We can create a JaCoCo HTML/XML/CSV
Expand Down
2 changes: 1 addition & 1 deletion build/android/docs/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ These suppressions files should only be used for temporarily ignoring warnings
that are too hard (or not possible) to suppress locally, and permanently
ignoring warnings only for this target. To permanently ignore a warning for all
targets, add the warning to the `_DISABLED_ALWAYS` list in
[build/android/gyp/lint.py](https://source.chromium.org/chromium/chromium/src/+/master:build/android/gyp/lint.py).
[build/android/gyp/lint.py](https://source.chromium.org/chromium/chromium/src/+/main:build/android/gyp/lint.py).
Disabling globally makes lint a bit faster.

The exception to the above rule is for warnings that affect multiple languages.
Expand Down
25 changes: 18 additions & 7 deletions build/android/generate_jacoco_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,27 @@
_HOST_CLASS_EXCLUDE_SUFFIX = 'device_filter.jar'


def _CreateClassfileArgs(class_files, exclude_suffix=None):
"""Returns a list of files that don't have a given suffix.
def _CreateClassfileArgs(class_files, exclude_suffix=None, include_substr=None):
"""Returns a filtered list of files with classfile option.
Args:
class_files: A list of class files.
exclude_suffix: Suffix to look for to exclude.
include_substr: A substring that must be present to include the file.
exclude_suffix takes precedence over this.
Returns:
A list of files that don't use the suffix.
"""
result_class_files = []
for f in class_files:
if exclude_suffix:
if not f.endswith(exclude_suffix):
result_class_files += ['--classfiles', f]
else:
include_file = True
if exclude_suffix and f.endswith(exclude_suffix):
include_file = False
# Exclude overrides include.
if include_file and include_substr and include_substr not in f:
include_file = False
if include_file:
result_class_files += ['--classfiles', f]

return result_class_files
Expand All @@ -68,7 +73,8 @@ def _GenerateReportOutputArgs(args, class_files, report_type):
elif report_type == 'host':
class_jar_exclude = _HOST_CLASS_EXCLUDE_SUFFIX

cmd = _CreateClassfileArgs(class_files, class_jar_exclude)
cmd = _CreateClassfileArgs(class_files, class_jar_exclude,
args.include_substr_filter)
if args.format == 'html':
report_dir = os.path.join(args.output_dir, report_type)
if not os.path.exists(report_dir):
Expand Down Expand Up @@ -141,6 +147,10 @@ def _ParseArguments(parser):
'host classpath files. Host would typically be used for junit tests '
' and device for tests that run on the device. Only used for xml and csv'
' reports.')
parser.add_argument('--include-substr-filter',
help='Substring that must be included in classjars.',
type=str,
default='')
parser.add_argument('--output-dir', help='html report output directory.')
parser.add_argument('--output-file',
help='xml file to write device coverage results.')
Expand Down Expand Up @@ -241,6 +251,7 @@ def main():
# report and we wouldn't know which one a developer needed.
device_cmd = cmd + _GenerateReportOutputArgs(args, class_files, 'device')
host_cmd = cmd + _GenerateReportOutputArgs(args, class_files, 'host')

device_exit_code = cmd_helper.RunCmd(device_cmd)
host_exit_code = cmd_helper.RunCmd(host_cmd)
exit_code = device_exit_code or host_exit_code
Expand Down
1 change: 1 addition & 0 deletions build/android/gyp/apkbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def main(args):
# Included via .build_config, so need to write it to depfile.
depfile_deps.extend(x[0] for x in assets)
depfile_deps.extend(x[0] for x in uncompressed_assets)
depfile_deps.append(options.resource_apk)

# Bundle modules have a structure similar to APKs, except that resources
# are compiled in protobuf format (instead of binary xml), and that some
Expand Down
2 changes: 1 addition & 1 deletion build/android/gyp/assert_static_initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def main():
print(' //tools/binary_size/diagnose_bloat.py')
print()
print('For more information:')
print(' https://chromium.googlesource.com/chromium/src/+/master/docs/'
print(' https://chromium.googlesource.com/chromium/src/+/main/docs/'
'static_initializers.md')
sys.exit(1)

Expand Down
2 changes: 2 additions & 0 deletions build/android/gyp/dex.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
# desugar doesn't preserve interfaces in the same way. This should be
# removed when D8 is used for desugaring.
r'Warning: Cannot emulate interface ',
# Only relevant for R8 when optimizing an app that doesn't use proto.
r'Ignoring -shrinkunusedprotofields since the protobuf-lite runtime is',
)


Expand Down
9 changes: 8 additions & 1 deletion build/android/gyp/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from util import manifest_utils
from util import server_utils

_LINT_MD_URL = 'https://chromium.googlesource.com/chromium/src/+/master/build/android/docs/lint.md' # pylint: disable=line-too-long
_LINT_MD_URL = 'https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md' # pylint: disable=line-too-long

# These checks are not useful for chromium.
_DISABLED_ALWAYS = [
Expand Down Expand Up @@ -218,6 +218,13 @@ def _RunLint(lint_binary_path,
'--disable',
','.join(_DISABLED_ALWAYS),
]

# Crashes lint itself, see b/187524311
# Only disable if we depend on androidx.fragment (otherwise lint fails due to
# non-existent check).
if any('androidx_fragment_fragment' in aar for aar in aars):
cmd.extend(['--disable', 'DialogFragmentCallbacksDetector'])

if baseline:
cmd.extend(['--baseline', baseline])
if testonly_target:
Expand Down
1 change: 1 addition & 0 deletions build/android/gyp/merge_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def main(argv):
root_manifest,
'--property',
'PACKAGE=' + package,
'--remove-tools-declarations',
]
build_utils.CheckOutput(
cmd,
Expand Down
46 changes: 17 additions & 29 deletions build/android/gyp/proguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ def _OptimizeWithR8(options,
# R8 OOMs with the default xmx=1G.
cmd = build_utils.JavaCmd(options.warnings_as_errors, xmx='2G') + [
'-Dcom.android.tools.r8.allowTestProguardOptions=1',
'-Dcom.android.tools.r8.verticalClassMerging=1',
'-Dcom.android.tools.r8.disableHorizontalClassMerging=1',
]
if options.disable_outlining:
Expand Down Expand Up @@ -467,46 +466,35 @@ def stderr_filter(stderr):

# TODO(agrieve): Create interface jars for these missing classes rather
# than allowlisting here.
'dalvik/system',
'libcore/io',
'sun/misc/Unsafe',
'dalvik.system',
'libcore.io',
'sun.misc.Unsafe',

# Found in: com/facebook/fbui/textlayoutbuilder/StaticLayoutHelper
('android/text/StaticLayout;<init>(Ljava/lang/CharSequence;IILandroid'
'/text/TextPaint;ILandroid/text/Layout$Alignment;Landroid/text/'
'TextDirectionHeuristic;FFZLandroid/text/TextUtils$TruncateAt;II)V'),

# Found in
# com/google/android/gms/cast/framework/media/internal/ResourceProvider
# Missing due to setting "strip_resources = true".
'com/google/android/gms/cast/framework/R',

# Found in com/google/android/gms/common/GoogleApiAvailability
# Missing due to setting "strip_drawables = true".
'com/google/android/gms/base/R$drawable',
'android.text.StaticLayout.<init>',

# Explicictly guarded by try (NoClassDefFoundError) in Flogger's
# PlatformProvider.
'com/google/common/flogger/backend/google/GooglePlatform',
'com/google/common/flogger/backend/system/DefaultPlatform',
'com.google.common.flogger.backend.google.GooglePlatform',
'com.google.common.flogger.backend.system.DefaultPlatform',

# trichrome_webview_google_bundle contains this missing reference.
# TODO(crbug.com/1142530): Fix this missing reference properly.
'org/chromium/build/NativeLibraries',
'org.chromium.build.NativeLibraries',

# TODO(agrieve): Exclude these only when use_jacoco_coverage=true.
'Ljava/lang/instrument/ClassFileTransformer',
'Ljava/lang/instrument/IllegalClassFormatException',
'Ljava/lang/instrument/Instrumentation',
'Ljava/lang/management/ManagementFactory',
'Ljavax/management/MBeanServer',
'Ljavax/management/ObjectInstance',
'Ljavax/management/ObjectName',
'Ljavax/management/StandardMBean',
'java.lang.instrument.ClassFileTransformer',
'java.lang.instrument.IllegalClassFormatException',
'java.lang.instrument.Instrumentation',
'java.lang.management.ManagementFactory',
'javax.management.MBeanServer',
'javax.management.ObjectInstance',
'javax.management.ObjectName',
'javax.management.StandardMBean',

# Explicitly guarded by try (NoClassDefFoundError) in Firebase's
# KotlinDetector: com.google.firebase.platforminfo.KotlinDetector.
'Lkotlin/KotlinVersion',
'kotlin.KotlinVersion',
]

had_unfiltered_items = ' ' in stderr
Expand All @@ -530,7 +518,7 @@ def stderr_filter(stderr):
stderr += """
You may need to update build configs to run FragmentActivityReplacer for
additional targets. See
https://chromium.googlesource.com/chromium/src.git/+/master/docs/ui/android/bytecode_rewriting.md.
https://chromium.googlesource.com/chromium/src.git/+/main/docs/ui/android/bytecode_rewriting.md.
"""
elif had_unfiltered_items:
# Left only with empty headings. All indented items filtered out.
Expand Down
45 changes: 27 additions & 18 deletions build/android/gyp/write_build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,16 @@
* `deps_info['res_sources_path']`:
Path to file containing a list of resource source files used by the
android_resources target. This replaces `deps_info['resource_dirs']` which is
now no longer used.
android_resources target.
* `deps_info['resources_zip']`:
*Required*. Path to the `.resources.zip` file that contains all raw/uncompiled
resource files for this target (and also no `R.txt`, `R.java` or `R.class`).
If `deps_info['resource_dirs']` is missing, this must point to a prebuilt
`.aar` archive containing resources. Otherwise, this will point to a
zip archive generated at build time, wrapping the content of
`deps_info['resource_dirs']` into a single zip file.
If `deps_info['res_sources_path']` is missing, this must point to a prebuilt
`.aar` archive containing resources. Otherwise, this will point to a zip
archive generated at build time, wrapping the sources listed in
`deps_info['res_sources_path']` into a single zip file.
* `deps_info['package_name']`:
Java package name that the R class for this target belongs to.
Expand Down Expand Up @@ -678,6 +677,10 @@ def DepsOfType(wanted_type, configs):
return [c for c in configs if c['type'] == wanted_type]


def DepPathsOfType(wanted_type, config_paths):
return [p for p in config_paths if GetDepConfig(p)['type'] == wanted_type]


def GetAllDepsConfigsInOrder(deps_config_paths, filter_func=None):
def GetDeps(path):
config = GetDepConfig(path)
Expand Down Expand Up @@ -808,17 +811,22 @@ def create_list(asset_map):
return create_list(compressed), create_list(uncompressed), locale_paks


def _ResolveGroups(configs):
def _ResolveGroups(config_paths):
"""Returns a list of configs with all groups inlined."""
ret = list(configs)
ret = list(config_paths)
ret_set = set(config_paths)
while True:
groups = DepsOfType('group', ret)
if not groups:
group_paths = DepPathsOfType('group', ret)
if not group_paths:
return ret
for config in groups:
index = ret.index(config)
expanded_configs = [GetDepConfig(p) for p in config['deps_configs']]
ret[index:index + 1] = expanded_configs
for group_path in group_paths:
index = ret.index(group_path)
expanded_config_paths = []
for deps_config_path in GetDepConfig(group_path)['deps_configs']:
if not deps_config_path in ret_set:
expanded_config_paths.append(deps_config_path)
ret[index:index + 1] = expanded_config_paths
ret_set.update(expanded_config_paths)


def _DepsFromPaths(dep_paths,
Expand Down Expand Up @@ -872,10 +880,11 @@ def _DepsFromPathsWithFilters(dep_paths, blocklist=None, allowlist=None):
about (i.e. we wish to prune all other branches that do not start from one of
these).
"""
configs = [GetDepConfig(p) for p in dep_paths]
groups = DepsOfType('group', configs)
configs = _ResolveGroups(configs)
configs += groups
group_paths = DepPathsOfType('group', dep_paths)
config_paths = dep_paths
if group_paths:
config_paths = _ResolveGroups(dep_paths) + group_paths
configs = [GetDepConfig(p) for p in config_paths]
if blocklist:
configs = [c for c in configs if c['type'] not in blocklist]
if allowlist:
Expand Down
1 change: 1 addition & 0 deletions build/android/pylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import absolute_import
import os
import sys

Expand Down
1 change: 1 addition & 0 deletions build/android/pylib/android/logcat_symbolizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import absolute_import
import re

from devil.android import logcat_monitor
Expand Down
Loading

0 comments on commit d313a5a

Please sign in to comment.