diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-31 16:33:43 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-06 16:33:22 +0000 |
commit | da51f56cc21233c2d30f0fe0d171727c3102b2e0 (patch) | |
tree | 4e579ab70ce4b19bee7984237f3ce05a96d59d83 /chromium/build | |
parent | c8c2d1901aec01e934adf561a9fdf0cc776cdef8 (diff) | |
download | qtwebengine-chromium-da51f56cc21233c2d30f0fe0d171727c3102b2e0.tar.gz |
BASELINE: Update Chromium to 65.0.3525.40
Also imports missing submodules
Change-Id: I36901b7c6a325cda3d2c10cedb2186c25af3b79b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/build')
120 files changed, 3869 insertions, 4292 deletions
diff --git a/chromium/build/android/BUILD.gn b/chromium/build/android/BUILD.gn index b07bf34d82c..dd501338b66 100644 --- a/chromium/build/android/BUILD.gn +++ b/chromium/build/android/BUILD.gn @@ -34,7 +34,9 @@ if (enable_java_templates) { java_prebuilt("sun_tools_java") { jar_path = sun_tools_jar_path - jar_dep = ":find_sun_tools_jar" + deps = [ + ":find_sun_tools_jar", + ] } generate_interface_jar("android_ijar") { diff --git a/chromium/build/android/apk_operations.py b/chromium/build/android/apk_operations.py index 70c132ad660..f3d4a20f7ff 100755 --- a/chromium/build/android/apk_operations.py +++ b/chromium/build/android/apk_operations.py @@ -108,9 +108,9 @@ def _LaunchUrl(devices, package_name, argv=None, command_line_flags_file=None, debug_process_name = _NormalizeProcessName(debug_process_name, package_name) def launch(device): - # Set debug app in order to enable reading command line flags on user - # builds. - cmd = ['am', 'set-debug-app', debug_process_name] + # --persistent is required to have Settings.Global.DEBUG_APP be set, which + # we currently use to allow reading of flags. https://crbug.com/784947 + cmd = ['am', 'set-debug-app', '--persistent', debug_process_name] if wait_for_java_debugger: cmd[-1:-1] = ['-w'] # Ignore error since it will fail if apk is not debuggable. diff --git a/chromium/build/android/avd.py b/chromium/build/android/avd.py deleted file mode 100755 index 788ceaf053a..00000000000 --- a/chromium/build/android/avd.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Launches Android Virtual Devices with a set configuration for testing Chrome. - -The script will launch a specified number of Android Virtual Devices (AVD's). -""" - -import argparse -import logging -import os -import re -import sys - -import devil_chromium -import install_emulator_deps - -from devil.utils import cmd_helper -from pylib import constants -from pylib.utils import emulator - -def main(argv): - # ANDROID_SDK_ROOT needs to be set to the location of the SDK used to launch - # the emulator to find the system images upon launch. - emulator_sdk = constants.ANDROID_SDK_ROOT - os.environ['ANDROID_SDK_ROOT'] = emulator_sdk - - arg_parser = argparse.ArgumentParser(description='AVD script.') - sub_parsers = arg_parser.add_subparsers(title='subparser', dest='command') - sub_parsers.add_parser( - 'kill', help='Shutdown all existing emulators') - sub_parsers.add_parser( - 'delete', help='Deleting all the avd files') - wait_parser = sub_parsers.add_parser( - 'wait', help='Wait for emulators to finish booting') - wait_parser.add_argument('-n', '--num', dest='wait_num', - help='Number of emulators to wait for', type=int, - default=1) - run_parser = sub_parsers.add_parser('run', help='Run emulators') - run_parser.add_argument('--name', help='Optinaly, name of existing AVD to ' - 'launch. If not specified, AVD\'s will be created') - run_parser.add_argument('-n', '--num', dest='emulator_count', - help='Number of emulators to launch (default is 1).', - type=int, default='1') - run_parser.add_argument('--abi', default='x86', - help='Platform of emulators to launch (x86 default)') - run_parser.add_argument('--api-level', dest='api_level', - help='API level for the image', - type=int, default=constants.ANDROID_SDK_VERSION) - run_parser.add_argument('--sdcard-size', dest='sdcard_size', - default=emulator.DEFAULT_SDCARD_SIZE, - help='Set sdcard size of the emulators' - ' e.g. --sdcard-size=512M') - run_parser.add_argument('--partition-size', dest='partition_size', - default=emulator.DEFAULT_STORAGE_SIZE, - help='Default internal storage size' - ' e.g. --partition-size=1024M') - run_parser.add_argument('--launch-without-kill', action='store_false', - dest='kill_and_launch', default=True, - help='Kill all emulators at launch') - run_parser.add_argument('--enable-kvm', action='store_true', - dest='enable_kvm', default=False, - help='Enable kvm for faster x86 emulator run') - run_parser.add_argument('--headless', action='store_true', - dest='headless', default=False, - help='Launch an emulator with no UI.') - - arguments = arg_parser.parse_args(argv[1:]) - - logging.root.setLevel(logging.INFO) - - devil_chromium.Initialize() - - if arguments.command == 'kill': - logging.info('Killing all existing emulator and existing the program') - emulator.KillAllEmulators() - elif arguments.command == 'delete': - emulator.DeleteAllTempAVDs() - elif arguments.command == 'wait': - emulator.WaitForEmulatorLaunch(arguments.wait_num) - else: - # Check if SDK exist in ANDROID_SDK_ROOT - if not install_emulator_deps.CheckSDK(): - raise Exception('Emulator SDK not installed in %s' - % constants.ANDROID_SDK_ROOT) - - # Check if KVM is enabled for x86 AVD - if arguments.abi == 'x86': - if not install_emulator_deps.CheckKVM(): - logging.warning('KVM is not installed or enabled') - arguments.enable_kvm = False - - # Check if targeted system image exist - if not install_emulator_deps.CheckSystemImage(arguments.abi, - arguments.api_level): - logging.critical('ERROR: System image for %s AVD not installed. Run ' - 'install_emulator_deps.py', arguments.abi) - return 1 - - # If AVD is specified, check that the SDK has the required target. If not, - # check that the SDK has the desired target for the temporary AVD's. - api_level = arguments.api_level - if arguments.name: - android = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', - 'android') - avds_output = cmd_helper.GetCmdOutput([android, 'list', 'avd']) - names = re.findall(r'Name: (\w+)', avds_output) - api_levels = re.findall(r'API level (\d+)', avds_output) - try: - avd_index = names.index(arguments.name) - except ValueError: - logging.critical('ERROR: Specified AVD %s does not exist.', - arguments.name) - return 1 - api_level = int(api_levels[avd_index]) - - if not install_emulator_deps.CheckSDKPlatform(api_level): - logging.critical('ERROR: Emulator SDK missing required target for API %d.' - ' Run install_emulator_deps.py.') - return 1 - - if arguments.name: - emulator.LaunchEmulator( - arguments.name, - arguments.abi, - enable_kvm=arguments.enable_kvm, - kill_and_launch=arguments.reset_and_launch, - sdcard_size=arguments.sdcard_size, - storage_size=arguments.partition_size, - headless=arguments.headless - ) - else: - emulator.LaunchTempEmulators( - arguments.emulator_count, - arguments.abi, - arguments.api_level, - enable_kvm=arguments.enable_kvm, - kill_and_launch=arguments.kill_and_launch, - sdcard_size=arguments.sdcard_size, - storage_size=arguments.partition_size, - wait_for_boot=True, - headless=arguments.headless - ) - logging.info('Emulator launch completed') - return 0 - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/chromium/build/android/binary_size/apk_downloader.py b/chromium/build/android/binary_size/apk_downloader.py index b0787d8ed63..132325bc5b0 100755 --- a/chromium/build/android/binary_size/apk_downloader.py +++ b/chromium/build/android/binary_size/apk_downloader.py @@ -20,7 +20,7 @@ import find_depot_tools # pylint: disable=import-error,unused-import import download_from_google_storage import upload_to_google_storage -CURRENT_MILESTONE = '63' +CURRENT_MILESTONE = '64' DEFAULT_BUCKET = 'gs://chromium-android-tools/apks' DEFAULT_DOWNLOAD_PATH = os.path.join(os.path.dirname(__file__), 'apks') DEFAULT_BUILDER = 'Android_Builder' diff --git a/chromium/build/android/binary_size/apks/Android_Builder/64/ChromeModernPublic.apk.sha1 b/chromium/build/android/binary_size/apks/Android_Builder/64/ChromeModernPublic.apk.sha1 new file mode 100644 index 00000000000..92e9519e369 --- /dev/null +++ b/chromium/build/android/binary_size/apks/Android_Builder/64/ChromeModernPublic.apk.sha1 @@ -0,0 +1 @@ +98af8f2265f68dea89eecd1d93410fd36bf233c4
\ No newline at end of file diff --git a/chromium/build/android/binary_size/apks/Android_Builder/64/ChromePublic.apk.sha1 b/chromium/build/android/binary_size/apks/Android_Builder/64/ChromePublic.apk.sha1 new file mode 100644 index 00000000000..7bbf28ae224 --- /dev/null +++ b/chromium/build/android/binary_size/apks/Android_Builder/64/ChromePublic.apk.sha1 @@ -0,0 +1 @@ +d5c209e967fa2f6b98fd4e3d6882a85ad67a9d87
\ No newline at end of file diff --git a/chromium/build/android/binary_size/apks/Android_Builder/64/MonochromePublic.apk.sha1 b/chromium/build/android/binary_size/apks/Android_Builder/64/MonochromePublic.apk.sha1 new file mode 100644 index 00000000000..123d071a52d --- /dev/null +++ b/chromium/build/android/binary_size/apks/Android_Builder/64/MonochromePublic.apk.sha1 @@ -0,0 +1 @@ +a5059a9bbe1dd9b6750bee7c2728a366bf9864e9
\ No newline at end of file diff --git a/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromeModernPublic.apk.sha1 b/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromeModernPublic.apk.sha1 new file mode 100644 index 00000000000..e0df57bb819 --- /dev/null +++ b/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromeModernPublic.apk.sha1 @@ -0,0 +1 @@ +3e4b8fd75aea0a22fa769c6686dd153d72741e91
\ No newline at end of file diff --git a/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromePublic.apk.sha1 b/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromePublic.apk.sha1 new file mode 100644 index 00000000000..e65c26f9abf --- /dev/null +++ b/chromium/build/android/binary_size/apks/Android_arm64_Builder/64/ChromePublic.apk.sha1 @@ -0,0 +1 @@ +b7b222a6650e98dda980dd9bc922763e4102d0b6
\ No newline at end of file diff --git a/chromium/build/android/binary_size/apks/README.md b/chromium/build/android/binary_size/apks/README.md index b09596881df..e651ed701cf 100644 --- a/chromium/build/android/binary_size/apks/README.md +++ b/chromium/build/android/binary_size/apks/README.md @@ -39,3 +39,4 @@ build/android/binary_size/apk_downloader.py --update 63 508578 --update 62 49918 * [M61](https://crrev.com/488528) * [M62](https://crrev.com/499187) * [M63](https://crrev.com/508578) + * [M64](https://crrev.com/520840) diff --git a/chromium/build/android/buildhooks/BUILD.gn b/chromium/build/android/buildhooks/BUILD.gn index e4c708a8799..6500914319a 100644 --- a/chromium/build/android/buildhooks/BUILD.gn +++ b/chromium/build/android/buildhooks/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/android/rules.gni") import("//build/config/android/config.gni") java_library("build_hooks_java") { + emma_never_instrument = true java_files = [ "java/org/chromium/build/BuildHooks.java" ] # Make all targets pull in the try-with-resources support files. @@ -34,6 +35,7 @@ java_cpp_template("base_build_hooks_config") { build_hooks_android_impl = "java/org/chromium/build/BuildHooksAndroidImpl.java" android_library("build_hooks_android_java") { + emma_never_instrument = true java_files = [ "java/org/chromium/build/BuildHooksAndroid.java", build_hooks_android_impl, @@ -46,6 +48,7 @@ android_library("build_hooks_android_java") { # This default implementation is used if an android_apk target doesn't # specify a different implementation via build_hooks_android_impl_deps. android_library("build_hooks_android_impl_java") { + emma_never_instrument = true java_files = [ build_hooks_android_impl ] deps = [ ":build_hooks_android_java", diff --git a/chromium/build/android/buildhooks/OWNERS b/chromium/build/android/buildhooks/OWNERS index a512a5a43d3..c964495a78c 100644 --- a/chromium/build/android/buildhooks/OWNERS +++ b/chromium/build/android/buildhooks/OWNERS @@ -1,5 +1,4 @@ agrieve@chromium.org estevenson@chromium.org -zpeng@chromium.org # COMPONENT: Build diff --git a/chromium/build/android/bytecode/BUILD.gn b/chromium/build/android/bytecode/BUILD.gn index 3a2069019c4..3e10b8d6c0a 100644 --- a/chromium/build/android/bytecode/BUILD.gn +++ b/chromium/build/android/bytecode/BUILD.gn @@ -7,6 +7,7 @@ import("//build/config/android/rules.gni") assert(current_toolchain == default_toolchain) java_binary("java_bytecode_rewriter") { + emma_never_instrument = true java_files = [ "java/org/chromium/bytecode/AssertionEnablerClassAdapter.java", "java/org/chromium/bytecode/ByteCodeProcessor.java", diff --git a/chromium/build/android/bytecode/OWNERS b/chromium/build/android/bytecode/OWNERS index a512a5a43d3..c964495a78c 100644 --- a/chromium/build/android/bytecode/OWNERS +++ b/chromium/build/android/bytecode/OWNERS @@ -1,5 +1,4 @@ agrieve@chromium.org estevenson@chromium.org -zpeng@chromium.org # COMPONENT: Build diff --git a/chromium/build/android/gradle/android.jinja b/chromium/build/android/gradle/android.jinja index 2fa40d1d880..3fad6516cc2 100644 --- a/chromium/build/android/gradle/android.jinja +++ b/chromium/build/android/gradle/android.jinja @@ -70,8 +70,13 @@ android { {{ expand_sourceset(main, 'main') }} {{ expand_sourceset(test, 'test') }} -{{ expand_sourceset(android_test, 'androidTest') }} + +{% if android_test is defined %} +{% for t in android_test %} +{{ expand_sourceset(t, 'androidTest') }} +{% endfor %} } +{% endif %} defaultConfig { vectorDrawables.useSupportLibrary = true diff --git a/chromium/build/android/gradle/generate_gradle.py b/chromium/build/android/gradle/generate_gradle.py index 74be0df517c..e6a8906009d 100755 --- a/chromium/build/android/gradle/generate_gradle.py +++ b/chromium/build/android/gradle/generate_gradle.py @@ -7,6 +7,7 @@ import argparse import codecs +import collections import glob import logging import os @@ -151,7 +152,7 @@ class _ProjectEntry(object): self._build_config = None self._java_files = None self._all_entries = None - self.android_test_entry = None + self.android_test_entries = None @classmethod def FromGnTarget(cls, gn_target): @@ -550,7 +551,7 @@ def _GenerateGradleFile(entry, generator, build_vars, source_properties, target_type = 'java_library' elif deps_info['type'] == 'java_binary': target_type = 'java_binary' - variables['main_class'] = gradle['main_class'] + variables['main_class'] = deps_info.get('main_class') elif deps_info['type'] == 'junit_binary': target_type = 'android_junit' variables['sourceSetName'] = 'test' @@ -565,13 +566,14 @@ def _GenerateGradleFile(entry, generator, build_vars, source_properties, if bootclasspath: # Must use absolute path here. variables['bootclasspath'] = _RebasePath(bootclasspath) - if entry.android_test_entry: - variables['android_test'] = generator.Generate( - entry.android_test_entry) - for key, value in variables['android_test'].iteritems(): - if isinstance(value, list): - variables['android_test'][key] = sorted( - set(value) - set(variables['main'][key])) + if entry.android_test_entries: + variables['android_test'] = [] + for e in entry.android_test_entries: + test_entry = generator.Generate(e) + variables['android_test'].append(test_entry) + for key, value in test_entry.iteritems(): + if isinstance(value, list): + test_entry[key] = sorted(set(value) - set(variables['main'][key])) return jinja_processor.Render( _TemplatePath(target_type.split('_')[0]), variables) @@ -607,10 +609,10 @@ def _GenerateModuleAll(gradle_output_dir, generator, build_vars, 'java_excludes': ['**/*.java'], 'res_dirs': Relativize(res_dirs), } - variables['android_test'] = { + variables['android_test'] = [{ 'java_dirs': Relativize(test_java_dirs), 'java_excludes': ['**/*.java'], - } + }] data = jinja_processor.Render( _TemplatePath(target_type.split('_')[0]), variables) _WriteFile( @@ -685,22 +687,22 @@ def _CombineTestEntries(entries): - e.g. base_junit_tests > base_junit_test_support > base_java """ combined_entries = [] - android_test_entries = {} + android_test_entries = collections.defaultdict(list) for entry in entries: target_name = entry.GnTarget() if (target_name.endswith('_test_apk__apk') and 'apk_under_test' in entry.Gradle()): apk_name = entry.Gradle()['apk_under_test'] - android_test_entries[apk_name] = entry + android_test_entries[apk_name].append(entry) else: combined_entries.append(entry) for entry in combined_entries: target_name = entry.DepsInfo()['name'] if target_name in android_test_entries: - entry.android_test_entry = android_test_entries[target_name] + entry.android_test_entries = android_test_entries[target_name] del android_test_entries[target_name] # Add unmatched test entries as individual targets. - combined_entries.extend(android_test_entries.values()) + combined_entries.extend(e for l in android_test_entries.values() for e in l) return combined_entries @@ -744,6 +746,23 @@ def main(): action='store_true', help='Generate a project that is compatible with ' 'Android Studio 3.1 Canary.') + sdk_group = parser.add_mutually_exclusive_group() + sdk_group.add_argument('--sdk', + choices=['AndroidStudioCurrent', + 'AndroidStudioDefault', + 'ChromiumSdkRoot'], + default='ChromiumSdkRoot', + help="Set the project's SDK root. This can be set to " + "Android Studio's current SDK root, the default " + "Android Studio SDK root, or Chromium's SDK " + "root. The default is Chromium's SDK root, but " + "using this means that updates and additions to " + "the SDK (e.g. installing emulators), will " + "modify this root, hence possibly causing " + "conflicts on the next repository sync.") + sdk_group.add_argument('--sdk-path', + help='An explict path for the SDK root, setting this ' + 'is an alternative to setting the --sdk option') args = parser.parse_args() if args.output_directory: constants.SetOutputDirectory(args.output_directory) @@ -768,7 +787,11 @@ def main(): args.canary) logging.warning('Creating project at: %s', generator.project_dir) - args.all = args.all or not args.split_projects + # Generate for "all targets" by default when not using --split-projects (too + # slow), and when no --target has been explicitly set. "all targets" means all + # java targets that are depended on by an apk or java_binary (leaf + # java_library targets will not be included). + args.all = args.all or (not args.split_projects and not args.targets) targets_from_args = set(args.targets or _DEFAULT_TARGETS) if args.extra_targets: @@ -840,9 +863,15 @@ def main(): _WriteFile(os.path.join(generator.project_dir, 'settings.gradle'), _GenerateSettingsGradle(project_entries, add_all_module)) - sdk_path = _RebasePath(build_vars['android_sdk_root']) - _WriteFile(os.path.join(generator.project_dir, 'local.properties'), - _GenerateLocalProperties(sdk_path)) + if args.sdk != "AndroidStudioCurrent": + if args.sdk_path: + sdk_path = _RebasePath(args.sdk_path) + elif args.sdk == "AndroidStudioDefault": + sdk_path = os.path.expanduser('~/Android/Sdk') + else: + sdk_path = _RebasePath(build_vars['android_sdk_root']) + _WriteFile(os.path.join(generator.project_dir, 'local.properties'), + _GenerateLocalProperties(sdk_path)) if generated_inputs: logging.warning('Building generated source files...') diff --git a/chromium/build/android/gradle/java.jinja b/chromium/build/android/gradle/java.jinja index b649149ad57..92fe575af85 100644 --- a/chromium/build/android/gradle/java.jinja +++ b/chromium/build/android/gradle/java.jinja @@ -29,8 +29,10 @@ sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 {% if template_type == 'java_binary' %} -mainClassName = "{{ main_class }}" applicationName = "{{ target_name }}" +{% if main_class %} +mainClassName = "{{ main_class }}" +{% endif %} {% endif %} {% if template_type in ('java_binary', 'java_library') %} archivesBaseName = "{{ target_name }}" diff --git a/chromium/build/android/gradle/root.jinja b/chromium/build/android/gradle/root.jinja index 76b04469efb..d3a259f7397 100644 --- a/chromium/build/android/gradle/root.jinja +++ b/chromium/build/android/gradle/root.jinja @@ -12,7 +12,7 @@ buildscript { } dependencies { {% if canary %} - classpath "com.android.tools.build:gradle:3.1.0-alpha01" + classpath "com.android.tools.build:gradle:3.1.0-alpha04" {% else %} classpath "com.android.tools.build:gradle:3.0.0" {% endif %} diff --git a/chromium/build/android/gyp/apkbuilder.py b/chromium/build/android/gyp/apkbuilder.py index 8afd6b0cf92..1aadf2b2290 100755 --- a/chromium/build/android/gyp/apkbuilder.py +++ b/chromium/build/android/gyp/apkbuilder.py @@ -193,10 +193,6 @@ def _MergePakInfoFiles(pak_info_path, asset_list): if src.endswith('.pak'): with open(src + '.info', 'r') as src_info_file: lines.update(src_info_file.readlines()) - # Ensure that parent dirs exist before writing new files. - info_dir = os.path.dirname(pak_info_path) - if not os.path.exists(info_dir): - os.makedirs(info_dir) with open(pak_info_path, 'w') as merged_info_file: merged_info_file.writelines(sorted(lines)) diff --git a/chromium/build/android/gyp/create_dist_jar.py b/chromium/build/android/gyp/create_dist_jar.py index 2206cc64ae9..2e06478fae8 100755 --- a/chromium/build/android/gyp/create_dist_jar.py +++ b/chromium/build/android/gyp/create_dist_jar.py @@ -6,24 +6,21 @@ """Merges a list of jars into a single jar.""" -import optparse +import argparse import sys from util import build_utils + def main(args): args = build_utils.ExpandFileArgs(args) - parser = optparse.OptionParser() + parser = argparse.ArgumentParser() build_utils.AddDepfileOption(parser) - parser.add_option('--output', help='Path to output jar.') - parser.add_option('--inputs', action='append', help='List of jar inputs.') - options, _ = parser.parse_args(args) - build_utils.CheckOptions(options, parser, ['output', 'inputs']) - - input_jars = [] - for inputs_arg in options.inputs: - input_jars.extend(build_utils.ParseGnList(inputs_arg)) + parser.add_argument('--output', required=True, help='Path to output jar.') + parser.add_argument('--jars', required=True, help='GN list of jar inputs.') + options = parser.parse_args(args) + input_jars = build_utils.ParseGnList(options.jars) build_utils.MergeZips(options.output, input_jars) if options.depfile: @@ -31,4 +28,4 @@ def main(args): if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) + main(sys.argv[1:]) diff --git a/chromium/build/android/gyp/create_java_binary_script.py b/chromium/build/android/gyp/create_java_binary_script.py index 3bde1c334ed..141b1752c14 100755 --- a/chromium/build/android/gyp/create_java_binary_script.py +++ b/chromium/build/android/gyp/create_java_binary_script.py @@ -69,7 +69,6 @@ def main(argv): parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) parser.add_option('--output', help='Output path for executable script.') - parser.add_option('--jar-path', help='Path to the main jar.') parser.add_option('--main-class', help='Name of the java class with the "main" entry point.') parser.add_option('--classpath', action='append', default=[], @@ -86,7 +85,7 @@ def main(argv): else: noverify_flag = '' - classpath = [options.jar_path] + classpath = [] for cp_arg in options.classpath: classpath += build_utils.ParseGnList(cp_arg) diff --git a/chromium/build/android/gyp/dist_aar.py b/chromium/build/android/gyp/dist_aar.py new file mode 100755 index 00000000000..51515fa6510 --- /dev/null +++ b/chromium/build/android/gyp/dist_aar.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Creates an Android .aar file.""" + +import argparse +import os +import posixpath +import shutil +import sys +import tempfile +import zipfile + +from util import build_utils + + +_ANDROID_BUILD_DIR = os.path.dirname(os.path.dirname(__file__)) + + +def _MergeRTxt(r_paths): + """Merging the given R.txt files and returns them as a string.""" + all_lines = set() + for r_path in r_paths: + with open(r_path) as f: + all_lines.update(f.readlines()) + return ''.join(sorted(all_lines)) + + +def _MergeProguardConfigs(proguard_configs): + """Merging the given proguard config files and returns them as a string.""" + ret = [] + for config in proguard_configs: + ret.append('# FROM: {}'.format(config)) + with open(config) as f: + ret.append(f.read()) + return '\n'.join(ret) + + +def _AddResources(aar_zip, resource_zips): + """Adds all resource zips to the given aar_zip. + + Ensures all res/values/* files have unique names by prefixing them. + """ + for i, path in enumerate(resource_zips): + with zipfile.ZipFile(path) as res_zip: + for info in res_zip.infolist(): + data = res_zip.read(info) + dirname, basename = posixpath.split(info.filename) + if 'values' in dirname: + basename = '{}_{}'.format(basename, i) + info.filename = posixpath.join(dirname, basename) + info.filename = posixpath.join('res', info.filename) + aar_zip.writestr(info, data) + + +def main(args): + args = build_utils.ExpandFileArgs(args) + parser = argparse.ArgumentParser() + build_utils.AddDepfileOption(parser) + parser.add_argument('--output', required=True, help='Path to output aar.') + parser.add_argument('--jars', required=True, help='GN list of jar inputs.') + parser.add_argument('--dependencies-res-zips', required=True, + help='GN list of resource zips') + parser.add_argument('--r-text-files', required=True, + help='GN list of R.txt files to merge') + parser.add_argument('--proguard-configs', required=True, + help='GN list of ProGuard flag files to merge.') + parser.add_argument( + '--android-manifest', + help='Path to AndroidManifest.xml to include.', + default=os.path.join(_ANDROID_BUILD_DIR, 'AndroidManifest.xml')) + + options = parser.parse_args(args) + options.jars = build_utils.ParseGnList(options.jars) + options.dependencies_res_zips = build_utils.ParseGnList( + options.dependencies_res_zips) + options.r_text_files = build_utils.ParseGnList(options.r_text_files) + options.proguard_configs = build_utils.ParseGnList(options.proguard_configs) + + with tempfile.NamedTemporaryFile(delete=False) as staging_file: + try: + with zipfile.ZipFile(staging_file.name, 'w') as z: + build_utils.AddToZipHermetic( + z, 'AndroidManifest.xml', src_path=options.android_manifest) + + with tempfile.NamedTemporaryFile() as jar_file: + build_utils.MergeZips(jar_file.name, options.jars) + build_utils.AddToZipHermetic(z, 'classes.jar', src_path=jar_file.name) + + build_utils.AddToZipHermetic( + z, 'R.txt', data=_MergeRTxt(options.r_text_files)) + build_utils.AddToZipHermetic(z, 'public.txt', data='') + + if options.proguard_configs: + build_utils.AddToZipHermetic( + z, 'proguard.txt', + data=_MergeProguardConfigs(options.proguard_configs)) + + _AddResources(z, options.dependencies_res_zips) + except: + os.unlink(staging_file.name) + raise + shutil.move(staging_file.name, options.output) + + if options.depfile: + all_inputs = (options.jars + options.dependencies_res_zips + + options.r_text_files + options.proguard_configs) + build_utils.WriteDepfile(options.depfile, options.output, all_inputs) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/chromium/build/android/gyp/javac.py b/chromium/build/android/gyp/javac.py index 48512ab4860..4ad1d35ce3c 100755 --- a/chromium/build/android/gyp/javac.py +++ b/chromium/build/android/gyp/javac.py @@ -10,7 +10,6 @@ import os import shutil import re import sys -import textwrap from util import build_utils from util import md5_check @@ -21,6 +20,71 @@ sys.path.append(build_utils.COLORAMA_ROOT) import colorama +ERRORPRONE_WARNINGS_TO_TURN_OFF = [ + # TODO(crbug.com/801208): Follow steps in bug. + 'FloatingPointLiteralPrecision', + # TODO(crbug.com/801210): Follow steps in bug. + 'SynchronizeOnNonFinalField', + # TODO(crbug.com/801253): Follow steps in bug. + 'JavaLangClash', + # TODO(crbug.com/801256): Follow steps in bug. + 'ParameterName', + # TODO(crbug.com/801261): Follow steps in bug + 'ArgumentSelectionDefectChecker', + # TODO(crbug.com/801268): Follow steps in bug. + 'NarrowingCompoundAssignment', + # TODO(crbug.com/802073): Follow steps in bug. + 'TypeParameterUnusedInFormals', + # TODO(crbug.com/802075): Follow steps in bug + 'ReferenceEquality', + # Android platform default is always UTF-8. + # https://developer.android.com/reference/java/nio/charset/Charset.html#defaultCharset() + 'DefaultCharset', + # Low priority since the alternatives still work. + 'JdkObsolete', + # We don't use that many lambdas. + 'FunctionalInterfaceClash', + # There are lots of times when we just want to post a task. + 'FutureReturnValueIgnored', + # Nice to be explicit about operators, but not necessary. + 'OperatorPrecedence', + # Just false positives in our code. + 'ThreadJoinLoop', + # Alias of ParameterName warning. + 'NamedParameters', + # Low priority corner cases with String.split. + 'StringSplitter', + # Preferred to use another method since it propagates exceptions better. + 'ClassNewInstance', + # Nice to have static inner classes but not necessary. + 'ClassCanBeStatic', + # Explicit is better than implicit. + 'FloatCast', + # Results in false positives. + 'ThreadLocalUsage', + # Also just false positives. + 'Finally', + # False positives for Chromium. + 'FragmentNotInstantiable', + # Low priority to fix. + 'HidingField', + # Low priority. + 'IntLongMath', + # Low priority. + 'BadComparable', + # Low priority. + 'EqualsHashCode', + # Nice to fix but low priority. + 'TypeParameterShadowing', + # Good to have immutable enums, also low priority. + 'ImmutableEnumChecker', +] + +ERRORPRONE_WARNINGS_TO_ERROR = [ + # Add warnings to this after fixing/suppressing all instances in our codebase. +] + + def ColorJavacOutput(output): fileline_prefix = r'(?P<fileline>(?P<file>[-.\w/\\]+.java):(?P<line>[0-9]+):)' warning_re = re.compile( @@ -54,14 +118,6 @@ def ColorJavacOutput(output): return '\n'.join(map(ApplyColor, output.split('\n'))) -def _FilterJavaFiles(paths, filters): - return [f for f in paths - if not filters or build_utils.MatchesGlob(f, filters)] - - -_MAX_MANIFEST_LINE_LEN = 72 - - def _ExtractClassFiles(jar_path, dest_dir, java_files): """Extracts all .class files not corresponding to |java_files|.""" # Two challenges exist here: @@ -148,7 +204,8 @@ def _CheckPathMatchesClassName(java_file): (java_file, expected_path_suffix)) -def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): +def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs, + classpath): incremental = options.incremental # Don't bother enabling incremental compilation for third_party code, since # _CheckPathMatchesClassName() fails on some of it, and it's not really much @@ -161,9 +218,6 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): with build_utils.TempDir() as temp_dir: srcjars = options.java_srcjars - # The .excluded.jar contains .class files excluded from the main jar. - # It is used for incremental compiles. - excluded_jar_path = options.jar_path.replace('.jar', '.excluded.jar') classes_dir = os.path.join(temp_dir, 'classes') os.makedirs(classes_dir) @@ -206,7 +260,6 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): for f in changes.IterChangedSubpaths(srcjar)) build_utils.ExtractAll(srcjar, path=java_dir, pattern='*.java') jar_srcs = build_utils.FindInDirectory(java_dir, '*.java') - jar_srcs = _FilterJavaFiles(jar_srcs, options.javac_includes) java_files.extend(jar_srcs) if changed_paths: # Set the mtime of all sources to 0 since we use the absence of .class @@ -219,13 +272,10 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): changed_java_files = [p for p in java_files if p in changed_paths] if os.path.exists(options.jar_path): _ExtractClassFiles(options.jar_path, classes_dir, changed_java_files) - if os.path.exists(excluded_jar_path): - _ExtractClassFiles(excluded_jar_path, classes_dir, changed_java_files) # Add the extracted files to the classpath. This is required because # when compiling only a subset of files, classes that haven't changed # need to be findable. - classpath_idx = javac_cmd.index('-classpath') - javac_cmd[classpath_idx + 1] += ':' + classes_dir + classpath.append(classes_dir) # Can happen when a target goes from having no sources, to having sources. # It's created by the call to build_utils.Touch() below. @@ -235,7 +285,20 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): # Don't include the output directory in the initial set of args since it # being in a temp dir makes it unstable (breaks md5 stamping). - cmd = javac_cmd + ['-d', classes_dir] + java_files + cmd = javac_cmd + ['-d', classes_dir] + + # Pass classpath and source paths as response files to avoid extremely + # long command lines that are tedius to debug. + if classpath: + classpath_rsp_path = os.path.join(temp_dir, 'classpath.txt') + with open(classpath_rsp_path, 'w') as f: + f.write(':'.join(classpath)) + cmd += ['-classpath', '@' + classpath_rsp_path] + + java_files_rsp_path = os.path.join(temp_dir, 'files_list.txt') + with open(java_files_rsp_path, 'w') as f: + f.write(' '.join(java_files)) + cmd += ['@' + java_files_rsp_path] # JMake prints out some diagnostic logs that we want to ignore. # This assumes that all compiler output goes through stderr. @@ -263,30 +326,24 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs): # Make sure output exists. build_utils.Touch(pdb_path) - glob = options.jar_excluded_classes - inclusion_predicate = lambda f: not build_utils.MatchesGlob(f, glob) - exclusion_predicate = lambda f: not inclusion_predicate(f) - jar.JarDirectory(classes_dir, options.jar_path, - predicate=inclusion_predicate, - provider_configurations=options.provider_configurations, - additional_files=options.additional_jar_files) - jar.JarDirectory(classes_dir, - excluded_jar_path, - predicate=exclusion_predicate, provider_configurations=options.provider_configurations, additional_files=options.additional_jar_files) +def _ParseAndFlattenGnLists(gn_lists): + ret = [] + for arg in gn_lists: + ret.extend(build_utils.ParseGnList(arg)) + return ret + + def _ParseOptions(argv): parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) parser.add_option( - '--src-gendirs', - help='Directories containing generated java files.') - parser.add_option( '--java-srcjars', action='append', default=[], @@ -303,30 +360,25 @@ def _ParseOptions(argv): parser.add_option( '--classpath', action='append', - help='Classpath for javac. If this is specified multiple times, they ' - 'will all be appended to construct the classpath.') + help='Classpath to use when annotation processors are present.') + parser.add_option( + '--interface-classpath', + action='append', + help='Classpath to use when no annotation processors are present.') parser.add_option( '--incremental', action='store_true', help='Whether to re-use .class files rather than recompiling them ' '(when possible).') parser.add_option( - '--javac-includes', - default='', - help='A list of file patterns. If provided, only java files that match' - 'one of the patterns will be compiled.') - parser.add_option( - '--jar-excluded-classes', - default='', - help='List of .class file patterns to exclude from the jar.') - parser.add_option( - '--processor', - dest='processors', + '--processors', action='append', - help='Annotation processor to use.') + help='GN list of annotation processor main classes.') parser.add_option( '--processorpath', - help='Where javac should look for annotation processors.') + action='append', + help='GN list of jars that comprise the classpath used for Annotation ' + 'Processors.') parser.add_option( '--processor-arg', dest='processor_args', @@ -354,7 +406,6 @@ def _ParseOptions(argv): '--use-errorprone-path', help='Use the Errorprone compiler at this path.') parser.add_option('--jar-path', help='Jar output path.') - parser.add_option('--stamp', help='Path to touch on success.') parser.add_option( '--javac-arg', action='append', @@ -364,10 +415,14 @@ def _ParseOptions(argv): options, args = parser.parse_args(argv) build_utils.CheckOptions(options, parser, required=('jar_path',)) - bootclasspath = [] - for arg in options.bootclasspath: - bootclasspath += build_utils.ParseGnList(arg) - options.bootclasspath = bootclasspath + options.bootclasspath = _ParseAndFlattenGnLists(options.bootclasspath) + options.classpath = _ParseAndFlattenGnLists(options.classpath) + options.interface_classpath = _ParseAndFlattenGnLists( + options.interface_classpath) + options.processorpath = _ParseAndFlattenGnLists(options.processorpath) + options.processors = _ParseAndFlattenGnLists(options.processors) + options.java_srcjars = _ParseAndFlattenGnLists(options.java_srcjars) + if options.java_version == '1.8' and options.bootclasspath: # Android's boot jar doesn't contain all java 8 classes. # See: https://github.com/evant/gradle-retrolambda/issues/23. @@ -379,29 +434,12 @@ def _ParseOptions(argv): rt_jar = os.path.join(jdk_dir, 'jre', 'lib', 'rt.jar') options.bootclasspath.append(rt_jar) - classpath = [] - for arg in options.classpath: - classpath += build_utils.ParseGnList(arg) - options.classpath = classpath - - java_srcjars = [] - for arg in options.java_srcjars: - java_srcjars += build_utils.ParseGnList(arg) - options.java_srcjars = java_srcjars - additional_jar_files = [] for arg in options.additional_jar_files or []: filepath, jar_filepath = arg.split(':') additional_jar_files.append((filepath, jar_filepath)) options.additional_jar_files = additional_jar_files - if options.src_gendirs: - options.src_gendirs = build_utils.ParseGnList(options.src_gendirs) - - options.javac_includes = build_utils.ParseGnList(options.javac_includes) - options.jar_excluded_classes = ( - build_utils.ParseGnList(options.jar_excluded_classes)) - java_files = [] for arg in args: # Interpret a path prefixed with @ as a file containing a list of sources. @@ -419,11 +457,6 @@ def main(argv): argv = build_utils.ExpandFileArgs(argv) options, java_files = _ParseOptions(argv) - if options.src_gendirs: - java_files += build_utils.FindInDirectories(options.src_gendirs, '*.java') - - java_files = _FilterJavaFiles(java_files, options.javac_includes) - if options.use_errorprone_path: javac_path = options.use_errorprone_path else: @@ -431,21 +464,20 @@ def main(argv): javac_cmd = [javac_path] javac_cmd.extend(( - '-g', - # Chromium only allows UTF8 source files. Being explicit avoids - # javac pulling a default encoding from the user's environment. - '-encoding', 'UTF-8', - # Make sure we do not pass an empty string to -classpath and -sourcepath. - '-classpath', ':'.join(options.classpath) or ':', - # Prevent compiler from compiling .java files not listed as inputs. - # See: http://blog.ltgt.net/most-build-tools-misuse-javac/ - '-sourcepath', ':', + '-g', + # Chromium only allows UTF8 source files. Being explicit avoids + # javac pulling a default encoding from the user's environment. + '-encoding', 'UTF-8', + # Prevent compiler from compiling .java files not listed as inputs. + # See: http://blog.ltgt.net/most-build-tools-misuse-javac/ + '-sourcepath', ':', )) - if options.bootclasspath: - javac_cmd.extend([ - '-bootclasspath', ':'.join(options.bootclasspath) - ]) + if options.use_errorprone_path: + for warning in ERRORPRONE_WARNINGS_TO_TURN_OFF: + javac_cmd.append('-Xep:{}:OFF'.format(warning)) + for warning in ERRORPRONE_WARNINGS_TO_ERROR: + javac_cmd.append('-Xep:{}:ERROR'.format(warning)) if options.java_version: javac_cmd.extend([ @@ -463,26 +495,27 @@ def main(argv): if options.processors: javac_cmd.extend(['-processor', ','.join(options.processors)]) + + if options.bootclasspath: + javac_cmd.extend(['-bootclasspath', ':'.join(options.bootclasspath)]) + + # Annotation processors crash when given interface jars. + active_classpath = ( + options.classpath if options.processors else options.interface_classpath) + classpath = [] + if active_classpath: + classpath.extend(active_classpath) + if options.processorpath: - javac_cmd.extend(['-processorpath', options.processorpath]) + javac_cmd.extend(['-processorpath', ':'.join(options.processorpath)]) if options.processor_args: for arg in options.processor_args: javac_cmd.extend(['-A%s' % arg]) javac_cmd.extend(options.javac_arg) - classpath_inputs = options.bootclasspath - if options.classpath: - if options.classpath[0].endswith('.interface.jar'): - classpath_inputs.extend(options.classpath) - else: - # TODO(agrieve): Remove this .TOC heuristic once GYP is no more. - for path in options.classpath: - if os.path.exists(path + '.TOC'): - classpath_inputs.append(path + '.TOC') - else: - classpath_inputs.append(path) - + classpath_inputs = (options.bootclasspath + options.interface_classpath + + options.processorpath) # GN already knows of java_files, so listing them just make things worse when # they change. depfile_deps = [javac_path] + classpath_inputs + options.java_srcjars @@ -490,7 +523,6 @@ def main(argv): output_paths = [ options.jar_path, - options.jar_path.replace('.jar', '.excluded.jar'), ] if options.incremental: output_paths.append(options.jar_path + '.pdb') @@ -503,11 +535,11 @@ def main(argv): # of them does not change what gets written to the depsfile. build_utils.CallAndWriteDepfileIfStale( lambda changes: _OnStaleMd5(changes, options, javac_cmd, java_files, - classpath_inputs), + classpath_inputs, classpath), options, depfile_deps=depfile_deps, input_paths=input_paths, - input_strings=javac_cmd, + input_strings=javac_cmd + classpath, output_paths=output_paths, force=force, pass_changes=True) diff --git a/chromium/build/android/gyp/lint.py b/chromium/build/android/gyp/lint.py index 22d05061fba..2ad01c1be63 100755 --- a/chromium/build/android/gyp/lint.py +++ b/chromium/build/android/gyp/lint.py @@ -25,7 +25,7 @@ def _OnStaleMd5(lint_path, config_path, processed_config_path, manifest_path, result_path, product_dir, sources, jar_path, cache_dir, android_sdk_version, srcjars, resource_sources, disable=None, classpath=None, can_fail_build=False, - silent=False): + include_unexpected=False, silent=False): def _RebasePath(path): """Returns relative path to top-level src dir. @@ -173,9 +173,11 @@ def _OnStaleMd5(lint_path, config_path, processed_config_path, # Put the manifest in a temporary directory in order to avoid lint detecting # sibling res/ and src/ directories (which should be pass explicitly if they # are to be included). - if manifest_path: - os.symlink(os.path.abspath(manifest_path), - os.path.join(project_dir, 'AndroidManifest.xml')) + if not manifest_path: + manifest_path = os.path.join( + _SRC_ROOT, 'build', 'android', 'AndroidManifest.xml') + os.symlink(os.path.abspath(manifest_path), + os.path.join(project_dir, 'AndroidManifest.xml')) cmd.append(project_dir) if os.path.exists(result_path): @@ -191,9 +193,17 @@ def _OnStaleMd5(lint_path, config_path, processed_config_path, # We drop all lines that contain _JAVA_OPTIONS from the output stderr_filter = lambda l: re.sub(r'.*_JAVA_OPTIONS.*\n?', '', l) + def fail_func(returncode, stderr): + if returncode != 0: + return True + if (include_unexpected and + 'Unexpected failure during lint analysis' in stderr): + return True + return False + try: build_utils.CheckOutput(cmd, cwd=_SRC_ROOT, env=env or None, - stderr_filter=stderr_filter) + stderr_filter=stderr_filter, fail_func=fail_func) except build_utils.CalledProcessError: # There is a problem with lint usage if not os.path.exists(result_path): @@ -234,11 +244,14 @@ def _OnStaleMd5(lint_path, config_path, processed_config_path, raise _ProcessResultFile() - msg = ('\nLint found %d new issues.\n' - ' - For full explanation, please refer to %s\n' - ' - For more information about lint and how to fix lint issues,' - ' please refer to %s\n' % - (num_issues, _RebasePath(result_path), _LINT_MD_URL)) + if num_issues == 0 and include_unexpected: + msg = 'Please refer to output above for unexpected lint failures.\n' + else: + msg = ('\nLint found %d new issues.\n' + ' - For full explanation, please refer to %s\n' + ' - For more information about lint and how to fix lint issues,' + ' please refer to %s\n' % + (num_issues, _RebasePath(result_path), _LINT_MD_URL)) if not silent: print >> sys.stderr, msg if can_fail_build: @@ -269,6 +282,9 @@ def main(): parser.add_argument('--can-fail-build', action='store_true', help='If set, script will exit with nonzero exit status' ' if lint errors are present') + parser.add_argument('--include-unexpected-failures', action='store_true', + help='If set, script will exit with nonzero exit status' + ' if lint itself crashes with unexpected failures.') parser.add_argument('--config-path', help='Path to lint suppressions file.') parser.add_argument('--disable', @@ -345,6 +361,7 @@ def main(): input_strings = [ args.can_fail_build, + args.include_unexpected_failures, args.silent, ] if args.android_sdk_version: @@ -373,6 +390,7 @@ def main(): disable=disable, classpath=classpath, can_fail_build=args.can_fail_build, + include_unexpected=args.include_unexpected_failures, silent=args.silent), args, input_paths=input_paths, diff --git a/chromium/build/android/gyp/package_resources.py b/chromium/build/android/gyp/package_resources.py deleted file mode 100755 index 2be10bb6824..00000000000 --- a/chromium/build/android/gyp/package_resources.py +++ /dev/null @@ -1,449 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# pylint: disable=C0301 -"""Package resources into an apk. - -See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tasks/src/main/java/com/android/ant/AaptExecTask.java -and -https://android.googlesource.com/platform/sdk/+/master/files/ant/build.xml -""" -# pylint: enable=C0301 - -import multiprocessing.pool -import optparse -import os -import re -import shutil -import subprocess -import sys -import zipfile - -from util import build_utils - - -# A variation of this lists also exists in: -# //base/android/java/src/org/chromium/base/LocaleUtils.java -_CHROME_TO_ANDROID_LOCALE_MAP = { - 'en-GB': 'en-rGB', - 'en-US': 'en-rUS', - 'es-419': 'es-rUS', - 'fil': 'tl', - 'he': 'iw', - 'id': 'in', - 'pt-PT': 'pt-rPT', - 'pt-BR': 'pt-rBR', - 'yi': 'ji', - 'zh-CN': 'zh-rCN', - 'zh-TW': 'zh-rTW', -} - -# List is generated from the chrome_apk.apk_intermediates.ap_ via: -# unzip -l $FILE_AP_ | cut -c31- | grep res/draw | cut -d'/' -f 2 | sort \ -# | uniq | grep -- -tvdpi- | cut -c10- -# and then manually sorted. -# Note that we can't just do a cross-product of dimensions because the filenames -# become too big and aapt fails to create the files. -# This leaves all default drawables (mdpi) in the main apk. Android gets upset -# though if any drawables are missing from the default drawables/ directory. -DENSITY_SPLITS = { - 'hdpi': ( - 'hdpi-v4', # Order matters for output file names. - 'ldrtl-hdpi-v4', - 'sw600dp-hdpi-v13', - 'ldrtl-hdpi-v17', - 'ldrtl-sw600dp-hdpi-v17', - 'hdpi-v21', - ), - 'xhdpi': ( - 'xhdpi-v4', - 'ldrtl-xhdpi-v4', - 'sw600dp-xhdpi-v13', - 'ldrtl-xhdpi-v17', - 'ldrtl-sw600dp-xhdpi-v17', - 'xhdpi-v21', - ), - 'xxhdpi': ( - 'xxhdpi-v4', - 'ldrtl-xxhdpi-v4', - 'sw600dp-xxhdpi-v13', - 'ldrtl-xxhdpi-v17', - 'ldrtl-sw600dp-xxhdpi-v17', - 'xxhdpi-v21', - ), - 'xxxhdpi': ( - 'xxxhdpi-v4', - 'ldrtl-xxxhdpi-v4', - 'sw600dp-xxxhdpi-v13', - 'ldrtl-xxxhdpi-v17', - 'ldrtl-sw600dp-xxxhdpi-v17', - 'xxxhdpi-v21', - ), - 'tvdpi': ( - 'tvdpi-v4', - 'sw600dp-tvdpi-v13', - 'ldrtl-sw600dp-tvdpi-v17', - ), -} - - -_PNG_TO_WEBP_ARGS = [ - '-mt', '-quiet', '-m', '6', '-q', '100', '-lossless', '-o'] - - -def _ParseArgs(args): - """Parses command line options. - - Returns: - An options object as from optparse.OptionsParser.parse_args() - """ - parser = optparse.OptionParser() - build_utils.AddDepfileOption(parser) - parser.add_option('--android-sdk-jar', - help='path to the Android SDK jar.') - parser.add_option('--aapt-path', - help='path to the Android aapt tool') - parser.add_option('--debuggable', - action='store_true', - help='Whether to add android:debuggable="true"') - parser.add_option('--android-manifest', help='AndroidManifest.xml path') - parser.add_option('--version-code', help='Version code for apk.') - parser.add_option('--version-name', help='Version name for apk.') - parser.add_option( - '--shared-resources', - action='store_true', - help='Make a resource package that can be loaded by a different' - 'application at runtime to access the package\'s resources.') - parser.add_option( - '--app-as-shared-lib', - action='store_true', - help='Make a resource package that can be loaded as shared library') - parser.add_option('--resource-zips', - default='[]', - help='zip files containing resources to be packaged') - parser.add_option('--asset-dir', - help='directories containing assets to be packaged') - parser.add_option('--no-compress', help='disables compression for the ' - 'given comma separated list of extensions') - parser.add_option( - '--create-density-splits', - action='store_true', - help='Enables density splits') - parser.add_option('--language-splits', - default='[]', - help='GN list of languages to create splits for') - parser.add_option('--locale-whitelist', - default='[]', - help='GN list of languages to include. All other language ' - 'configs will be stripped out. List may include ' - 'a combination of Android locales or Chrome locales.') - parser.add_option('--apk-path', - help='Path to output (partial) apk.') - parser.add_option('--exclude-xxxhdpi', action='store_true', - help='Do not include xxxhdpi drawables.') - parser.add_option('--xxxhdpi-whitelist', - default='[]', - help='GN list of globs that say which xxxhdpi images to ' - 'include even when --exclude-xxxhdpi is set.') - parser.add_option('--png-to-webp', action='store_true', - help='Convert png files to webp format.') - parser.add_option('--webp-binary', default='', - help='Path to the cwebp binary.') - parser.add_option('--support-zh-hk', action='store_true', - help='Tell aapt to support zh-rHK.') - - options, positional_args = parser.parse_args(args) - - if positional_args: - parser.error('No positional arguments should be given.') - - # Check that required options have been provided. - required_options = ('android_sdk_jar', 'aapt_path', 'android_manifest', - 'version_code', 'version_name', 'apk_path') - - build_utils.CheckOptions(options, parser, required=required_options) - - options.resource_zips = build_utils.ParseGnList(options.resource_zips) - options.language_splits = build_utils.ParseGnList(options.language_splits) - options.locale_whitelist = build_utils.ParseGnList(options.locale_whitelist) - options.xxxhdpi_whitelist = build_utils.ParseGnList(options.xxxhdpi_whitelist) - return options - - -def _ToAaptLocales(locale_whitelist, support_zh_hk): - """Converts the list of Chrome locales to aapt config locales.""" - ret = set() - for locale in locale_whitelist: - locale = _CHROME_TO_ANDROID_LOCALE_MAP.get(locale, locale) - if locale is None or ('-' in locale and '-r' not in locale): - raise Exception('_CHROME_TO_ANDROID_LOCALE_MAP needs updating.' - ' Found: %s' % locale) - ret.add(locale) - # Always keep non-regional fall-backs. - language = locale.split('-')[0] - ret.add(language) - - # We don't actually support zh-HK in Chrome on Android, but we mimic the - # native side behavior where we use zh-TW resources when the locale is set to - # zh-HK. See https://crbug.com/780847. - if support_zh_hk: - assert not any('HK' in l for l in locale_whitelist), ( - 'Remove special logic if zh-HK is now supported (crbug.com/780847).') - ret.add('zh-rHK') - return sorted(ret) - - -def MoveImagesToNonMdpiFolders(res_root): - """Move images from drawable-*-mdpi-* folders to drawable-* folders. - - Why? http://crbug.com/289843 - """ - for src_dir_name in os.listdir(res_root): - src_components = src_dir_name.split('-') - if src_components[0] != 'drawable' or 'mdpi' not in src_components: - continue - src_dir = os.path.join(res_root, src_dir_name) - if not os.path.isdir(src_dir): - continue - dst_components = [c for c in src_components if c != 'mdpi'] - assert dst_components != src_components - dst_dir_name = '-'.join(dst_components) - dst_dir = os.path.join(res_root, dst_dir_name) - build_utils.MakeDirectory(dst_dir) - for src_file_name in os.listdir(src_dir): - if not src_file_name.endswith('.png'): - continue - src_file = os.path.join(src_dir, src_file_name) - dst_file = os.path.join(dst_dir, src_file_name) - assert not os.path.lexists(dst_file) - shutil.move(src_file, dst_file) - - -def PackageArgsForExtractedZip(d): - """Returns the aapt args for an extracted resources zip. - - A resources zip either contains the resources for a single target or for - multiple targets. If it is multiple targets merged into one, the actual - resource directories will be contained in the subdirectories 0, 1, 2, ... - """ - subdirs = [os.path.join(d, s) for s in os.listdir(d)] - subdirs = [s for s in subdirs if os.path.isdir(s)] - is_multi = any(os.path.basename(s).isdigit() for s in subdirs) - if is_multi: - res_dirs = sorted(subdirs, key=lambda p : int(os.path.basename(p))) - else: - res_dirs = [d] - package_command = [] - for d in res_dirs: - MoveImagesToNonMdpiFolders(d) - package_command += ['-S', d] - return package_command - - -def _GenerateDensitySplitPaths(apk_path): - for density, config in DENSITY_SPLITS.iteritems(): - src_path = '%s_%s' % (apk_path, '_'.join(config)) - dst_path = '%s_%s' % (apk_path, density) - yield src_path, dst_path - - -def _GenerateLanguageSplitOutputPaths(apk_path, languages): - for lang in languages: - yield '%s_%s' % (apk_path, lang) - - -def RenameDensitySplits(apk_path): - """Renames all density splits to have shorter / predictable names.""" - for src_path, dst_path in _GenerateDensitySplitPaths(apk_path): - shutil.move(src_path, dst_path) - - -def CheckForMissedConfigs(apk_path, check_density, languages): - """Raises an exception if apk_path contains any unexpected configs.""" - triggers = [] - if check_density: - triggers.extend(re.compile('-%s' % density) for density in DENSITY_SPLITS) - if languages: - triggers.extend(re.compile(r'-%s\b' % lang) for lang in languages) - with zipfile.ZipFile(apk_path) as main_apk_zip: - for name in main_apk_zip.namelist(): - for trigger in triggers: - if trigger.search(name) and not 'mipmap-' in name: - raise Exception(('Found config in main apk that should have been ' + - 'put into a split: %s\nYou need to update ' + - 'package_resources.py to include this new ' + - 'config (trigger=%s)') % (name, trigger.pattern)) - - -def _ConstructMostAaptArgs(options): - package_command = [ - options.aapt_path, - 'package', - '--version-code', options.version_code, - '--version-name', options.version_name, - '-M', options.android_manifest, - '--no-crunch', - '-f', - '--auto-add-overlay', - '--no-version-vectors', - '-I', options.android_sdk_jar, - '-F', options.apk_path, - '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN, - ] - - if options.no_compress: - for ext in options.no_compress.split(','): - package_command += ['-0', ext] - - if options.shared_resources: - package_command.append('--shared-lib') - - if options.app_as_shared_lib: - package_command.append('--app-as-shared-lib') - - if options.asset_dir and os.path.exists(options.asset_dir): - package_command += ['-A', options.asset_dir] - - if options.create_density_splits: - for config in DENSITY_SPLITS.itervalues(): - package_command.extend(('--split', ','.join(config))) - - if options.language_splits: - for lang in options.language_splits: - package_command.extend(('--split', lang)) - - if options.debuggable: - package_command += ['--debug-mode'] - - if options.locale_whitelist: - aapt_locales = _ToAaptLocales( - options.locale_whitelist, options.support_zh_hk) - package_command += ['-c', ','.join(aapt_locales)] - - return package_command - - -def _ResourceNameFromPath(path): - return os.path.splitext(os.path.basename(path))[0] - - -def _CreateExtractPredicate(dep_zips, exclude_xxxhdpi, xxxhdpi_whitelist): - if not exclude_xxxhdpi: - # Do not extract dotfiles (e.g. ".gitkeep"). aapt ignores them anyways. - return lambda path: os.path.basename(path)[0] != '.' - - # Returns False only for xxxhdpi non-mipmap, non-whitelisted drawables. - naive_predicate = lambda path: ( - not re.search(r'[/-]xxxhdpi[/-]', path) or - re.search(r'[/-]mipmap[/-]', path) or - build_utils.MatchesGlob(path, xxxhdpi_whitelist)) - - # Build a set of all non-xxxhdpi drawables to ensure that we never exclude any - # xxxhdpi drawable that does not exist in other densities. - non_xxxhdpi_drawables = set() - for resource_zip_path in dep_zips: - with zipfile.ZipFile(resource_zip_path) as zip_file: - for path in zip_file.namelist(): - if re.search(r'[/-]drawable[/-]', path) and naive_predicate(path): - non_xxxhdpi_drawables.add(_ResourceNameFromPath(path)) - - return lambda path: (naive_predicate(path) or - _ResourceNameFromPath(path) not in non_xxxhdpi_drawables) - - -def _ConvertToWebP(webp_binary, png_files): - pool = multiprocessing.pool.ThreadPool(10) - def convert_image(png_path): - root = os.path.splitext(png_path)[0] - webp_path = root + '.webp' - args = [webp_binary, png_path] + _PNG_TO_WEBP_ARGS + [webp_path] - subprocess.check_call(args) - os.remove(png_path) - # Android requires pngs for 9-patch images. - pool.map(convert_image, [f for f in png_files if not f.endswith('.9.png')]) - pool.close() - pool.join() - - -def _OnStaleMd5(package_command, options): - with build_utils.TempDir() as temp_dir: - if options.resource_zips: - dep_zips = options.resource_zips - extract_predicate = _CreateExtractPredicate( - dep_zips, options.exclude_xxxhdpi, options.xxxhdpi_whitelist) - png_paths = [] - package_subdirs = [] - for z in dep_zips: - subdir = os.path.join(temp_dir, os.path.basename(z)) - if os.path.exists(subdir): - raise Exception('Resource zip name conflict: ' + os.path.basename(z)) - extracted_files = build_utils.ExtractAll( - z, path=subdir, predicate=extract_predicate) - if extracted_files: - package_subdirs.append(subdir) - png_paths.extend(f for f in extracted_files if f.endswith('.png')) - if png_paths and options.png_to_webp: - _ConvertToWebP(options.webp_binary, png_paths) - for subdir in package_subdirs: - package_command += PackageArgsForExtractedZip(subdir) - - build_utils.CheckOutput( - package_command, print_stdout=False, print_stderr=False) - - if options.create_density_splits or options.language_splits: - CheckForMissedConfigs(options.apk_path, options.create_density_splits, - options.language_splits) - - if options.create_density_splits: - RenameDensitySplits(options.apk_path) - - -def main(args): - args = build_utils.ExpandFileArgs(args) - options = _ParseArgs(args) - - package_command = _ConstructMostAaptArgs(options) - - output_paths = [options.apk_path] - - if options.create_density_splits: - for _, dst_path in _GenerateDensitySplitPaths(options.apk_path): - output_paths.append(dst_path) - output_paths.extend( - _GenerateLanguageSplitOutputPaths(options.apk_path, - options.language_splits)) - - input_paths = [options.android_manifest] + options.resource_zips - - input_strings = [options.exclude_xxxhdpi] + options.xxxhdpi_whitelist - input_strings.extend(package_command) - if options.png_to_webp: - # This is necessary to ensure conversion if the option is toggled. - input_strings.append('png_to_webp') - if options.support_zh_hk: - input_strings.append('support_zh_hk') - - # The md5_check.py doesn't count file path in md5 intentionally, - # in order to repackage resources when assets' name changed, we need - # to put assets into input_strings, as we know the assets path isn't - # changed among each build if there is no asset change. - if options.asset_dir and os.path.exists(options.asset_dir): - asset_paths = [] - for root, _, filenames in os.walk(options.asset_dir): - asset_paths.extend(os.path.join(root, f) for f in filenames) - input_paths.extend(asset_paths) - input_strings.extend(sorted(asset_paths)) - - build_utils.CallAndWriteDepfileIfStale( - lambda: _OnStaleMd5(package_command, options), - options, - input_paths=input_paths, - input_strings=input_strings, - output_paths=output_paths) - - -if __name__ == '__main__': - main(sys.argv[1:]) diff --git a/chromium/build/android/gyp/process_resources.py b/chromium/build/android/gyp/process_resources.py index 0df462e9e0f..72c9728ffd2 100755 --- a/chromium/build/android/gyp/process_resources.py +++ b/chromium/build/android/gyp/process_resources.py @@ -12,29 +12,118 @@ This will crunch images and generate v14 compatible resources import codecs import collections +import multiprocessing.pool import optparse import os import re import shutil +import subprocess import sys -import xml.etree.ElementTree import zipfile +from xml.etree import ElementTree + import generate_v14_compatible_resources from util import build_utils +_SOURCE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname( + __file__)))) # Import jinja2 from third_party/jinja2 -sys.path.insert(1, - os.path.join(os.path.dirname(__file__), '../../../third_party')) +sys.path.insert(1, os.path.join(_SOURCE_ROOT, 'third_party')) from jinja2 import Template # pylint: disable=F0401 +_EMPTY_ANDROID_MANIFEST_PATH = os.path.join( + _SOURCE_ROOT, 'build', 'android', 'AndroidManifest.xml') + + # Represents a line from a R.txt file. TextSymbolsEntry = collections.namedtuple('RTextEntry', ('java_type', 'resource_type', 'name', 'value')) +# A variation of this lists also exists in: +# //base/android/java/src/org/chromium/base/LocaleUtils.java +_CHROME_TO_ANDROID_LOCALE_MAP = { + 'en-GB': 'en-rGB', + 'en-US': 'en-rUS', + 'es-419': 'es-rUS', + 'fil': 'tl', + 'he': 'iw', + 'id': 'in', + 'pt-PT': 'pt-rPT', + 'pt-BR': 'pt-rBR', + 'yi': 'ji', + 'zh-CN': 'zh-rCN', + 'zh-TW': 'zh-rTW', +} + +# List is generated from the chrome_apk.apk_intermediates.ap_ via: +# unzip -l $FILE_AP_ | cut -c31- | grep res/draw | cut -d'/' -f 2 | sort \ +# | uniq | grep -- -tvdpi- | cut -c10- +# and then manually sorted. +# Note that we can't just do a cross-product of dimensions because the filenames +# become too big and aapt fails to create the files. +# This leaves all default drawables (mdpi) in the main apk. Android gets upset +# though if any drawables are missing from the default drawables/ directory. +_DENSITY_SPLITS = { + 'hdpi': ( + 'hdpi-v4', # Order matters for output file names. + 'ldrtl-hdpi-v4', + 'sw600dp-hdpi-v13', + 'ldrtl-hdpi-v17', + 'ldrtl-sw600dp-hdpi-v17', + 'hdpi-v21', + ), + 'xhdpi': ( + 'xhdpi-v4', + 'ldrtl-xhdpi-v4', + 'sw600dp-xhdpi-v13', + 'ldrtl-xhdpi-v17', + 'ldrtl-sw600dp-xhdpi-v17', + 'xhdpi-v21', + ), + 'xxhdpi': ( + 'xxhdpi-v4', + 'ldrtl-xxhdpi-v4', + 'sw600dp-xxhdpi-v13', + 'ldrtl-xxhdpi-v17', + 'ldrtl-sw600dp-xxhdpi-v17', + 'xxhdpi-v21', + ), + 'xxxhdpi': ( + 'xxxhdpi-v4', + 'ldrtl-xxxhdpi-v4', + 'sw600dp-xxxhdpi-v13', + 'ldrtl-xxxhdpi-v17', + 'ldrtl-sw600dp-xxxhdpi-v17', + 'xxxhdpi-v21', + ), + 'tvdpi': ( + 'tvdpi-v4', + 'sw600dp-tvdpi-v13', + 'ldrtl-sw600dp-tvdpi-v17', + ), +} + +class _ResourceWhitelist(object): + def __init__(self, entries=None): + self._entries = None + if entries: + self._entries = set(self._Key(x) for x in entries) + + def __contains__(self, entry): + return self._entries is None or self._Key(entry) in self._entries + + @staticmethod + def _Key(entry): + # Whitelists should only care about the name of the resource rather than the + # resource ID (since the whitelist is from another compilation unit, the + # resource IDs may not match). + return (entry.java_type, entry.resource_type, entry.name) + + def _ParseArgs(args): """Parses command line options. @@ -61,8 +150,14 @@ def _ParseArgs(args): '--app-as-shared-lib', action='store_true', help='Make a resource package that can be loaded as shared library.') + parser.add_option( + '--shared-resources-whitelist', + help='An R.txt file acting as a whitelist for resources that should be ' + 'non-final and have their package ID changed at runtime in R.java. If no ' + 'whitelist is provided, then everything is whitelisted.') parser.add_option('--resource-dirs', + default='[]', help='Directories containing resources of this target.') parser.add_option('--dependencies-res-zips', help='Resources from dependents.') @@ -97,21 +192,48 @@ def _ParseArgs(args): help='For each additional package, the R.txt file should contain a ' 'list of resources to be included in the R.java file in the format ' 'generated by aapt') - parser.add_option( - '--include-all-resources', - action='store_true', - help='Include every resource ID in every generated R.java file ' - '(ignoring R.txt).') - parser.add_option( - '--all-resources-zip-out', - help='Path for output of all resources. This includes resources in ' - 'dependencies.') parser.add_option('--support-zh-hk', action='store_true', help='Use zh-rTW resources for zh-rHK.') parser.add_option('--stamp', help='File to touch on success') + parser.add_option('--debuggable', + action='store_true', + help='Whether to add android:debuggable="true"') + parser.add_option('--version-code', help='Version code for apk.') + parser.add_option('--version-name', help='Version name for apk.') + parser.add_option('--no-compress', help='disables compression for the ' + 'given comma separated list of extensions') + parser.add_option( + '--create-density-splits', + action='store_true', + help='Enables density splits') + parser.add_option('--language-splits', + default='[]', + help='GN list of languages to create splits for') + parser.add_option('--locale-whitelist', + default='[]', + help='GN list of languages to include. All other language ' + 'configs will be stripped out. List may include ' + 'a combination of Android locales or Chrome locales.') + parser.add_option('--apk-path', + help='Path to output (partial) apk.') + parser.add_option('--exclude-xxxhdpi', action='store_true', + help='Do not include xxxhdpi drawables.') + parser.add_option('--xxxhdpi-whitelist', + default='[]', + help='GN list of globs that say which xxxhdpi images to ' + 'include even when --exclude-xxxhdpi is set.') + parser.add_option('--png-to-webp', action='store_true', + help='Convert png files to webp format.') + parser.add_option('--webp-binary', default='', + help='Path to the cwebp binary.') + parser.add_option('--no-xml-namespaces', + action='store_true', + help='Whether to strip xml namespaces from processed xml ' + 'resources') + options, positional_args = parser.parse_args(args) if positional_args: @@ -121,9 +243,7 @@ def _ParseArgs(args): required_options = ( 'android_sdk_jar', 'aapt_path', - 'android_manifest', 'dependencies_res_zips', - 'resource_dirs', ) build_utils.CheckOptions(options, parser, required=required_options) @@ -131,6 +251,10 @@ def _ParseArgs(args): options.dependencies_res_zips = ( build_utils.ParseGnList(options.dependencies_res_zips)) + options.language_splits = build_utils.ParseGnList(options.language_splits) + options.locale_whitelist = build_utils.ParseGnList(options.locale_whitelist) + options.xxxhdpi_whitelist = build_utils.ParseGnList(options.xxxhdpi_whitelist) + # Don't use [] as default value since some script explicitly pass "". if options.extra_res_packages: options.extra_res_packages = ( @@ -147,16 +271,23 @@ def _ParseArgs(args): return options -def CreateRJavaFiles(srcjar_dir, main_r_txt_file, packages, r_txt_files, - shared_resources, non_constant_id): +def _CreateRJavaFiles(srcjar_dir, main_r_txt_file, packages, r_txt_files, + shared_resources, non_constant_id, whitelist_r_txt_file, is_apk): assert len(packages) == len(r_txt_files), 'Need one R.txt file per package' # Map of (resource_type, name) -> Entry. # Contains the correct values for resources. all_resources = {} for entry in _ParseTextSymbolsFile(main_r_txt_file): + entry = entry._replace(value=_FixPackageIds(entry.value)) all_resources[(entry.resource_type, entry.name)] = entry + if whitelist_r_txt_file: + whitelisted_resources = _ResourceWhitelist( + _ParseTextSymbolsFile(whitelist_r_txt_file)) + else: + whitelisted_resources = _ResourceWhitelist() + # Map of package_name->resource_type->entry resources_by_package = ( collections.defaultdict(lambda: collections.defaultdict(list))) @@ -195,8 +326,8 @@ def CreateRJavaFiles(srcjar_dir, main_r_txt_file, packages, r_txt_files, package_r_java_dir = os.path.join(srcjar_dir, *package.split('.')) build_utils.MakeDirectory(package_r_java_dir) package_r_java_path = os.path.join(package_r_java_dir, 'R.java') - java_file_contents = _CreateRJavaFile( - package, resources_by_type, shared_resources, non_constant_id) + java_file_contents = _CreateRJavaFile(package, resources_by_type, + shared_resources, non_constant_id, whitelisted_resources, is_apk) with open(package_r_java_path, 'w') as f: f.write(java_file_contents) @@ -214,9 +345,43 @@ def _ParseTextSymbolsFile(path): return ret +def _FixPackageIds(resource_value): + # Resource IDs for resources belonging to regular APKs have their first byte + # as 0x7f (package id). However with webview, since it is not a regular apk + # but used as a shared library, aapt is passed the --shared-resources flag + # which changes some of the package ids to 0x02 and 0x00. This function just + # normalises all package ids to 0x7f, which the generated code in R.java + # changes to the correct package id at runtime. + # resource_value is a string with either, a single value '0x12345678', or an + # array of values like '{ 0xfedcba98, 0x01234567, 0x56789abc }' + return re.sub(r'0x(?!01)\d\d', r'0x7f', resource_value) + + def _CreateRJavaFile(package, resources_by_type, shared_resources, - non_constant_id): + non_constant_id, whitelisted_resources, is_apk): """Generates the contents of a R.java file.""" + final_resources_by_type = collections.defaultdict(list) + non_final_resources_by_type = collections.defaultdict(list) + if shared_resources or non_constant_id: + for res_type, resources in resources_by_type.iteritems(): + for entry in resources: + # Entries in stylable that are not int[] are not actually resource ids + # but constants. If we are creating an apk there is no reason for them + # to be non-final. However for libraries, they may be clobbered later on + # and thus should remain non-final. This is regardless of the + # whitelisting rules (since they are not actually resources). + if entry.resource_type == 'styleable' and entry.java_type != 'int[]': + if is_apk: + final_resources_by_type[res_type].append(entry) + else: + non_final_resources_by_type[res_type].append(entry) + elif entry in whitelisted_resources: + non_final_resources_by_type[res_type].append(entry) + else: + final_resources_by_type[res_type].append(entry) + else: + final_resources_by_type = resources_by_type + # Keep these assignments all on one line to make diffing against regular # aapt-generated files easier. create_id = ('{{ e.resource_type }}.{{ e.name }} ^= packageIdTransform;') @@ -234,8 +399,11 @@ public final class R { private static boolean sResourcesDidLoad; {% for resource_type in resource_types %} public static final class {{ resource_type }} { - {% for e in resources[resource_type] %} - public static {{ final }}{{ e.java_type }} {{ e.name }} = {{ e.value }}; + {% for e in final_resources[resource_type] %} + public static final {{ e.java_type }} {{ e.name }} = {{ e.value }}; + {% endfor %} + {% for e in non_final_resources[resource_type] %} + public static {{ e.java_type }} {{ e.name }} = {{ e.value }}; {% endfor %} } {% endfor %} @@ -246,7 +414,7 @@ public final class R { int packageIdTransform = (packageId ^ 0x7f) << 24; {% for resource_type in resource_types %} onResourcesLoaded{{ resource_type|title }}(packageIdTransform); - {% for e in resources[resource_type] %} + {% for e in non_final_resources[resource_type] %} {% if e.java_type == 'int[]' %} for(int i = 0; i < {{ e.resource_type }}.{{ e.name }}.length; ++i) { """ + create_id_arr + """ @@ -258,7 +426,7 @@ public final class R { {% for res_type in resource_types %} private static void onResourcesLoaded{{ res_type|title }} ( int packageIdTransform) { - {% for e in resources[res_type] %} + {% for e in non_final_resources[res_type] %} {% if res_type != 'styleable' and e.java_type != 'int[]' %} """ + create_id + """ {% endif %} @@ -269,15 +437,14 @@ public final class R { } """, trim_blocks=True, lstrip_blocks=True) - final = '' if shared_resources or non_constant_id else 'final ' return template.render(package=package, - resources=resources_by_type, resource_types=sorted(resources_by_type), shared_resources=shared_resources, - final=final) + final_resources=final_resources_by_type, + non_final_resources=non_final_resources_by_type) -def CrunchDirectory(aapt, input_dir, output_dir): +def _CrunchDirectory(aapt, input_dir, output_dir): """Crunches the images in input_dir and its subdirectories into output_dir. If an image is already optimized, crunching often increases image size. In @@ -288,8 +455,8 @@ def CrunchDirectory(aapt, input_dir, output_dir): '-C', output_dir, '-S', input_dir, '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN] - build_utils.CheckOutput(aapt_cmd, stderr_filter=FilterCrunchStderr, - fail_func=DidCrunchFail) + build_utils.CheckOutput(aapt_cmd, stderr_filter=_FilterCrunchStderr, + fail_func=_DidCrunchFail) # Check for images whose size increased during crunching and replace them # with their originals (except for 9-patches, which must be crunched). @@ -307,7 +474,7 @@ def CrunchDirectory(aapt, input_dir, output_dir): shutil.copyfile(original, crunched) -def FilterCrunchStderr(stderr): +def _FilterCrunchStderr(stderr): """Filters out lines from aapt crunch's stderr that can safely be ignored.""" filtered_lines = [] for line in stderr.splitlines(True): @@ -320,7 +487,7 @@ def FilterCrunchStderr(stderr): return ''.join(filtered_lines) -def DidCrunchFail(returncode, stderr): +def _DidCrunchFail(returncode, stderr): """Determines whether aapt crunch failed from its return code and output. Because aapt's return code cannot be trusted, any output to stderr is @@ -329,11 +496,24 @@ def DidCrunchFail(returncode, stderr): return returncode != 0 or stderr -def ZipResources(resource_dirs, zip_path): +def _GenerateGlobs(pattern): + # This function processes the aapt ignore assets pattern into a list of globs + # to be used to exclude files on the python side. It removes the '!', which is + # used by aapt to mean 'not chatty' so it does not output if the file is + # ignored (we dont output anyways, so it is not required). This function does + # not handle the <dir> and <file> prefixes used by aapt and are assumed not to + # be included in the pattern string. + return pattern.replace('!', '').split(':') + + +def _ZipResources(resource_dirs, zip_path, ignore_pattern): # Python zipfile does not provide a way to replace a file (it just writes # another file with the same name). So, first collect all the files to put # in the zip (with proper overriding), and then zip them. + # ignore_pattern is a string of ':' delimited list of globs used to ignore + # files that should not be part of the final resource zip. files_to_zip = dict() + globs = _GenerateGlobs(ignore_pattern) for d in resource_dirs: for root, _, files in os.walk(d): for f in files: @@ -342,216 +522,442 @@ def ZipResources(resource_dirs, zip_path): if parent_dir != '.': archive_path = os.path.join(parent_dir, f) path = os.path.join(root, f) + if build_utils.MatchesGlob(archive_path, globs): + continue files_to_zip[archive_path] = path build_utils.DoZip(files_to_zip.iteritems(), zip_path) +def _SortZip(original_path, sorted_path): + with zipfile.ZipFile(sorted_path, 'w') as sorted_zip, \ + zipfile.ZipFile(original_path, 'r') as original_zip: + for info in sorted(original_zip.infolist(), key=lambda i: i.filename): + sorted_zip.writestr(info, original_zip.read(info)) -def CombineZips(zip_files, output_path, support_zh_hk): - # When packaging resources, if the top-level directories in the zip file are - # of the form 0, 1, ..., then each subdirectory will be passed to aapt as a - # resources directory. While some resources just clobber others (image files, - # etc), other resources (particularly .xml files) need to be more - # intelligently merged. That merging is left up to aapt. - def path_transform(name, src_zip): - return '%d/%s' % (zip_files.index(src_zip), name) - - # We don't currently support zh-HK on Chrome for Android, but on the - # native side we resolve zh-HK resources to zh-TW. This logic is - # duplicated here by just copying the zh-TW res folders to zh-HK. - # See https://crbug.com/780847. - with build_utils.TempDir() as temp_dir: - if support_zh_hk: - zip_files = _DuplicateZhResources(zip_files, temp_dir) - build_utils.MergeZips(output_path, zip_files, path_transform=path_transform) - - -def _DuplicateZhResources(zip_files, temp_dir): - new_zip_files = [] - for i, zip_path in enumerate(zip_files): - # We use zh-TW resources for zh-HK (if we have zh-TW resources). If no - # zh-TW resources exists (ex. api specific resources), then just use the - # original zip. - if not _ZipContains(zip_path, r'zh-r(HK|TW)'): - new_zip_files.append(zip_path) - continue - resource_dir = os.path.join(temp_dir, str(i)) - new_zip_path = os.path.join(temp_dir, str(i) + '.zip') - # Exclude existing zh-HK resources so that we don't mess up any resource - # IDs. This can happen if the type IDs in the existing resources don't - # align with ours (since they've already been generated at this point). - build_utils.ExtractAll( - zip_path, path=resource_dir, predicate=lambda x: not 'zh-rHK' in x) +def _DuplicateZhResources(resource_dirs): + for resource_dir in resource_dirs: + # We use zh-TW resources for zh-HK (if we have zh-TW resources). for path in build_utils.IterFiles(resource_dir): if 'zh-rTW' in path: hk_path = path.replace('zh-rTW', 'zh-rHK') - build_utils.Touch(hk_path) + build_utils.MakeDirectory(os.path.dirname(hk_path)) shutil.copyfile(path, hk_path) - build_utils.ZipDir(new_zip_path, resource_dir) - new_zip_files.append(new_zip_path) - return new_zip_files +def _ExtractPackageFromManifest(manifest_path): + doc = ElementTree.parse(manifest_path) + return doc.getroot().get('package') + + +def _ToAaptLocales(locale_whitelist, support_zh_hk): + """Converts the list of Chrome locales to aapt config locales.""" + ret = set() + for locale in locale_whitelist: + locale = _CHROME_TO_ANDROID_LOCALE_MAP.get(locale, locale) + if locale is None or ('-' in locale and '-r' not in locale): + raise Exception('_CHROME_TO_ANDROID_LOCALE_MAP needs updating.' + ' Found: %s' % locale) + ret.add(locale) + # Always keep non-regional fall-backs. + language = locale.split('-')[0] + ret.add(language) + + # We don't actually support zh-HK in Chrome on Android, but we mimic the + # native side behavior where we use zh-TW resources when the locale is set to + # zh-HK. See https://crbug.com/780847. + if support_zh_hk: + assert not any('HK' in l for l in locale_whitelist), ( + 'Remove special logic if zh-HK is now supported (crbug.com/780847).') + ret.add('zh-rHK') + return sorted(ret) + + +def _MoveImagesToNonMdpiFolders(res_root): + """Move images from drawable-*-mdpi-* folders to drawable-* folders. + + Why? http://crbug.com/289843 + """ + for src_dir_name in os.listdir(res_root): + src_components = src_dir_name.split('-') + if src_components[0] != 'drawable' or 'mdpi' not in src_components: + continue + src_dir = os.path.join(res_root, src_dir_name) + if not os.path.isdir(src_dir): + continue + dst_components = [c for c in src_components if c != 'mdpi'] + assert dst_components != src_components + dst_dir_name = '-'.join(dst_components) + dst_dir = os.path.join(res_root, dst_dir_name) + build_utils.MakeDirectory(dst_dir) + for src_file_name in os.listdir(src_dir): + if not os.path.splitext(src_file_name)[1] in ('.png', '.webp'): + continue + src_file = os.path.join(src_dir, src_file_name) + dst_file = os.path.join(dst_dir, src_file_name) + assert not os.path.lexists(dst_file) + shutil.move(src_file, dst_file) + + +def _GenerateDensitySplitPaths(apk_path): + for density, config in _DENSITY_SPLITS.iteritems(): + src_path = '%s_%s' % (apk_path, '_'.join(config)) + dst_path = '%s_%s' % (apk_path, density) + yield src_path, dst_path + + +def _GenerateLanguageSplitOutputPaths(apk_path, languages): + for lang in languages: + yield '%s_%s' % (apk_path, lang) + + +def _RenameDensitySplits(apk_path): + """Renames all density splits to have shorter / predictable names.""" + for src_path, dst_path in _GenerateDensitySplitPaths(apk_path): + shutil.move(src_path, dst_path) + + +def _CheckForMissedConfigs(apk_path, check_density, languages): + """Raises an exception if apk_path contains any unexpected configs.""" + triggers = [] + if check_density: + triggers.extend(re.compile('-%s' % density) for density in _DENSITY_SPLITS) + if languages: + triggers.extend(re.compile(r'-%s\b' % lang) for lang in languages) + with zipfile.ZipFile(apk_path) as main_apk_zip: + for name in main_apk_zip.namelist(): + for trigger in triggers: + if trigger.search(name) and not 'mipmap-' in name: + raise Exception(('Found config in main apk that should have been ' + + 'put into a split: %s\nYou need to update ' + + 'package_resources.py to include this new ' + + 'config (trigger=%s)') % (name, trigger.pattern)) + + +def _CreateLinkApkArgs(options): + link_command = [ + options.aapt_path + '2', + 'link', + '--version-code', options.version_code, + '--version-name', options.version_name, + '--auto-add-overlay', + '--no-version-vectors', + '-I', options.android_sdk_jar, + '-o', options.apk_path, + ] + if options.proguard_file: + link_command += ['--proguard', options.proguard_file] + if options.proguard_file_main_dex: + link_command += ['--proguard-main-dex', options.proguard_file_main_dex] -def _ZipContains(path, pattern): - with zipfile.ZipFile(path, 'r') as z: - return any(re.search(pattern, f) for f in z.namelist()) + if options.no_compress: + for ext in options.no_compress.split(','): + link_command += ['-0', ext] + if options.shared_resources: + link_command.append('--shared-lib') -def _ExtractPackageFromManifest(manifest_path): - doc = xml.etree.ElementTree.parse(manifest_path) - return doc.getroot().get('package') + if options.create_density_splits: + for config in _DENSITY_SPLITS.itervalues(): + link_command.extend(('--split', ','.join(config))) + + if options.language_splits: + for lang in options.language_splits: + link_command.extend(('--split', lang)) + + if options.locale_whitelist: + aapt_locales = _ToAaptLocales( + options.locale_whitelist, options.support_zh_hk) + link_command += ['-c', ','.join(aapt_locales)] + + if options.no_xml_namespaces: + link_command.append('--no-xml-namespaces') + + return link_command + + +def _ExtractVersionFromSdk(aapt_path, sdk_path): + output = subprocess.check_output([aapt_path, 'dump', 'badging', sdk_path]) + version_code = re.search(r"versionCode='(.*?)'", output).group(1) + version_name = re.search(r"versionName='(.*?)'", output).group(1) + return version_code, version_name, + + +def _FixManifest(options, temp_dir): + debug_manifest_path = os.path.join(temp_dir, 'AndroidManifest.xml') + _ANDROID_NAMESPACE = 'http://schemas.android.com/apk/res/android' + _TOOLS_NAMESPACE = 'http://schemas.android.com/tools' + ElementTree.register_namespace('android', _ANDROID_NAMESPACE) + ElementTree.register_namespace('tools', _TOOLS_NAMESPACE) + original_manifest = ElementTree.parse(options.android_manifest) + + version_code, version_name = _ExtractVersionFromSdk( + options.aapt_path, options.android_sdk_jar) + + # ElementTree.find does not work if the required tag is the root. + if original_manifest.getroot().tag == 'manifest': + manifest_node = original_manifest.getroot() + else: + manifest_node = original_manifest.find('manifest') + + manifest_node.set('platformBuildVersionCode', version_code) + manifest_node.set('platformBuildVersionName', version_name) + + if options.debuggable: + app_node = original_manifest.find('application') + app_node.set('{%s}%s' % (_ANDROID_NAMESPACE, 'debuggable'), 'true') + + with open(debug_manifest_path, 'w') as debug_manifest: + debug_manifest.write(ElementTree.tostring( + original_manifest.getroot(), encoding='UTF-8')) + + return debug_manifest_path + + +def _ResourceNameFromPath(path): + return os.path.splitext(os.path.basename(path))[0] + + +def _CreateKeepPredicate(resource_dirs, exclude_xxxhdpi, xxxhdpi_whitelist): + if not exclude_xxxhdpi: + # Do not extract dotfiles (e.g. ".gitkeep"). aapt ignores them anyways. + return lambda path: os.path.basename(path)[0] != '.' + + # Returns False only for xxxhdpi non-mipmap, non-whitelisted drawables. + naive_predicate = lambda path: ( + not re.search(r'[/-]xxxhdpi[/-]', path) or + re.search(r'[/-]mipmap[/-]', path) or + build_utils.MatchesGlob(path, xxxhdpi_whitelist)) + + # Build a set of all non-xxxhdpi drawables to ensure that we never exclude any + # xxxhdpi drawable that does not exist in other densities. + non_xxxhdpi_drawables = set() + for resource_dir in resource_dirs: + for path in build_utils.IterFiles(resource_dir): + if re.search(r'[/-]drawable[/-]', path) and naive_predicate(path): + non_xxxhdpi_drawables.add(_ResourceNameFromPath(path)) + + return lambda path: (naive_predicate(path) or + _ResourceNameFromPath(path) not in non_xxxhdpi_drawables) + + +def _ConvertToWebP(webp_binary, png_files): + pool = multiprocessing.pool.ThreadPool(10) + def convert_image(png_path): + root = os.path.splitext(png_path)[0] + webp_path = root + '.webp' + args = [webp_binary, png_path, '-mt', '-quiet', '-m', '6', '-q', '100', + '-lossless', '-o', webp_path] + subprocess.check_call(args) + os.remove(png_path) + # Android requires pngs for 9-patch images. + pool.map(convert_image, [f for f in png_files if not f.endswith('.9.png')]) + pool.close() + pool.join() + + +def _CompileDeps(aapt_path, dep_subdirs, temp_dir): + partials_dir = os.path.join(temp_dir, 'partials') + build_utils.MakeDirectory(partials_dir) + partial_compile_command = [ + aapt_path + '2', + 'compile', + '--no-crunch', + ] + pool = multiprocessing.pool.ThreadPool(10) + def compile_partial(directory): + dirname = os.path.basename(directory) + partial_path = os.path.join(partials_dir, dirname + '.zip') + compile_command = (partial_compile_command + + ['--dir', directory, '-o', partial_path]) + build_utils.CheckOutput(compile_command) + + # Sorting the files in the partial ensures deterministic output from the + # aapt2 link step which uses order of files in the partial. + sorted_partial_path = os.path.join(partials_dir, dirname + '.sorted.zip') + _SortZip(partial_path, sorted_partial_path) + + return sorted_partial_path + + partials = pool.map(compile_partial, dep_subdirs) + pool.close() + pool.join() + return partials + + +def _PackageApk(options, dep_subdirs, temp_dir, gen_dir, r_txt_path): + _DuplicateZhResources(dep_subdirs) + + keep_predicate = _CreateKeepPredicate( + dep_subdirs, options.exclude_xxxhdpi, options.xxxhdpi_whitelist) + png_paths = [] + for directory in dep_subdirs: + for f in build_utils.IterFiles(directory): + if not keep_predicate(f): + os.remove(f) + elif f.endswith('.png'): + png_paths.append(f) + if png_paths and options.png_to_webp: + _ConvertToWebP(options.webp_binary, png_paths) + for directory in dep_subdirs: + _MoveImagesToNonMdpiFolders(directory) + + link_command = _CreateLinkApkArgs(options) + link_command += ['--output-text-symbols', r_txt_path] + link_command += ['--java', gen_dir] + + fixed_manifest = _FixManifest(options, temp_dir) + link_command += ['--manifest', fixed_manifest] + + partials = _CompileDeps(options.aapt_path, dep_subdirs, temp_dir) + for partial in partials: + link_command += ['-R', partial] + + # Creates a .zip with AndroidManifest.xml, resources.arsc, res/* + # Also creates R.txt + build_utils.CheckOutput( + link_command, print_stdout=False, print_stderr=False) + + if options.create_density_splits or options.language_splits: + _CheckForMissedConfigs(options.apk_path, options.create_density_splits, + options.language_splits) + + if options.create_density_splits: + _RenameDensitySplits(options.apk_path) + + +# _PackageLibrary uses aapt rather than aapt2 because aapt2 compile does not +# support outputting an R.txt file. +def _PackageLibrary(options, dep_subdirs, temp_dir, gen_dir): + v14_dir = os.path.join(temp_dir, 'v14') + build_utils.MakeDirectory(v14_dir) + + # Generate R.java. This R.java contains non-final constants and is used only + # while compiling the library jar (e.g. chromium_content.jar). When building + # an apk, a new R.java file with the correct resource -> ID mappings will be + # generated by merging the resources from all libraries and the main apk + # project. + package_command = [options.aapt_path, + 'package', + '-m', + '-M', _EMPTY_ANDROID_MANIFEST_PATH, + '--no-crunch', + '--auto-add-overlay', + '--no-version-vectors', + '-I', options.android_sdk_jar, + '--output-text-symbols', gen_dir, + '-J', gen_dir, # Required for R.txt generation. + '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN] + + # Adding all dependencies as sources is necessary for @type/foo references + # to symbols within dependencies to resolve. However, it has the side-effect + # that all Java symbols from dependencies are copied into the new R.java. + # E.g.: It enables an arguably incorrect usage of + # "mypackage.R.id.lib_symbol" where "libpackage.R.id.lib_symbol" would be + # more correct. This is just how Android works. + for d in dep_subdirs: + package_command += ['-S', d] + + input_resource_dirs = options.resource_dirs + + for d in input_resource_dirs: + package_command += ['-S', d] + + if not options.v14_skip: + for resource_dir in input_resource_dirs: + generate_v14_compatible_resources.GenerateV14Resources( + resource_dir, + v14_dir) + + # This is the list of directories with resources to put in the final .zip + # file. The order of these is important so that crunched/v14 resources + # override the normal ones. + zip_resource_dirs = input_resource_dirs + [v14_dir] + + base_crunch_dir = os.path.join(temp_dir, 'crunch') + # Crunch image resources. This shrinks png files and is necessary for + # 9-patch images to display correctly. 'aapt crunch' accepts only a single + # directory at a time and deletes everything in the output directory. + for idx, input_dir in enumerate(input_resource_dirs): + crunch_dir = os.path.join(base_crunch_dir, str(idx)) + build_utils.MakeDirectory(crunch_dir) + zip_resource_dirs.append(crunch_dir) + _CrunchDirectory(options.aapt_path, input_dir, crunch_dir) + + if options.resource_zip_out: + _ZipResources(zip_resource_dirs, options.resource_zip_out, + build_utils.AAPT_IGNORE_PATTERN) + + # Only creates an R.txt + build_utils.CheckOutput( + package_command, print_stdout=False, print_stderr=False) + + +def _CreateRTxtAndSrcJar(options, r_txt_path, srcjar_dir): + # When an empty res/ directory is passed, aapt does not write an R.txt. + if not os.path.exists(r_txt_path): + build_utils.Touch(r_txt_path) + + if options.r_text_in: + r_txt_path = options.r_text_in + + packages = list(options.extra_res_packages) + r_txt_files = list(options.extra_r_text_files) + + cur_package = options.custom_package + if not options.custom_package and options.android_manifest: + cur_package = _ExtractPackageFromManifest(options.android_manifest) + + # Don't create a .java file for the current resource target when: + # - no package name was provided (either by manifest or build rules), + # - there was already a dependent android_resources() with the same + # package (occurs mostly when an apk target and resources target share + # an AndroidManifest.xml) + if cur_package and cur_package not in packages: + packages.append(cur_package) + r_txt_files.append(r_txt_path) + + if packages: + shared_resources = options.shared_resources or options.app_as_shared_lib + _CreateRJavaFiles(srcjar_dir, r_txt_path, packages, r_txt_files, + shared_resources, options.non_constant_id, + options.shared_resources_whitelist, bool(options.apk_path)) + + if options.srcjar_out: + build_utils.ZipDir(options.srcjar_out, srcjar_dir) + + if options.r_text_out: + shutil.copyfile(r_txt_path, options.r_text_out) + + +def _ExtractDeps(dep_zips, deps_dir): + dep_subdirs = [] + for z in dep_zips: + subdir = os.path.join(deps_dir, os.path.basename(z)) + if os.path.exists(subdir): + raise Exception('Resource zip name conflict: ' + os.path.basename(z)) + build_utils.ExtractAll(z, path=subdir) + dep_subdirs.append(subdir) + return dep_subdirs def _OnStaleMd5(options): - aapt = options.aapt_path with build_utils.TempDir() as temp_dir: deps_dir = os.path.join(temp_dir, 'deps') build_utils.MakeDirectory(deps_dir) - v14_dir = os.path.join(temp_dir, 'v14') - build_utils.MakeDirectory(v14_dir) - gen_dir = os.path.join(temp_dir, 'gen') build_utils.MakeDirectory(gen_dir) r_txt_path = os.path.join(gen_dir, 'R.txt') srcjar_dir = os.path.join(temp_dir, 'java') - input_resource_dirs = options.resource_dirs - - if not options.v14_skip: - for resource_dir in input_resource_dirs: - generate_v14_compatible_resources.GenerateV14Resources( - resource_dir, - v14_dir) - - dep_zips = options.dependencies_res_zips - dep_subdirs = [] - for z in dep_zips: - subdir = os.path.join(deps_dir, os.path.basename(z)) - if os.path.exists(subdir): - raise Exception('Resource zip name conflict: ' + os.path.basename(z)) - build_utils.ExtractAll(z, path=subdir) - dep_subdirs.append(subdir) - - # Generate R.java. This R.java contains non-final constants and is used only - # while compiling the library jar (e.g. chromium_content.jar). When building - # an apk, a new R.java file with the correct resource -> ID mappings will be - # generated by merging the resources from all libraries and the main apk - # project. - package_command = [aapt, - 'package', - '-m', - '-M', options.android_manifest, - '--auto-add-overlay', - '--no-version-vectors', - '-I', options.android_sdk_jar, - '--output-text-symbols', gen_dir, - '-J', gen_dir, # Required for R.txt generation. - '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN] - - # aapt supports only the "--include-all-resources" mode, where each R.java - # file ends up with all symbols, rather than only those that it had at the - # time it was originally generated. This subtle difference makes no - # difference when compiling, but can lead to increased unused symbols in the - # resulting R.class files. - # TODO(agrieve): See if proguard makes this difference actually translate - # into a size difference. If not, we can delete all of our custom R.java - # template code above (and make include_all_resources the default). - if options.include_all_resources: - srcjar_dir = gen_dir - if options.extra_res_packages: - colon_separated = ':'.join(options.extra_res_packages) - package_command += ['--extra-packages', colon_separated] - if options.non_constant_id: - package_command.append('--non-constant-id') - if options.custom_package: - package_command += ['--custom-package', options.custom_package] - if options.shared_resources: - package_command.append('--shared-lib') - if options.app_as_shared_lib: - package_command.append('--app-as-shared-lib') - - for d in input_resource_dirs: - package_command += ['-S', d] - - # Adding all dependencies as sources is necessary for @type/foo references - # to symbols within dependencies to resolve. However, it has the side-effect - # that all Java symbols from dependencies are copied into the new R.java. - # E.g.: It enables an arguably incorrect usage of - # "mypackage.R.id.lib_symbol" where "libpackage.R.id.lib_symbol" would be - # more correct. This is just how Android works. - for d in dep_subdirs: - package_command += ['-S', d] - - if options.proguard_file: - package_command += ['-G', options.proguard_file] - if options.proguard_file_main_dex: - package_command += ['-D', options.proguard_file_main_dex] - build_utils.CheckOutput(package_command, print_stderr=False) - - # When an empty res/ directory is passed, aapt does not write an R.txt. - if not os.path.exists(r_txt_path): - build_utils.Touch(r_txt_path) - - if not options.include_all_resources: - # --include-all-resources can only be specified for generating final R - # classes for APK. It makes no sense for APK to have pre-generated R.txt - # though, because aapt-generated already lists all available resources. - if options.r_text_in: - r_txt_path = options.r_text_in - - packages = list(options.extra_res_packages) - r_txt_files = list(options.extra_r_text_files) - - cur_package = options.custom_package - if not options.custom_package: - cur_package = _ExtractPackageFromManifest(options.android_manifest) - - # Don't create a .java file for the current resource target when: - # - no package name was provided (either by manifest or build rules), - # - there was already a dependent android_resources() with the same - # package (occurs mostly when an apk target and resources target share - # an AndroidManifest.xml) - if cur_package != 'org.dummy' and cur_package not in packages: - packages.append(cur_package) - r_txt_files.append(r_txt_path) - - if packages: - shared_resources = options.shared_resources or options.app_as_shared_lib - CreateRJavaFiles(srcjar_dir, r_txt_path, packages, r_txt_files, - shared_resources, options.non_constant_id) - - # This is the list of directories with resources to put in the final .zip - # file. The order of these is important so that crunched/v14 resources - # override the normal ones. - zip_resource_dirs = input_resource_dirs + [v14_dir] - - base_crunch_dir = os.path.join(temp_dir, 'crunch') - - # Crunch image resources. This shrinks png files and is necessary for - # 9-patch images to display correctly. 'aapt crunch' accepts only a single - # directory at a time and deletes everything in the output directory. - for idx, input_dir in enumerate(input_resource_dirs): - crunch_dir = os.path.join(base_crunch_dir, str(idx)) - build_utils.MakeDirectory(crunch_dir) - zip_resource_dirs.append(crunch_dir) - CrunchDirectory(aapt, input_dir, crunch_dir) - - if options.resource_zip_out: - ZipResources(zip_resource_dirs, options.resource_zip_out) - - if options.all_resources_zip_out: - all_zips = [options.resource_zip_out] if options.resource_zip_out else [] - all_zips += dep_zips - CombineZips(all_zips, - options.all_resources_zip_out, options.support_zh_hk) - - if options.srcjar_out: - build_utils.ZipDir(options.srcjar_out, srcjar_dir) - - if options.r_text_out: - shutil.copyfile(r_txt_path, options.r_text_out) + dep_subdirs = _ExtractDeps(options.dependencies_res_zips, deps_dir) + + if options.apk_path: + _PackageApk(options, dep_subdirs, temp_dir, gen_dir, r_txt_path) + else: + _PackageLibrary(options, dep_subdirs, temp_dir, gen_dir) + + _CreateRTxtAndSrcJar(options, r_txt_path, srcjar_dir) def main(args): @@ -561,8 +967,8 @@ def main(args): # Order of these must match order specified in GN so that the correct one # appears first in the depfile. possible_output_paths = [ + options.apk_path, options.resource_zip_out, - options.all_resources_zip_out, options.r_text_out, options.srcjar_out, options.proguard_file, @@ -570,24 +976,40 @@ def main(args): ] output_paths = [x for x in possible_output_paths if x] + if options.apk_path and options.create_density_splits: + for _, dst_path in _GenerateDensitySplitPaths(options.apk_path): + output_paths.append(dst_path) + if options.apk_path and options.language_splits: + output_paths.extend( + _GenerateLanguageSplitOutputPaths(options.apk_path, + options.language_splits)) + # List python deps in input_strings rather than input_paths since the contents # of them does not change what gets written to the depsfile. input_strings = options.extra_res_packages + [ options.app_as_shared_lib, options.custom_package, - options.include_all_resources, options.non_constant_id, options.shared_resources, options.v14_skip, + options.exclude_xxxhdpi, + options.xxxhdpi_whitelist, + str(options.debuggable), + str(options.png_to_webp), + str(options.support_zh_hk), + str(options.no_xml_namespaces), ] - if options.support_zh_hk: - input_strings.append('support_zh_hk') - input_paths = [ + if options.apk_path: + input_strings.extend(_CreateLinkApkArgs(options)) + + possible_input_paths = [ options.aapt_path, options.android_manifest, options.android_sdk_jar, + options.shared_resources_whitelist, ] + input_paths = [x for x in possible_input_paths if x] input_paths.extend(options.dependencies_res_zips) input_paths.extend(options.extra_r_text_files) diff --git a/chromium/build/android/gyp/util/build_utils.py b/chromium/build/android/gyp/util/build_utils.py index 5be45e5133e..dec818ee17e 100644 --- a/chromium/build/android/gyp/util/build_utils.py +++ b/chromium/build/android/gyp/util/build_utils.py @@ -30,10 +30,14 @@ import gn_helpers COLORAMA_ROOT = os.path.join(host_paths.DIR_SOURCE_ROOT, 'third_party', 'colorama', 'src') -# aapt should ignore OWNERS and python files in addition the default ignore -# pattern. -AAPT_IGNORE_PATTERN = ('!OWNERS:!*.py:!*.pyc:!.svn:!.git:!.ds_store:!*.scc:' + - '.*:<dir>_*:!CVS:!thumbs.db::!*~:!*.d.stamp') +AAPT_IGNORE_PATTERN = ':'.join([ + 'OWNERS', # Allow OWNERS files within res/ + '*.py', # PRESUBMIT.py sometimes exist. + '*.pyc', + '*~', # Some editors create these as temp files. + '.*', # Never makes sense to include dot(files/dirs). + '*.d.stamp', # Ignore stamp files + ]) HERMETIC_TIMESTAMP = (2001, 1, 1, 0, 0, 0) _HERMETIC_FILE_ATTR = (0644 << 16L) diff --git a/chromium/build/android/gyp/write_build_config.py b/chromium/build/android/gyp/write_build_config.py index 3df54532737..b66e879f7d3 100755 --- a/chromium/build/android/gyp/write_build_config.py +++ b/chromium/build/android/gyp/write_build_config.py @@ -33,12 +33,10 @@ import sys import xml.dom.minidom from util import build_utils -from util import md5_check - # Types that should never be used as a dependency of another build config. -_ROOT_TYPES = ('android_apk', 'deps_dex', 'java_binary', 'junit_binary', - 'resource_rewriter') +_ROOT_TYPES = ('android_apk', 'java_binary', + 'java_annotation_processor', 'junit_binary', 'resource_rewriter') # Types that should not allow code deps to pass through. _RESOURCE_TYPES = ('android_assets', 'android_resources') @@ -200,7 +198,7 @@ def _ResolveGroups(configs): ret[index:index + 1] = expanded_configs -def _FilterDepsPaths(dep_paths, target_type): +def _DepsFromPaths(dep_paths, target_type, filter_root_targets=True): """Resolves all groups and trims dependency branches that we never want. E.g. When a resource or asset depends on an apk target, the intent is to @@ -209,16 +207,13 @@ def _FilterDepsPaths(dep_paths, target_type): configs = [GetDepConfig(p) for p in dep_paths] configs = _ResolveGroups(configs) # Don't allow root targets to be considered as a dep. - configs = [c for c in configs if c['type'] not in _ROOT_TYPES] + if filter_root_targets: + configs = [c for c in configs if c['type'] not in _ROOT_TYPES] # Don't allow java libraries to cross through assets/resources. if target_type in _RESOURCE_TYPES: configs = [c for c in configs if c['type'] in _RESOURCE_TYPES] - return [c['path'] for c in configs] - - -def _AsInterfaceJar(jar_path): - return jar_path[:-3] + 'interface.jar' + return Deps([c['path'] for c in configs]) def _ExtractSharedLibsFromRuntimeDeps(runtime_deps_files): @@ -259,10 +254,14 @@ def main(argv): help='Type of this target (e.g. android_library).') parser.add_option( '--deps-configs', - help='List of paths for dependency\'s build_config files. ') + help='GN-list of dependent build_config files.') + parser.add_option( + '--annotation-processor-configs', + help='GN-list of build_config files for annotation processors.') parser.add_option( '--classpath-deps-configs', - help='List of paths for classpath dependency\'s build_config files. ') + help='GN-list of build_config files for libraries to include as ' + 'build-time-only classpath.') # android_resources options parser.add_option('--srcjar', help='Path to target\'s resources srcjar.') @@ -287,6 +286,12 @@ def main(argv): # java library options parser.add_option('--jar-path', help='Path to target\'s jar output.') + parser.add_option('--unprocessed-jar-path', + help='Path to the .jar to use for javac classpath purposes.') + parser.add_option('--interface-jar-path', + help='Path to the .interface.jar to use for javac classpath purposes.') + parser.add_option('--is-prebuilt', action='store_true', + help='Whether the jar was compiled or pre-compiled.') parser.add_option('--java-sources-file', help='Path to .sources file') parser.add_option('--bundled-srcjars', help='GYP-list of .srcjars that have been included in this java_library.') @@ -302,7 +307,8 @@ def main(argv): parser.add_option('--gradle-treat-as-prebuilt', action='store_true', help='Whether this library should be treated as a prebuilt library by ' 'generate_gradle.py.') - parser.add_option('--main-class', help='Java class for java_binary targets.') + parser.add_option('--main-class', + help='Main class for java_binary or java_annotation_processor targets.') parser.add_option('--java-resources-jar-path', help='Path to JAR that contains java resources. Everything ' 'from this JAR except meta-inf/ content and .class files ' @@ -338,11 +344,11 @@ def main(argv): parser.add_option('--proguard-enabled', action='store_true', help='Whether proguard is enabled for this apk.') parser.add_option('--proguard-configs', - help='GYP-list of proguard flag files to use in final apk.') + help='GN-list of proguard flag files to use in final apk.') parser.add_option('--proguard-info', help='Path to the proguard .info output for this apk.') parser.add_option('--fail', - help='GYP-list of error message lines to fail with.') + help='GN-list of error message lines to fail with.') options, args = parser.parse_args(argv) @@ -351,16 +357,17 @@ def main(argv): if options.fail: parser.error('\n'.join(build_utils.ParseGnList(options.fail))) + jar_path_options = ['jar_path', 'unprocessed_jar_path', 'interface_jar_path'] required_options_map = { - 'java_binary': ['build_config', 'jar_path'], - 'junit_binary': ['build_config', 'jar_path'], - 'java_library': ['build_config', 'jar_path'], - 'java_prebuilt': ['build_config', 'jar_path'], + 'java_binary': ['build_config'], + 'java_annotation_processor': ['build_config', 'main_class'], + 'junit_binary': ['build_config'], + 'java_library': ['build_config'] + jar_path_options, 'android_assets': ['build_config'], 'android_resources': ['build_config', 'resources_zip'], - 'android_apk': ['build_config', 'jar_path', 'dex_path'], - 'deps_dex': ['build_config', 'dex_path'], + 'android_apk': ['build_config','dex_path'] + jar_path_options, 'dist_jar': ['build_config'], + 'dist_aar': ['build_config'], 'resource_rewriter': ['build_config'], 'group': ['build_config'], } @@ -370,34 +377,39 @@ def main(argv): build_utils.CheckOptions(options, parser, required_options) - # Java prebuilts are the same as libraries except for in gradle files. - is_java_prebuilt = options.type == 'java_prebuilt' - if is_java_prebuilt: - options.type = 'java_library' - - if options.type == 'java_library': - if options.supports_android and not options.dex_path: - raise Exception('java_library that supports Android requires a dex path.') - - if options.requires_android and not options.supports_android: - raise Exception( - '--supports-android is required when using --requires-android') - - direct_deps_config_paths = build_utils.ParseGnList(options.deps_configs) - direct_deps_config_paths = _FilterDepsPaths( - direct_deps_config_paths, options.type) - - deps = Deps(direct_deps_config_paths) - all_inputs = deps.AllConfigPaths() + if options.jar_path and options.supports_android and not options.dex_path: + raise Exception('java_library that supports Android requires a dex path.') + if any(getattr(options, x) for x in jar_path_options): + for attr in jar_path_options: + if not getattr(options, attr): + raise('Expected %s to be set.' % attr) + + if options.requires_android and not options.supports_android: + raise Exception( + '--supports-android is required when using --requires-android') + + is_java_target = options.type in ( + 'java_binary', 'junit_binary', 'java_annotation_processor', + 'java_library', 'android_apk', 'dist_aar', 'dist_jar') + + deps = _DepsFromPaths( + build_utils.ParseGnList(options.deps_configs), options.type) + processor_deps = _DepsFromPaths( + build_utils.ParseGnList(options.annotation_processor_configs or ''), + options.type, filter_root_targets=False) + classpath_deps = _DepsFromPaths( + build_utils.ParseGnList(options.classpath_deps_configs or ''), + options.type) + + all_inputs = sorted(set(deps.AllConfigPaths() + + processor_deps.AllConfigPaths() + + classpath_deps.AllConfigPaths())) direct_library_deps = deps.Direct('java_library') all_library_deps = deps.All('java_library') direct_resources_deps = deps.Direct('android_resources') all_resources_deps = deps.All('android_resources') - # Resources should be ordered with the highest-level dependency first so that - # overrides are done correctly. - all_resources_deps.reverse() # Initialize some common config. # Any value that needs to be queryable by dependents must go within deps_info. @@ -406,7 +418,7 @@ def main(argv): 'name': os.path.basename(options.build_config), 'path': options.build_config, 'type': options.type, - 'deps_configs': direct_deps_config_paths + 'deps_configs': deps.direct_deps_config_paths }, # Info needed only by generate_gradle.py. 'gradle': {} @@ -424,21 +436,18 @@ def main(argv): # Required for generating gradle files. if options.type == 'java_library': - deps_info['is_prebuilt'] = is_java_prebuilt + deps_info['is_prebuilt'] = bool(options.is_prebuilt) deps_info['gradle_treat_as_prebuilt'] = options.gradle_treat_as_prebuilt if options.android_manifest: deps_info['android_manifest'] = options.android_manifest - if options.type in ( - 'java_binary', 'junit_binary', 'java_library', 'android_apk'): + if is_java_target: if options.java_sources_file: deps_info['java_sources_file'] = options.java_sources_file if options.bundled_srcjars: gradle['bundled_srcjars'] = ( build_utils.ParseGnList(options.bundled_srcjars)) - else: - gradle['bundled_srcjars'] = [] gradle['dependent_android_projects'] = [] gradle['dependent_java_projects'] = [] @@ -447,7 +456,7 @@ def main(argv): if options.bootclasspath: gradle['bootclasspath'] = options.bootclasspath if options.main_class: - gradle['main_class'] = options.main_class + deps_info['main_class'] = options.main_class for c in deps.GradleLibraryProjectDeps(): if c['requires_android']: @@ -455,7 +464,6 @@ def main(argv): else: gradle['dependent_java_projects'].append(c['path']) - if options.type == 'android_apk': config['jni'] = {} all_java_sources = [c['java_sources_file'] for c in all_library_deps @@ -464,8 +472,7 @@ def main(argv): all_java_sources.append(options.java_sources_file) config['jni']['all_source'] = all_java_sources - if options.type in ( - 'java_binary', 'junit_binary', 'java_library', 'dist_jar'): + if is_java_target: deps_info['requires_android'] = options.requires_android deps_info['supports_android'] = options.supports_android @@ -483,10 +490,14 @@ def main(argv): raise Exception('Not all deps support the Android platform: ' + str(deps_not_support_android)) - if options.type in ( - 'java_binary', 'junit_binary', 'java_library', 'android_apk'): - deps_info['jar_path'] = options.jar_path - if options.type == 'android_apk' or options.supports_android: + if is_java_target: + # Classpath values filled in below (after applying tested_apk_config). + config['javac'] = {} + if options.jar_path: + deps_info['jar_path'] = options.jar_path + deps_info['unprocessed_jar_path'] = options.unprocessed_jar_path + deps_info['interface_jar_path'] = options.interface_jar_path + if options.dex_path: deps_info['dex_path'] = options.dex_path if options.type == 'android_apk': deps_info['apk_path'] = options.apk_path @@ -496,33 +507,24 @@ def main(argv): deps_info['non_native_packed_relocations'] = str( options.non_native_packed_relocations) - requires_javac_classpath = options.type in ( - 'java_binary', 'junit_binary', 'java_library', 'android_apk', 'dist_jar') - requires_full_classpath = ( - options.type == 'java_prebuilt' or requires_javac_classpath) - - if requires_javac_classpath: - # Classpath values filled in below (after applying tested_apk_config). - config['javac'] = {} - - if options.type == 'java_library': - # android_resources targets use this srcjars field to expose R.java files. - # Since there is no java_library associated with an android_resources(), - # Each java_library recompiles the R.java files. - # junit_binary and android_apk create their own R.java srcjars, so should - # not pull them in from deps here. - config['javac']['srcjars'] = [ - c['srcjar'] for c in all_resources_deps if 'srcjar' in c] - - # Used to strip out R.class for android_prebuilt()s. - config['javac']['resource_packages'] = [ - c['package_name'] for c in all_resources_deps if 'package_name' in c] - elif options.type in ('android_apk', 'java_binary', 'junit_binary'): - # Apks will get their resources srcjar explicitly passed to the java step - config['javac']['srcjars'] = [] - # Gradle may need to generate resources for some apks. - gradle['srcjars'] = [ - c['srcjar'] for c in direct_resources_deps if 'srcjar' in c] + if options.type == 'java_library': + # android_resources targets use this srcjars field to expose R.java files. + # Since there is no java_library associated with an android_resources(), + # Each java_library recompiles the R.java files. + # junit_binary and android_apk create their own R.java srcjars, so should + # not pull them in from deps here. + config['javac']['srcjars'] = [ + c['srcjar'] for c in all_resources_deps if 'srcjar' in c] + + # Used to strip out R.class for android_prebuilt()s. + config['javac']['resource_packages'] = [ + c['package_name'] for c in all_resources_deps if 'package_name' in c] + else: + # Apks will get their resources srcjar explicitly passed to the java step + config['javac']['srcjars'] = [] + # Gradle may need to generate resources for some apks. + gradle['srcjars'] = [ + c['srcjar'] for c in direct_resources_deps if 'srcjar' in c] if options.type == 'android_assets': all_asset_sources = [] @@ -578,11 +580,12 @@ def main(argv): if c['supports_android']: owned_resource_dirs.difference_update(c['owned_resources_dirs']) owned_resource_zips.difference_update(c['owned_resources_zips']) - deps_info['owned_resources_dirs'] = list(owned_resource_dirs) - deps_info['owned_resources_zips'] = list(owned_resource_zips) + deps_info['owned_resources_dirs'] = sorted(owned_resource_dirs) + deps_info['owned_resources_zips'] = sorted(owned_resource_zips) if options.type in ( - 'android_resources', 'android_apk', 'junit_binary', 'resource_rewriter'): + 'android_resources', 'android_apk', 'junit_binary', 'resource_rewriter', + 'dist_aar'): config['resources'] = {} config['resources']['dependency_zips'] = [ c['resources_zip'] for c in all_resources_deps] @@ -597,29 +600,47 @@ def main(argv): config['resources']['extra_package_names'] = extra_package_names config['resources']['extra_r_text_files'] = extra_r_text_files - if options.type in ['android_apk', 'deps_dex']: + if options.type == 'android_apk': deps_dex_files = [c['dex_path'] for c in all_library_deps] - if requires_javac_classpath: - extra_jars = [] - if options.extra_classpath_jars: - extra_jars += build_utils.ParseGnList(options.extra_classpath_jars) - - if options.classpath_deps_configs: - config_paths = build_utils.ParseGnList(options.classpath_deps_configs) - classpath_deps = Deps(_FilterDepsPaths(config_paths, options.type)) - extra_jars += [ - c['jar_path'] for c in classpath_deps.Direct('java_library')] + if is_java_target: + # The classpath used to compile this target when annotation processors are + # present. + javac_classpath = [c['unprocessed_jar_path'] for c in direct_library_deps] + # The classpath used to compile this target when annotation processors are + # not present. These are also always used to know when a target needs to be + # rebuilt. + javac_interface_classpath = [ + c['interface_jar_path'] for c in direct_library_deps] + # The classpath used for error prone. + javac_full_interface_classpath = [ + c['interface_jar_path'] for c in all_library_deps] + # The classpath used for bytecode-rewritting. + javac_full_classpath = [c['unprocessed_jar_path'] for c in all_library_deps] + # The classpath to use to run this target (or as an input to ProGuard). + java_full_classpath = [] + if options.jar_path: + java_full_classpath.append(options.jar_path) + java_full_classpath.extend(c['jar_path'] for c in all_library_deps) - javac_classpath = [c['jar_path'] for c in direct_library_deps] - if requires_full_classpath: - java_full_classpath = [c['jar_path'] for c in all_library_deps] + # Deps to add to the compile-time classpath (but not the runtime classpath). + # TODO(agrieve): Might be less confusing to fold these into bootclasspath. + extra_jars = [c['unprocessed_jar_path'] + for c in classpath_deps.Direct('java_library')] + if options.extra_classpath_jars: + # These are .jars to add to javac classpath but not to runtime classpath. + extra_jars.extend(build_utils.ParseGnList(options.extra_classpath_jars)) + + extra_jars = [p for p in extra_jars if p not in javac_classpath] + javac_classpath.extend(extra_jars) + javac_interface_classpath.extend(extra_jars) + javac_full_interface_classpath.extend( + p for p in extra_jars if p not in javac_full_classpath) + javac_full_classpath.extend( + p for p in extra_jars if p not in javac_full_classpath) if extra_jars: deps_info['extra_classpath_jars'] = extra_jars - javac_classpath += [p for p in extra_jars if p not in javac_classpath] - java_full_classpath += [ - p for p in extra_jars if p not in java_full_classpath] # The java code for an instrumentation test apk is assembled differently for # ProGuard vs. non-ProGuard. @@ -638,24 +659,32 @@ def main(argv): if options.type == 'android_apk' and options.tested_apk_config: tested_apk_config = GetDepConfig(options.tested_apk_config) - expected_tested_package = tested_apk_config['package_name'] - AndroidManifest(options.android_manifest).CheckInstrumentationElements( - expected_tested_package) - if options.proguard_enabled: - # Add all tested classes to the test's classpath to ensure that the test's - # java code is a superset of the tested apk's java code - java_full_classpath += [ - jar for jar in tested_apk_config['java']['full_classpath'] - if jar not in java_full_classpath] - if tested_apk_config['proguard_enabled']: assert options.proguard_enabled, ('proguard must be enabled for ' 'instrumentation apks if it\'s enabled for the tested apk.') + expected_tested_package = tested_apk_config['package_name'] + AndroidManifest(options.android_manifest).CheckInstrumentationElements( + expected_tested_package) + + # Add all tested classes to the test's classpath to ensure that the test's + # java code is a superset of the tested apk's java code + java_full_classpath.extend( + p for p in tested_apk_config['java_runtime_classpath'] + if p not in java_full_classpath) # Include in the classpath classes that are added directly to the apk under # test (those that are not a part of a java_library). - javac_classpath.append(tested_apk_config['jar_path']) - java_full_classpath.append(tested_apk_config['jar_path']) + javac_classpath.append(tested_apk_config['unprocessed_jar_path']) + javac_full_classpath.append(tested_apk_config['unprocessed_jar_path']) + javac_interface_classpath.append(tested_apk_config['interface_jar_path']) + javac_full_interface_classpath.append( + tested_apk_config['interface_jar_path']) + javac_full_interface_classpath.extend( + p for p in tested_apk_config['javac_full_interface_classpath'] + if p not in javac_full_interface_classpath) + javac_full_classpath.extend( + p for p in tested_apk_config['javac_full_classpath'] + if p not in javac_full_classpath) # Exclude dex files from the test apk that exist within the apk under test. # TODO(agrieve): When proguard is enabled, this filtering logic happens @@ -667,53 +696,53 @@ def main(argv): p for p in deps_dex_files if not p in tested_apk_deps_dex_files] if options.proguard_configs: - assert options.type == 'java_library' deps_info['proguard_configs'] = ( build_utils.ParseGnList(options.proguard_configs)) - if options.type in ('android_apk', 'dist_jar'): + if options.type in ('android_apk', 'dist_aar', 'dist_jar'): deps_info['proguard_enabled'] = options.proguard_enabled deps_info['proguard_info'] = options.proguard_info config['proguard'] = {} proguard_config = config['proguard'] - proguard_config['input_paths'] = list(java_full_classpath) - if options.jar_path: - proguard_config['input_paths'].insert(0, options.jar_path) - extra_jars = set() - lib_configs = set() + extra_jars = [] + all_configs = deps_info.get('proguard_configs', []) for c in all_library_deps: - extra_jars.update(c.get('extra_classpath_jars', ())) - lib_configs.update(c.get('proguard_configs', ())) - proguard_config['lib_paths'] = list(extra_jars) - proguard_config['lib_configs'] = list(lib_configs) - - # Dependencies for the final dex file of an apk or a 'deps_dex'. - if options.type in ['android_apk', 'deps_dex']: + extra_jars.extend( + p for p in c.get('extra_classpath_jars', []) if p not in extra_jars) + all_configs.extend( + p for p in c.get('proguard_configs', []) if p not in all_configs) + proguard_config['extra_jars'] = extra_jars + proguard_config['all_configs'] = all_configs + + # Dependencies for the final dex file of an apk. + if options.type == 'android_apk': config['final_dex'] = {} dex_config = config['final_dex'] dex_config['dependency_dex_files'] = deps_dex_files - if requires_javac_classpath: + if is_java_target: config['javac']['classpath'] = javac_classpath - javac_interface_classpath = [ - _AsInterfaceJar(p) for p in javac_classpath - if p not in deps_info.get('extra_classpath_jars', [])] - javac_interface_classpath += deps_info.get('extra_classpath_jars', []) config['javac']['interface_classpath'] = javac_interface_classpath - - if requires_full_classpath: - deps_info['java'] = { - 'full_classpath': java_full_classpath, - } + # Direct() will be of type 'java_annotation_processor'. + config['javac']['processor_classpath'] = [ + c['jar_path'] for c in processor_deps.Direct() if c.get('jar_path')] + [ + c['jar_path'] for c in processor_deps.All('java_library')] + config['javac']['processor_classes'] = [ + c['main_class'] for c in processor_deps.Direct()] + deps_info['javac_full_classpath'] = javac_full_classpath + deps_info['javac_full_interface_classpath'] = javac_full_interface_classpath + + if options.type in ( + 'android_apk', 'dist_jar', 'java_binary', 'junit_binary'): + deps_info['java_runtime_classpath'] = java_full_classpath if options.type in ('android_apk', 'dist_jar'): - dependency_jars = [c['jar_path'] for c in all_library_deps] - all_interface_jars = [_AsInterfaceJar(p) for p in dependency_jars] - if options.type == 'android_apk': - all_interface_jars.append(_AsInterfaceJar(options.jar_path)) + all_interface_jars = [] + if options.jar_path: + all_interface_jars.append(options.interface_jar_path) + all_interface_jars.extend(c['interface_jar_path'] for c in all_library_deps) config['dist_jar'] = { - 'dependency_jars': dependency_jars, 'all_interface_jars': all_interface_jars, } @@ -770,7 +799,7 @@ def main(argv): if jar not in tested_apk_resource_jars] config['java_resources_jars'] = java_resources_jars - if options.type == 'java_library' and options.java_resources_jar_path: + if options.java_resources_jar_path: deps_info['java_resources_jar'] = options.java_resources_jar_path build_utils.WriteJson(config, options.build_config, only_if_changed=True) diff --git a/chromium/build/android/gyp/write_ordered_libraries.py b/chromium/build/android/gyp/write_ordered_libraries.py index f656adfe30a..dda25b8d0bf 100755 --- a/chromium/build/android/gyp/write_ordered_libraries.py +++ b/chromium/build/android/gyp/write_ordered_libraries.py @@ -28,92 +28,65 @@ import sys from util import build_utils _readelf = None -_library_dirs = None _library_re = re.compile( '.*NEEDED.*Shared library: \[(?P<library_name>.+)\]') +_library_path_map = {} + def SetReadelfPath(path): global _readelf _readelf = path -def SetLibraryDirs(dirs): - global _library_dirs - _library_dirs = dirs - - -def FullLibraryPath(library_name): - assert _library_dirs is not None - for directory in _library_dirs: - path = '%s/%s' % (directory, library_name) - if os.path.exists(path): - return path - return library_name - - -def IsSystemLibrary(library_name): - # If the library doesn't exist in the libraries directory, assume that it is - # an Android system library. - return not os.path.exists(FullLibraryPath(library_name)) - - def CallReadElf(library_or_executable): assert _readelf is not None - readelf_cmd = [_readelf, - '-d', - FullLibraryPath(library_or_executable)] + readelf_cmd = [_readelf, '-d', library_or_executable] return build_utils.CheckOutput(readelf_cmd) def GetDependencies(library_or_executable): elf = CallReadElf(library_or_executable) - return set(_library_re.findall(elf)) - - -def GetNonSystemDependencies(library_name): - all_deps = GetDependencies(library_name) - return set((lib for lib in all_deps if not IsSystemLibrary(lib))) + deps = set() + for l in _library_re.findall(elf): + p = _library_path_map.get(l) + if p is not None: + deps.add(p) + return deps def GetSortedTransitiveDependencies(libraries): """Returns all transitive library dependencies in dependency order.""" return build_utils.GetSortedTransitiveDependencies( - libraries, GetNonSystemDependencies) - - -def GetSortedTransitiveDependenciesForBinaries(binaries): - if binaries[0].endswith('.so'): - libraries = [os.path.basename(lib) for lib in binaries] - else: - assert len(binaries) == 1 - all_deps = GetDependencies(binaries[0]) - libraries = [lib for lib in all_deps if not IsSystemLibrary(lib)] - - return GetSortedTransitiveDependencies(libraries) + libraries, GetDependencies) def main(): parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) - parser.add_option('--input-libraries', - help='A list of top-level input libraries.') - parser.add_option('--libraries-dir', - help='The directory which contains shared libraries.') parser.add_option('--readelf', help='Path to the readelf binary.') + parser.add_option('--runtime-deps', + help='A file created for the target using write_runtime_deps.') parser.add_option('--output', help='Path to the generated .json file.') parser.add_option('--stamp', help='Path to touch on success.') options, _ = parser.parse_args(build_utils.ExpandFileArgs(sys.argv[1:])) SetReadelfPath(options.readelf) - SetLibraryDirs(options.libraries_dir.split(',')) - libraries = build_utils.ParseGnList(options.input_libraries) - if len(libraries): - libraries = GetSortedTransitiveDependenciesForBinaries(libraries) + unsorted_lib_paths = [] + for f in open(options.runtime_deps): + f = f[:-1] + if f.endswith('.so'): + p = f.replace('lib.unstripped/', '') + unsorted_lib_paths.append(p) + _library_path_map[os.path.basename(p)] = p + + lib_paths = GetSortedTransitiveDependencies(unsorted_lib_paths) + + libraries = [os.path.basename(l) for l in lib_paths] # Convert to "base" library names: e.g. libfoo.so -> foo java_libraries_list = ( @@ -121,7 +94,7 @@ def main(): out_json = { 'libraries': libraries, - 'lib_paths': [FullLibraryPath(l) for l in libraries], + 'lib_paths': lib_paths, 'java_libraries_list': java_libraries_list } build_utils.WriteJson( diff --git a/chromium/build/android/install_emulator_deps.py b/chromium/build/android/install_emulator_deps.py deleted file mode 100755 index 1690df33ec2..00000000000 --- a/chromium/build/android/install_emulator_deps.py +++ /dev/null @@ -1,318 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Installs deps for using SDK emulator for testing. - -The script will download the SDK and system images, if they are not present, and -install and enable KVM, if virtualization has been enabled in the BIOS. -""" - - -import logging -import optparse -import os -import re -import sys - -import devil_chromium -from devil.utils import cmd_helper -from devil.utils import run_tests_helper -from pylib import constants -from pylib import pexpect - -# Android API level -DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION -# Android ABI/Arch -DEFAULT_ABI = 'x86' - -# Default Time out for downloading SDK component -DOWNLOAD_SYSTEM_IMAGE_TIMEOUT = 300 -DOWNLOAD_SDK_PLATFORM_TIMEOUT = 300 - -def CheckSDK(): - """Check if SDK is already installed. - - Returns: - True if the emulator SDK directory (src/android_emulator_sdk/) exists. - """ - return os.path.exists(constants.ANDROID_SDK_ROOT) - - -def CheckSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL, google=False): - """Check if the "SDK Platform" for the specified API level is installed. - This is necessary in order for the emulator to run when the target - is specified. - - Args: - abi: target abi, x86 or arm - api_level: the Android API level to check; defaults to the latest API. - google: use Google build system image instead of AOSP build - - Returns: - True if the platform is already installed. - """ - android_binary = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android') - if google: - pattern = re.compile('id: [0-9]+ or "Google Inc.:Google APIs:%s"' % - api_level) - else: - pattern = re.compile('id: [0-9]+ or "android-%d"' % api_level) - - try: - exit_code, stdout = cmd_helper.GetCmdStatusAndOutput( - [android_binary, 'list']) - if exit_code != 0: - raise Exception('\'android list\' command failed') - for line in stdout.split('\n'): - if pattern.match(line): - return True - return False - except OSError: - logging.exception('Unable to execute \'android list\'') - return False - - -def CheckSystemImage(abi, api_level=DEFAULT_ANDROID_API_LEVEL, google=False): - """Check if Android system images have been installed. - - Args: - abi: target abi, x86 or arm - api_level: the Android API level to check for; defaults to the latest API. - google: use Google build system image instead of AOSP build - - Returns: - True if x86 image has been previously downloaded. - """ - api_target = 'android-%d' % api_level - system_image_root = os.path.join(constants.ANDROID_SDK_ROOT, - 'system-images', api_target) - if abi == 'x86': - if google: - return os.path.exists(os.path.join(system_image_root, 'google_apis', - 'x86')) - else: - return os.path.exists(os.path.join(system_image_root, 'default', 'x86')) - elif abi == 'arm': - if google: - return os.path.exists(os.path.join(system_image_root, 'google_apis', - 'armeabi-v7a')) - else: - return os.path.exists(os.path.join(system_image_root, 'default', - 'armeabi-v7a')) - else: - raise Exception("abi option invalid") - -def CheckKVM(): - """Quickly check whether KVM is enabled. - - Returns: - True iff /dev/kvm exists (Linux only). - """ - return os.path.exists('/dev/kvm') - -def RunKvmOk(): - """Run kvm-ok as root to check that KVM is properly enabled after installation - of the required packages. - - Returns: - True iff KVM is enabled (/dev/kvm exists). On failure, returns False - but also print detailed information explaining why KVM isn't enabled - (e.g. CPU doesn't support it, or BIOS disabled it). - """ - try: - # Note: kvm-ok is in /usr/sbin, so always use 'sudo' to run it. - return not cmd_helper.RunCmd(['sudo', 'kvm-ok']) - except OSError: - logging.info('kvm-ok not installed') - return False - - -def InstallKVM(): - """Installs KVM packages.""" - rc = cmd_helper.RunCmd(['sudo', 'apt-get', 'install', 'kvm']) - if rc: - logging.critical('ERROR: Did not install KVM. Make sure hardware ' - 'virtualization is enabled in BIOS (i.e. Intel VT-x or ' - 'AMD SVM).') - # TODO(navabi): Use modprobe kvm-amd on AMD processors. - rc = cmd_helper.RunCmd(['sudo', 'modprobe', 'kvm-intel']) - if rc: - logging.critical('ERROR: Did not add KVM module to Linux Kernel. Make sure ' - 'hardware virtualization is enabled in BIOS.') - # Now check to ensure KVM acceleration can be used. - if not RunKvmOk(): - logging.critical('ERROR: Can not use KVM acceleration. Make sure hardware ' - 'virtualization is enabled in BIOS (i.e. Intel VT-x or ' - 'AMD SVM).') - - -def UpdateSDK(api_level, package_name, package_pattern, timeout): - """This function update SDK with a filter index. - - Args: - api_level: the Android API level to download for. - package_name: logging name of package that is being updated. - package_pattern: the pattern to match the filter index from. - timeout: the amount of time wait for update command. - """ - android_binary = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android') - - list_sdk_repo_command = [android_binary, 'list', 'sdk', '--all'] - - exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(list_sdk_repo_command) - - if exit_code != 0: - raise Exception('\'android list sdk --all\' command return %d' % exit_code) - - for line in stdout.split('\n'): - match = package_pattern.match(line) - if match: - index = match.group(1) - logging.info('package %s corresponds to %s with api level %d', - index, package_name, api_level) - update_command = [android_binary, 'update', 'sdk', '--no-ui', '--all', - '--filter', index] - update_command_str = ' '.join(update_command) - logging.info('running update command: %s', update_command_str) - update_process = pexpect.spawn(update_command_str) - - if update_process.expect('Do you accept the license') != 0: - raise Exception('License agreement check failed') - update_process.sendline('y') - if update_process.expect( - 'Done. 1 package installed.', timeout=timeout) == 0: - logging.info('Successfully installed %s for API level %d', - package_name, api_level) - return - else: - raise Exception('Failed to install platform update') - raise Exception('Could not find android-%d update for the SDK!' % api_level) - -def GetSystemImage(abi, api_level=DEFAULT_ANDROID_API_LEVEL, google=False): - """Download system image files - - Args: - abi: target abi, x86 or arm - api_level: the Android API level to download for. - google: use Google build system image instead of AOSP build - """ - logging.info('Download x86 system image directory into sdk directory.') - - if abi == 'x86': - if google: - package_name = 'Google Intel x86 Atom System Image' - pattern = re.compile( - r'\s*([0-9]+)- Google APIs Intel x86 Atom System Image, Google Inc.' - ' API %d.*' % api_level) - else: - package_name = 'Intel x86 system image' - pattern = re.compile( - r'\s*([0-9]+)- Intel x86 Atom System Image, Android API %d.*' - % api_level) - elif abi == 'arm': - if google: - package_name = 'Google arm system image' - pattern = re.compile( - r'\s*([0-9]+)- Google APIs ARM EABI v7a System Image, Google Inc. API ' - '%d.*' % api_level) - else: - package_name = 'Android arm system image' - pattern = re.compile( - r'\s*([0-9]+)- ARM EABI v7a System Image, Android API %d.*' % api_level) - else: - raise Exception('abi option is invalid') - - UpdateSDK(api_level, package_name, pattern, DOWNLOAD_SYSTEM_IMAGE_TIMEOUT) - -def GetSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL, google=False): - """Update the SDK to include the platform specified. - - Args: - api_level: the Android API level to download - google: use Google build system image instead of AOSP build - """ - logging.info('Download SDK Platform directory into sdk directory.') - - platform_package_pattern = re.compile( - r'\s*([0-9]+)- SDK Platform Android [\.,0-9]+, API %d.*' % api_level) - - UpdateSDK(api_level, 'SDK Platform', platform_package_pattern, - DOWNLOAD_SDK_PLATFORM_TIMEOUT) - - if google: - google_api_package_pattern = re.compile( - r'\s*([0-9]+)- Google APIs, Android API %d.*' % api_level) - UpdateSDK(api_level, 'Google APIs', google_api_package_pattern, - DOWNLOAD_SDK_PLATFORM_TIMEOUT) - - -def main(argv): - opt_parser = optparse.OptionParser( - description='Install dependencies for running the Android emulator') - opt_parser.add_option('--abi', - dest='abi', - help='The targeted abi for emulator system image', - type='string', - default=DEFAULT_ABI) - opt_parser.add_option('--api-level', - dest='api_level', - help=('The API level (e.g., 19 for Android 4.4) to ' - 'ensure is available'), - type='int', - default=DEFAULT_ANDROID_API_LEVEL) - opt_parser.add_option('-v', - dest='verbosity', - default=1, - action='count', - help='Verbose level (multiple times for more)') - opt_parser.add_option('--google', - dest='google', - action='store_true', - default=False, - help='Install Google System Image instead of AOSP') - - options, _ = opt_parser.parse_args(argv[1:]) - - run_tests_helper.SetLogLevel(verbose_count=options.verbosity) - - devil_chromium.Initialize() - - # Calls below will download emulator SDK and/or system images only if needed. - if CheckSDK(): - logging.info('android_emulator_sdk/ exists') - else: - logging.critical('ERROR: Emulator SDK not installed in %s' - , constants.ANDROID_SDK_ROOT) - return 1 - - # Check target. The target has to be installed in order to run the emulator. - if CheckSDKPlatform(options.api_level, options.google): - logging.info('SDK platform %s %s android-%d already present, skipping.', - 'Google' if options.google else 'AOSP', options.abi, - options.api_level) - else: - logging.info('SDK platform %s %s android-%d not present, installing.', - 'Google' if options.google else 'AOSP', options.abi, - options.api_level) - GetSDKPlatform(options.api_level, options.google) - - # Download the system image needed - if CheckSystemImage(options.abi, options.api_level, options.google): - logging.info('system image for %s %s android-%d already present, skipping.', - 'Google' if options.google else 'AOSP', options.abi, - options.api_level) - else: - GetSystemImage(options.abi, options.api_level, options.google) - - # Make sure KVM packages are installed and enabled. - if options.abi == 'x86': - if CheckKVM(): - logging.info('KVM already installed and enabled.') - else: - logging.warning('KVM is not installed or enabled.') - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/chromium/build/android/lint/suppressions.xml b/chromium/build/android/lint/suppressions.xml index ef84286d79f..49d8aa0892f 100644 --- a/chromium/build/android/lint/suppressions.xml +++ b/chromium/build/android/lint/suppressions.xml @@ -25,6 +25,8 @@ Still reading? <issue id="AllowBackup"> <ignore path="AndroidManifest.xml"/> </issue> + <!-- TODO(crbug.com/799070): File bugs to fix this --> + <issue id="AppCompatResource" severity="ignore"/> <!-- We use asserts in Chromium. See https://chromium.googlesource.com/chromium/src/+/master/styleguide/java/java.md#Asserts --> <issue id="Assert" severity="ignore"/> <issue id="AuthLeak" severity="Error"> @@ -44,6 +46,7 @@ Still reading? <issue id="ByteOrderMark" severity="Error"> <ignore regexp="values-pt-rBR/android_chrome_strings.xml"/> </issue> + <issue id="ClickableViewAccessibility" severity="ignore"/> <issue id="CommitPrefEdits"> <ignore regexp="third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java"/> </issue> @@ -68,6 +71,12 @@ Still reading? <ignore regexp="content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java"/> <ignore regexp="content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java"/> </issue> + <!-- TODO(crbug.com/799070): File bugs to fix this --> + <issue id="EllipsizeMaxLines" severity="ignore"/> + <issue id="ExifInterface"> + <!-- TODO(crbug.com/799070): Update android.support.media.ExifInterface and use it instead --> + <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java"/> + </issue> <issue id="ExportedContentProvider"> <ignore path="AndroidManifest.xml"/> </issue> @@ -82,6 +91,10 @@ Still reading? <issue id="GoogleAppIndexingWarning" severity="Error"> <ignore regexp="AndroidManifest.xml"/> </issue> + <!-- TODO(crbug.com/799070): Fix for remoting --> + <issue id="AppLinkUrlError"> + <ignore regexp="AndroidManifest.xml"/> + </issue> <issue id="HandlerLeak"> <ignore regexp="android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java" /> <ignore regexp="chromecast/internal" /> @@ -117,6 +130,8 @@ Still reading? </issue> <issue id="IconDipSize"> <ignore regexp="chromecast/internal"/> + <!-- TODO(crbug.com/799070): File bugs to fix these icons --> + <ignore regexp="chrome/android/java/res/.*tab_strip_fade"/> </issue> <issue id="IconDuplicates" severity="Error"> <ignore regexp="chromecast/internal"/> @@ -124,6 +139,10 @@ Still reading? <issue id="IconDuplicatesConfig" severity="Error"> <ignore regexp="chromecast/internal"/> </issue> + <issue id="IconLauncherFormat" severity="ignore"> + <!-- TODO(crbug.com/739746): Remove after lint version has been updated. --> + <ignore regexp="remoting/android/java/res/mipmap-anydpi-v26/ic_launcher.xml"/> + </issue> <issue id="IconLauncherShape" severity="Error"> <ignore regexp="chromecast/internal"/> <ignore regexp="chrome/android/webapk/shell_apk/res/mipmap-mdpi/ic_launcher_background.png"/> @@ -162,9 +181,12 @@ Still reading? <issue id="InvalidPackage" severity="Error"> <ignore regexp="espresso/espresso_core_java.interface.jar"/> </issue> + <issue id="InvalidVectorPath" severity="ignore"/> <issue id="LabelFor" severity="Error"> <ignore regexp="android_webview/tools/system_webview_shell/apk/res/layout/activity_webview_browser.xml"/> </issue> + <!-- TODO(crbug.com/799070): File bugs to fix this. --> + <issue id="KeyboardInaccessibleWidget" severity="ignore"/> <issue id="LintError" severity="Error"/> <issue id="LogConditional" severity="ignore"/> <issue id="LongLogTag" severity="ignore"/> @@ -202,6 +224,9 @@ Still reading? <ignore regexp="Call requires API level 19.*`java.lang.Throwable#addSuppressed`"/> <!-- We support default methods via desugar. --> <ignore regexp="Default method requires API level 24"/> + <!-- TODO(crbug.com/799070): Fix these after lint upgrade. --> + <ignore regexp="Static interface method requires API level 24"/> + <ignore regexp="(current min is 1)"/> <!-- Suppressions below this line need rationale :( --> <ignore regexp="Attribute `paddingStart` referenced here can result in a crash on some specific devices older than API 17"/> <ignore regexp="chrome/android/java/res/values-v17/styles.xml"/> @@ -227,6 +252,8 @@ Still reading? <!-- TODO(crbug.com/635567): Fix this properly. --> <ignore regexp="sdk/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java"/> </issue> + <!-- TODO(crbug.com/799070): Re-enable this --> + <issue id="ObsoleteSdkInt" severity="ignore"/> <issue id="OldTargetApi"> <ignore path="AndroidManifest.xml"/> </issue> @@ -247,14 +274,16 @@ Still reading? </issue> <issue id="PackageManagerGetSignatures"> <ignore regexp="chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java"/> - <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/customtabs/OriginVerifier.java"/> + <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/browserservices/OriginVerifier.java"/> </issue> <issue id="PluralsCandidate" severity="Error"> <ignore regexp="chrome/android/chrome_strings_grd.resources.zip/values-en-rGB/android_chrome_strings.xml"/> <ignore regexp="chrome/android/chrome_strings_grd.resources.zip/values/android_chrome_strings.xml"/> </issue> + <issue id="PrivateApi" severity="ignore"/> <issue id="Recycle" severity="ignore"/> <issue id="Registered" severity="ignore"/> + <issue id="ResourceAsColor" severity="ignore"/> <issue id="ResourceType" severity="Error"> <ignore regexp="/javatests/"/> </issue> @@ -269,6 +298,10 @@ Still reading? <issue id="SpUsage" severity="Error"> <ignore regexp="chromecast/internal"/> </issue> + <issue id="StaticFieldLeak"> + <!-- TODO(crbug.com/799070): Fix after upgrading lint. --> + <ignore regexp="This AsyncTask class should be static or leaks might occur"/> + </issue> <issue id="StringFormatCount" severity="Error"> <ignore regexp="chrome/android/chrome_strings_grd.resources.zip/values-cs/android_chrome_strings.xml"/> <ignore regexp="chrome/android/chrome_strings_grd.resources.zip/values-pl/android_chrome_strings.xml"/> @@ -328,7 +361,7 @@ Still reading? <!-- 2 resources used by android webview glue layer, could be refactored --> <ignore regexp="android_webview/java/res/drawable-hdpi/ic_play_circle_outline_black_48dp.png"/> <ignore regexp="R.string.private_browsing_warning"/> - <!-- OMR1 SDK roll mystery. TODO(jbudorick): Remove this after rolling lint. --> + <!-- 9 OMR1 SDK roll mystery. TODO(jbudorick): Remove this after rolling lint. --> <ignore regexp="chrome/android/chrome_strings_grd.resources.zip/values/android_chrome_strings.xml"/> <ignore regexp="chrome/android/java/res/layout/location_bar.xml"/> <ignore regexp="chrome/android/java/res/values/colors.xml"/> @@ -338,6 +371,14 @@ Still reading? <ignore regexp="chrome/android/java/res/drawable-hdpi/omnibox_info.png"/> <ignore regexp="clank/java/clank_strings_grd.resources.zip/values/android_internal_strings.xml"/> <ignore regexp="tools/android/audio_focus_grabber/java/res/drawable-hdpi/notification_icon.png"/> + <!-- # TODO(crbug.com/799070): Fix these. --> + <ignore regexp="ui/android/java/res/values/colors.xml"/> + <ignore regexp="ui/android/java/res/values/dimens.xml"/> + <ignore regexp="ui/android/java/res/values-v17/styles.xml"/> + <ignore regexp="chrome/android/java/res/anim/fullscreen_notification_in.xml"/> + <ignore regexp="chrome/android/java/res/values-v17/styles.xml"/> + <ignore regexp="chrome/android/java/res/values-v21/styles.xml"/> + <!-- Endnote: Please specify number of resources when adding more suppressions --> </issue> <issue id="UseCompoundDrawables"> <!-- Upscaling 24dp to 48dp doesn't work as expected with a TextView compound drawable. --> @@ -352,6 +393,7 @@ Still reading? <issue id="UsesMinSdkAttributes" severity="Error"> <ignore regexp="AndroidManifest.xml"/> </issue> + <issue id="UseSparseArrays" severity="ignore"/> <issue id="ValidFragment" severity="Error"> <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteDialogManager.java"/> <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java"/> @@ -359,6 +401,7 @@ Still reading? <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/OtherFormsOfHistoryDialogFragment.java"/> <ignore regexp="media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java"/> </issue> + <issue id="VectorPath" severity="ignore"/> <issue id="ViewConstructor" severity="ignore"/> <issue id="VisibleForTests" severity="Error"> <ignore regexp="/javatests/"/> @@ -372,12 +415,10 @@ Still reading? </issue> <issue id="WrongCall" severity="ignore"/> <issue id="WrongConstant"> + <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java"/> + <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java"/> <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java"/> <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java"/> - <ignore regexp="chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndSyncView.java"/> - </issue> - <issue id="IconLauncherFormat" severity="ignore"> - <!-- TODO(crbug.com/739746): Remove after lint version has been updated. --> - <ignore regexp="remoting/android/java/res/mipmap-anydpi-v26/ic_launcher.xml"/> + <ignore regexp="third_party/android_data_chart/java/src/org/chromium/third_party/android/datausagechart/ChartDataUsageView.java"/> </issue> </lint> diff --git a/chromium/build/android/pylib/constants/__init__.py b/chromium/build/android/pylib/constants/__init__.py index d7547b22ab5..e844a1ad4cf 100644 --- a/chromium/build/android/pylib/constants/__init__.py +++ b/chromium/build/android/pylib/constants/__init__.py @@ -102,7 +102,7 @@ ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT, 'build-tools', ANDROID_SDK_BUILD_TOOLS_VERSION) ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, - 'third_party', 'android_tools', 'ndk') + 'third_party', 'android_ndk') PROGUARD_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'proguard') @@ -115,6 +115,15 @@ UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' # TODO(jbudorick): Remove once unused. DEVICE_LOCAL_PROPERTIES_PATH = '/data/local.prop' +# Configure ubsan to print stack traces in the format understood by "stack" so +# that they will be symbolized, and disable signal handlers because they +# interfere with the breakpad and sandbox tests. +# This value is duplicated in +# base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java +UBSAN_OPTIONS = ( + 'print_stacktrace=1 stack_trace_format=\'#%n pc %o %m\' ' + 'handle_segv=0 handle_sigbus=0 handle_sigfpe=0') + # TODO(jbudorick): Rework this into testing/buildbot/ PYTHON_UNIT_TEST_SUITES = { 'pylib_py_unittests': { diff --git a/chromium/build/android/pylib/device/commands/BUILD.gn b/chromium/build/android/pylib/device/commands/BUILD.gn index fe17276588c..480db1e88f8 100644 --- a/chromium/build/android/pylib/device/commands/BUILD.gn +++ b/chromium/build/android/pylib/device/commands/BUILD.gn @@ -11,6 +11,7 @@ group("commands") { } android_library("chromium_commands_java") { + emma_never_instrument = true java_files = [ "java/src/org/chromium/android/commands/unzip/Unzip.java" ] dex_path = "$root_build_dir/lib.java/chromium_commands.dex.jar" data = [ diff --git a/chromium/build/android/pylib/gtest/gtest_test_instance.py b/chromium/build/android/pylib/gtest/gtest_test_instance.py index 0313b15a1ef..c3e7fb6cdc4 100644 --- a/chromium/build/android/pylib/gtest/gtest_test_instance.py +++ b/chromium/build/android/pylib/gtest/gtest_test_instance.py @@ -194,6 +194,9 @@ def ParseGTestOutput(output, symbolizer, device_abi): log.append(l) if result_type and test_name: + # Don't bother symbolizing output if the test passed. + if result_type == base_test_result.ResultType.PASS: + stack = [] results.append(base_test_result.BaseTestResult( TestNameWithoutDisabledPrefix(test_name), result_type, duration, log=symbolize_stack_and_merge_with_log())) @@ -282,16 +285,17 @@ class GtestTestInstance(test_instance.TestInstance): # TODO(jbudorick): Support multiple test suites. if len(args.suite_name) > 1: raise ValueError('Platform mode currently supports only 1 gtest suite') + self._chartjson_result_file = args.chartjson_result_file self._exe_dist_dir = None self._external_shard_index = args.test_launcher_shard_index self._extract_test_list_from_filter = args.extract_test_list_from_filter self._filter_tests_lock = threading.Lock() + self._gs_test_artifacts_bucket = args.gs_test_artifacts_bucket self._shard_timeout = args.shard_timeout self._store_tombstones = args.store_tombstones - self._total_external_shards = args.test_launcher_total_shards self._suite = args.suite_name[0] self._symbolizer = stack_symbolizer.Symbolizer(None, False) - self._gs_test_artifacts_bucket = args.gs_test_artifacts_bucket + self._total_external_shards = args.test_launcher_total_shards self._wait_for_java_debugger = args.wait_for_java_debugger # GYP: @@ -430,6 +434,10 @@ class GtestTestInstance(test_instance.TestInstance): return self._gtest_filter @property + def chartjson_result_file(self): + return self._chartjson_result_file + + @property def package(self): return self._apk_helper and self._apk_helper.GetPackageName() diff --git a/chromium/build/android/pylib/instrumentation/instrumentation_test_instance.py b/chromium/build/android/pylib/instrumentation/instrumentation_test_instance.py index 5f7c196db8f..ddc80f75635 100644 --- a/chromium/build/android/pylib/instrumentation/instrumentation_test_instance.py +++ b/chromium/build/android/pylib/instrumentation/instrumentation_test_instance.py @@ -568,10 +568,10 @@ class InstrumentationTestInstance(test_instance.TestInstance): self._test_package = self._test_apk.GetPackageName() all_instrumentations = self._test_apk.GetAllInstrumentations() all_junit3_runner_classes = [ - x for x in all_instrumentations if ('true' not in x.get( + x for x in all_instrumentations if ('0xffffffff' not in x.get( 'chromium-junit4', ''))] all_junit4_test_runner_classes = [ - x for x in all_instrumentations if ('true' in x.get( + x for x in all_instrumentations if ('0xffffffff' in x.get( 'chromium-junit4', ''))] if len(all_junit3_runner_classes) > 1: diff --git a/chromium/build/android/pylib/linker/linker_test_instance.py b/chromium/build/android/pylib/linker/linker_test_instance.py index ce696f25d21..1de3e17f1df 100644 --- a/chromium/build/android/pylib/linker/linker_test_instance.py +++ b/chromium/build/android/pylib/linker/linker_test_instance.py @@ -9,7 +9,6 @@ from pylib.linker import test_case with host_paths.SysPath(host_paths.BUILD_COMMON_PATH): import unittest_util -_MODERN_LINKER_MINIMUM_SDK_INT = 23 class LinkerTestInstance(test_instance.TestInstance): @@ -26,15 +25,11 @@ class LinkerTestInstance(test_instance.TestInstance): def test_filter(self): return self._test_filter - def GetTests(self, min_device_sdk): + def GetTests(self): tests = [ - test_case.LinkerSharedRelroTest(is_modern_linker=False, - is_low_memory=False), - test_case.LinkerSharedRelroTest(is_modern_linker=False, - is_low_memory=True) + test_case.LinkerSharedRelroTest(is_low_memory=False), + test_case.LinkerSharedRelroTest(is_low_memory=True) ] - if min_device_sdk >= _MODERN_LINKER_MINIMUM_SDK_INT: - tests.append(test_case.LinkerSharedRelroTest(is_modern_linker=True)) if self._test_filter: filtered_names = unittest_util.FilterTestNames( diff --git a/chromium/build/android/pylib/linker/test_case.py b/chromium/build/android/pylib/linker/test_case.py index f4ae7c6562e..cf16a738047 100644 --- a/chromium/build/android/pylib/linker/test_case.py +++ b/chromium/build/android/pylib/linker/test_case.py @@ -124,17 +124,12 @@ class AddressList(list): class LinkerTestCaseBase(object): """Base class for linker test cases.""" - def __init__(self, is_modern_linker=False, is_low_memory=False): + def __init__(self, is_low_memory=False): """Create a test case. Args: - is_modern_linker: True to test ModernLinker, False to test LegacyLinker. is_low_memory: True to simulate a low-memory device, False otherwise. """ - self.is_modern_linker = is_modern_linker - if is_modern_linker: - test_suffix = 'ForModernLinker' - else: - test_suffix = 'ForLegacyLinker' + test_suffix = 'ForLegacyLinker' self.is_low_memory = is_low_memory if is_low_memory: test_suffix += 'LowMemoryDevice' @@ -166,11 +161,7 @@ class LinkerTestCaseBase(object): print '[ %-*s ] %s' % (margin, 'RUN', self.tagged_name) logging.info('Running linker test: %s', self.tagged_name) - # Create command-line file on device. - if self.is_modern_linker: - command_line_flags = '--use-linker=modern' - else: - command_line_flags = '--use-linker=legacy' + command_line_flags = '--use-linker=legacy' if self.is_low_memory: command_line_flags += ' --low-memory-device' device.WriteFile(_COMMAND_LINE_FILE, command_line_flags) diff --git a/chromium/build/android/pylib/local/device/local_device_environment.py b/chromium/build/android/pylib/local/device/local_device_environment.py index 0c85671057a..1403504e005 100644 --- a/chromium/build/android/pylib/local/device/local_device_environment.py +++ b/chromium/build/android/pylib/local/device/local_device_environment.py @@ -98,6 +98,7 @@ class LocalDeviceEnvironment(environment.Environment): self._logcat_output_dir = args.logcat_output_dir self._logcat_output_file = args.logcat_output_file self._max_tries = 1 + args.num_retries + self._recover_devices = args.recover_devices self._skip_clear_data = args.skip_clear_data self._tool_name = args.tool self._trace_output = None @@ -188,6 +189,10 @@ class LocalDeviceEnvironment(environment.Environment): return parallelizer.SyncParallelizer(self.devices) @property + def recover_devices(self): + return self._recover_devices + + @property def skip_clear_data(self): return self._skip_clear_data @@ -201,7 +206,9 @@ class LocalDeviceEnvironment(environment.Environment): #override def TearDown(self): - if self.trace_output: + if self.trace_output and self._trace_all: + instrumentation_tracing.stop_instrumenting() + elif self.trace_output: self.DisableTracing() if not self._devices: diff --git a/chromium/build/android/pylib/local/device/local_device_gtest_run.py b/chromium/build/android/pylib/local/device/local_device_gtest_run.py index 008f98715e1..3306a2245cb 100644 --- a/chromium/build/android/pylib/local/device/local_device_gtest_run.py +++ b/chromium/build/android/pylib/local/device/local_device_gtest_run.py @@ -108,7 +108,7 @@ def _ExtractTestsFromFilter(gtest_filter): class _ApkDelegate(object): - def __init__(self, test_instance): + def __init__(self, test_instance, tool): self._activity = test_instance.activity self._apk_helper = test_instance.apk_helper self._test_apk_incremental_install_json = ( @@ -120,6 +120,7 @@ class _ApkDelegate(object): self._component = '%s/%s' % (self._package, self._runner) self._extras = test_instance.extras self._wait_for_java_debugger = test_instance.wait_for_java_debugger + self._tool = tool def GetTestDataRoot(self, device): # pylint: disable=no-self-use @@ -206,12 +207,13 @@ class _ApkDelegate(object): class _ExeDelegate(object): - def __init__(self, tr, dist_dir): + def __init__(self, tr, dist_dir, tool): self._host_dist_dir = dist_dir self._exe_file_name = os.path.basename(dist_dir)[:-len('__dist')] self._device_dist_dir = posixpath.join( constants.TEST_EXECUTABLE_DIR, os.path.basename(dist_dir)) self._test_run = tr + self._tool = tool def GetTestDataRoot(self, device): # pylint: disable=no-self-use @@ -247,6 +249,10 @@ class _ExeDelegate(object): env = { 'LD_LIBRARY_PATH': self._device_dist_dir } + + if self._tool != 'asan': + env['UBSAN_OPTIONS'] = constants.UBSAN_OPTIONS + try: gcov_strip_depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP'] external = device.GetExternalStoragePath() @@ -276,9 +282,10 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): super(LocalDeviceGtestRun, self).__init__(env, test_instance) if self._test_instance.apk: - self._delegate = _ApkDelegate(self._test_instance) + self._delegate = _ApkDelegate(self._test_instance, env.tool) elif self._test_instance.exe_dist_dir: - self._delegate = _ExeDelegate(self, self._test_instance.exe_dist_dir) + self._delegate = _ExeDelegate(self, self._test_instance.exe_dist_dir, + self._env.tool) self._crashes = set() self._servers = collections.defaultdict(list) @@ -457,54 +464,71 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): device_temp_file.NamedDeviceTemporaryDirectory( adb=device.adb, dir='/sdcard/'), self._test_instance.gs_test_artifacts_bucket) as test_artifacts_dir: - - flags = list(self._test_instance.flags) - if self._test_instance.enable_xml_result_parsing: - flags.append('--gtest_output=xml:%s' % device_tmp_results_file.name) - - if self._test_instance.gs_test_artifacts_bucket: - flags.append('--test_artifacts_dir=%s' % test_artifacts_dir.name) - - logging.info('flags:') - for f in flags: - logging.info(' %s', f) - - stream_name = 'logcat_%s_%s_%s' % ( - hash(tuple(test)), - time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()), - device.serial) - - with self._env.output_manager.ArchivedTempfile( - stream_name, 'logcat') as logcat_file: - with logcat_monitor.LogcatMonitor( - device.adb, - filter_specs=local_device_environment.LOGCAT_FILTERS, - output_file=logcat_file.name) as logmon: - with contextlib_ext.Optional( - trace_event.trace(str(test)), - self._env.trace_output): - output = self._delegate.Run( - test, device, flags=' '.join(flags), - timeout=timeout, retries=0) - logmon.Close() - - if logcat_file.Link(): - logging.info('Logcat saved to %s', logcat_file.Link()) - - if self._test_instance.enable_xml_result_parsing: - try: - gtest_xml = device.ReadFile( - device_tmp_results_file.name, - as_root=True) - except device_errors.CommandFailedError as e: - logging.warning( - 'Failed to pull gtest results XML file %s: %s', - device_tmp_results_file.name, - str(e)) - gtest_xml = None - - test_artifacts_url = self._UploadTestArtifacts(device, - test_artifacts_dir) + with contextlib_ext.Optional( + device_temp_file.DeviceTempFile( + adb=device.adb, dir=self._delegate.ResultsDirectory(device)), + self._test_instance.chartjson_result_file) as chartjson_result_file: + + flags = list(self._test_instance.flags) + if self._test_instance.enable_xml_result_parsing: + flags.append('--gtest_output=xml:%s' % device_tmp_results_file.name) + + if self._test_instance.gs_test_artifacts_bucket: + flags.append('--test_artifacts_dir=%s' % test_artifacts_dir.name) + + if self._test_instance.chartjson_result_file: + flags.append('--chartjson_result_file=%s' + % chartjson_result_file.name) + + logging.info('flags:') + for f in flags: + logging.info(' %s', f) + + stream_name = 'logcat_%s_%s_%s' % ( + hash(tuple(test)), + time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()), + device.serial) + + with self._env.output_manager.ArchivedTempfile( + stream_name, 'logcat') as logcat_file: + with logcat_monitor.LogcatMonitor( + device.adb, + filter_specs=local_device_environment.LOGCAT_FILTERS, + output_file=logcat_file.name) as logmon: + with contextlib_ext.Optional( + trace_event.trace(str(test)), + self._env.trace_output): + output = self._delegate.Run( + test, device, flags=' '.join(flags), + timeout=timeout, retries=0) + logmon.Close() + + if logcat_file.Link(): + logging.info('Logcat saved to %s', logcat_file.Link()) + + if self._test_instance.enable_xml_result_parsing: + try: + gtest_xml = device.ReadFile( + device_tmp_results_file.name, + as_root=True) + except device_errors.CommandFailedError as e: + logging.warning( + 'Failed to pull gtest results XML file %s: %s', + device_tmp_results_file.name, + str(e)) + gtest_xml = None + + if self._test_instance.chartjson_result_file: + try: + device.PullFile(chartjson_result_file.name, + self._test_instance.chartjson_result_file) + except device_errors.CommandFailedError as e: + logging.warning( + 'Failed to pull chartjson results %s: %s', + chartjson_result_file.name, str(e)) + + test_artifacts_url = self._UploadTestArtifacts(device, + test_artifacts_dir) for s in self._servers[str(device)]: s.Reset() diff --git a/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run.py index 67b8fd0a9da..664bb8d2c2d 100644 --- a/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run.py @@ -29,6 +29,7 @@ from pylib.constants import host_paths from pylib.instrumentation import instrumentation_test_instance from pylib.local.device import local_device_environment from pylib.local.device import local_device_test_run +from pylib.output import remote_output_manager from pylib.utils import instrumentation_tracing from pylib.utils import shared_preference_utils @@ -203,16 +204,19 @@ class LocalDeviceInstrumentationTestRun( def set_debug_app(dev): # Set debug app in order to enable reading command line flags on user # builds - if not self._test_instance.package_info: - logging.error("Couldn't set debug app: no package info") - elif not self._test_instance.package_info.package: - logging.error("Couldn't set debug app: no package defined") + package_name = None + if self._test_instance.apk_under_test: + package_name = self._test_instance.apk_under_test.GetPackageName() + elif self._test_instance.test_apk: + package_name = self._test_instance.test_apk.GetPackageName() else: - cmd = ['am', 'set-debug-app', '--persistent'] - if self._test_instance.wait_for_java_debugger: - cmd.append('-w') - cmd.append(self._test_instance.package_info.package) - dev.RunShellCommand(cmd, check_return=True) + logging.error("Couldn't set debug app: no package name found") + return + cmd = ['am', 'set-debug-app', '--persistent'] + if self._test_instance.wait_for_java_debugger: + cmd.append('-w') + cmd.append(package_name) + dev.RunShellCommand(cmd, check_return=True) @trace_event.traced def edit_shared_prefs(dev): @@ -241,15 +245,10 @@ class LocalDeviceInstrumentationTestRun( @trace_event.traced def create_flag_changer(dev): if self._test_instance.flags: - if not self._test_instance.package_info: - logging.error("Couldn't set flags: no package info") - elif not self._test_instance.package_info.cmdline_file: - logging.error("Couldn't set flags: no cmdline_file") - else: - self._CreateFlagChangerIfNeeded(dev) - logging.debug('Attempting to set flags: %r', - self._test_instance.flags) - self._flag_changers[str(dev)].AddFlags(self._test_instance.flags) + self._CreateFlagChangerIfNeeded(dev) + logging.debug('Attempting to set flags: %r', + self._test_instance.flags) + self._flag_changers[str(dev)].AddFlags(self._test_instance.flags) valgrind_tools.SetChromeTimeoutScale( dev, self._test_instance.timeout_scale) @@ -275,13 +274,29 @@ class LocalDeviceInstrumentationTestRun( steps = [bind_crash_handler(s, device) for s in steps] - if self._env.concurrent_adb: - reraiser_thread.RunAsync(steps) - else: - for step in steps: - step() - if self._test_instance.store_tombstones: - tombstones.ClearAllTombstones(device) + try: + if self._env.concurrent_adb: + reraiser_thread.RunAsync(steps) + else: + for step in steps: + step() + if self._test_instance.store_tombstones: + tombstones.ClearAllTombstones(device) + except device_errors.CommandFailedError: + # A bugreport can be large and take a while to generate, so only capture + # one if we're using a remote manager. + if isinstance( + self._env.output_manager, + remote_output_manager.RemoteOutputManager): + logging.error( + 'Error when setting up device for tests. Taking a bugreport for ' + 'investigation. This may take a while...') + report_name = '%s.bugreport' % device.serial + with self._env.output_manager.ArchivedTempfile( + report_name, 'bug_reports') as report_file: + device.TakeBugReport(report_file.name) + logging.error('Bug report saved to %s', report_file.Link()) + raise self._env.parallel_devices.pMap( individual_device_set_up, @@ -289,7 +304,7 @@ class LocalDeviceInstrumentationTestRun( if self._test_instance.wait_for_java_debugger: logging.warning('*' * 80) logging.warning('Waiting for debugger to attach to process: %s', - self._test_instance.package_info.package) + self._test_instance.apk_under_test.GetPackageName()) logging.warning('*' * 80) #override @@ -328,7 +343,7 @@ class LocalDeviceInstrumentationTestRun( def _CreateFlagChangerIfNeeded(self, device): if not str(device) in self._flag_changers: self._flag_changers[str(device)] = flag_changer.FlagChanger( - device, self._test_instance.package_info.cmdline_file) + device, "test-cmdline-file") #override def _CreateShards(self, tests): @@ -638,11 +653,11 @@ class LocalDeviceInstrumentationTestRun( extras['log'] = 'true' extras[_EXTRA_TEST_LIST] = dev_test_list_json.name target = '%s/%s' % (test_package, junit4_runner_class) - kwargs = {} + timeout = 120 if self._test_instance.wait_for_java_debugger: - kwargs['timeout'] = None + timeout = None test_list_run_output = dev.StartInstrumentation( - target, extras=extras, retries=0, **kwargs) + target, extras=extras, retries=0, timeout=timeout) if any(test_list_run_output): logging.error('Unexpected output while listing tests:') for line in test_list_run_output: @@ -812,18 +827,11 @@ class LocalDeviceInstrumentationTestRun( #override def _ShouldRetry(self, test, result): - def not_run(res): - if isinstance(res, list): - return any(not_run(r) for r in res) - return res.GetType() == base_test_result.ResultType.NOTRUN - - if 'RetryOnFailure' in test.get('annotations', {}) or not_run(result): - return True - - # TODO(jbudorick): Remove this log message once @RetryOnFailure has been - # enabled for a while. See crbug.com/619055 for more details. - logging.error('Default retries are being phased out. crbug.com/619055') - return False + # We've tried to disable retries in the past with mixed results. + # See crbug.com/619055 for historical context and crbug.com/797002 + # for ongoing efforts. + del test, result + return True #override def _ShouldShard(self): diff --git a/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py b/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py index d7cb3727d12..82db02e8eb4 100755 --- a/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py +++ b/chromium/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py @@ -16,6 +16,9 @@ from pylib.local.device import local_device_instrumentation_test_run class LocalDeviceInstrumentationTestRunTest(unittest.TestCase): + # TODO(crbug.com/797002): Decide whether the _ShouldRetry hook is worth + # retaining and remove these tests if not. + def testShouldRetry_failure(self): env = mock_environment.MockEnvironment() ti = mock_test_instance.MockTestInstance() @@ -29,7 +32,7 @@ class LocalDeviceInstrumentationTestRunTest(unittest.TestCase): } result = base_test_result.BaseTestResult( 'SadTest.testFailure', base_test_result.ResultType.FAIL) - self.assertFalse(obj._ShouldRetry(test, result)) + self.assertTrue(obj._ShouldRetry(test, result)) def testShouldRetry_retryOnFailure(self): env = mock_environment.MockEnvironment() diff --git a/chromium/build/android/pylib/local/device/local_device_test_run.py b/chromium/build/android/pylib/local/device/local_device_test_run.py index 21ab0465412..90e6b674cb0 100644 --- a/chromium/build/android/pylib/local/device/local_device_test_run.py +++ b/chromium/build/android/pylib/local/device/local_device_test_run.py @@ -12,6 +12,7 @@ import threading from devil import base_error from devil.android import crash_handler from devil.android import device_errors +from devil.android.sdk import version_codes from devil.android.tools import device_recovery from devil.utils import signal_handler from pylib import valgrind_tools @@ -117,10 +118,19 @@ class LocalDeviceTestRun(test_run.TestRun): results = [] while tries < self._env.max_tries and tests: logging.info('STARTING TRY #%d/%d', tries + 1, self._env.max_tries) - if tries > 0 and tries + 1 == self._env.max_tries: - logging.info( - 'Attempting to recover devices prior to last test attempt.') - self._env.parallel_devices.pMap(device_recovery.RecoverDevice, None) + if tries > 0 and self._env.recover_devices: + if any(d.build_version_sdk == version_codes.LOLLIPOP_MR1 + for d in self._env.devices): + logging.info( + 'Attempting to recover devices due to known issue on L MR1. ' + 'See crbug.com/787056 for details.') + self._env.parallel_devices.pMap( + device_recovery.RecoverDevice, None) + elif tries + 1 == self._env.max_tries: + logging.info( + 'Attempting to recover devices prior to last test attempt.') + self._env.parallel_devices.pMap( + device_recovery.RecoverDevice, None) logging.info('Will run %d tests on %d devices: %s', len(tests), len(self._env.devices), ', '.join(str(d) for d in self._env.devices)) diff --git a/chromium/build/android/pylib/results/json_results.py b/chromium/build/android/pylib/results/json_results.py index d9f441f1a03..92b01b71fd3 100644 --- a/chromium/build/android/pylib/results/json_results.py +++ b/chromium/build/android/pylib/results/json_results.py @@ -104,7 +104,7 @@ def GenerateResultsDict(test_run_results, global_tags=None): result_dict = { 'status': status_as_string(r.GetType()), 'elapsed_time_ms': r.GetDuration(), - 'output_snippet': r.GetLog(), + 'output_snippet': unicode(r.GetLog(), errors='replace'), 'losless_snippet': '', 'output_snippet_base64': '', 'links': r.GetLinks(), diff --git a/chromium/build/android/pylib/results/presentation/test_results_presentation.py b/chromium/build/android/pylib/results/presentation/test_results_presentation.py index 552ccd76844..21137feb14c 100755 --- a/chromium/build/android/pylib/results/presentation/test_results_presentation.py +++ b/chromium/build/android/pylib/results/presentation/test_results_presentation.py @@ -386,6 +386,10 @@ def main(): '(Output of the swarming.py collect ' '--task-summary-json=XXX command.)') parser.add_argument( + '--task-output-dir', + help='(Swarming Merge Script API) ' + 'Directory containing all swarming task results.') + parser.add_argument( 'positional', nargs='*', help='output.json from shards.') @@ -454,7 +458,9 @@ def main(): if args.output_json: with open(json_file) as original_json_file: json_object = json.load(original_json_file) - json_object['links'] = {'result_details': result_details_link} + json_object['links'] = { + 'result_details (logcats, flakiness links)': result_details_link + } with open(args.output_json, 'w') as f: json.dump(json_object, f) else: diff --git a/chromium/build/android/pylib/symbols/stack_symbolizer.py b/chromium/build/android/pylib/symbols/stack_symbolizer.py index c1c9afbb0ac..05e40657dfb 100644 --- a/chromium/build/android/pylib/symbols/stack_symbolizer.py +++ b/chromium/build/android/pylib/symbols/stack_symbolizer.py @@ -7,6 +7,7 @@ import os import re import shutil import tempfile +import time import zipfile from devil.utils import cmd_helper @@ -38,6 +39,7 @@ class Symbolizer(object): self._libs_dir = None self._apk_libs = [] self._has_unzipped = False + self._time_spent_symbolizing = 0 def __del__(self): @@ -52,6 +54,9 @@ class Symbolizer(object): if self._libs_dir: shutil.rmtree(self._libs_dir) self._libs_dir = None + if self._time_spent_symbolizing > 0: + logging.info( + 'Total time spent symbolizing: %.2fs', self._time_spent_symbolizing) def UnzipAPKIfNecessary(self): @@ -97,7 +102,11 @@ class Symbolizer(object): with tempfile.NamedTemporaryFile() as f: f.write('\n'.join(data_to_symbolize)) f.flush() - _, output = cmd_helper.GetCmdStatusAndOutput(cmd + [f.name], env=env) + start = time.time() + try: + _, output = cmd_helper.GetCmdStatusAndOutput(cmd + [f.name], env=env) + finally: + self._time_spent_symbolizing += time.time() - start for line in output.splitlines(): if not include_stack and 'Stack Data:' in line: break diff --git a/chromium/build/android/pylib/utils/emulator.py b/chromium/build/android/pylib/utils/emulator.py deleted file mode 100644 index c41cdd22c07..00000000000 --- a/chromium/build/android/pylib/utils/emulator.py +++ /dev/null @@ -1,519 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Provides an interface to start and stop Android emulator. - - Emulator: The class provides the methods to launch/shutdown the emulator with - the android virtual device named 'avd_armeabi' . -""" - -import logging -import os -import signal -import subprocess -import time - -from devil.android import device_errors -from devil.android import device_utils -from devil.android.sdk import adb_wrapper -from devil.utils import cmd_helper -from pylib import constants -from pylib import pexpect -from pylib.utils import time_profile - -# Default sdcard size in the format of [amount][unit] -DEFAULT_SDCARD_SIZE = '512M' -# Default internal storage (MB) of emulator image -DEFAULT_STORAGE_SIZE = '1024M' - -# Each emulator has 300 secs of wait time for launching -_BOOT_WAIT_INTERVALS = 30 -_BOOT_WAIT_INTERVAL_TIME = 10 - -# Path for avd files and avd dir -_BASE_AVD_DIR = os.path.expanduser(os.path.join('~', '.android', 'avd')) -_TOOLS_ANDROID_PATH = os.path.join(constants.ANDROID_SDK_ROOT, - 'tools', 'android') - -# Template used to generate config.ini files for the emulator -CONFIG_TEMPLATE = """avd.ini.encoding=ISO-8859-1 -hw.dPad=no -hw.lcd.density=320 -sdcard.size={sdcard.size} -hw.cpu.arch={hw.cpu.arch} -hw.device.hash=-708107041 -hw.camera.back=none -disk.dataPartition.size=800M -hw.gpu.enabled={gpu} -skin.path=720x1280 -skin.dynamic=yes -hw.keyboard=yes -hw.ramSize=1024 -hw.device.manufacturer=Google -hw.sdCard=yes -hw.mainKeys=no -hw.accelerometer=yes -skin.name=720x1280 -abi.type={abi.type} -hw.trackBall=no -hw.device.name=Galaxy Nexus -hw.battery=yes -hw.sensors.proximity=yes -image.sysdir.1=system-images/android-{api.level}/default/{abi.type}/ -hw.sensors.orientation=yes -hw.audioInput=yes -hw.camera.front=none -hw.gps=yes -vm.heapSize=128 -{extras}""" - -CONFIG_REPLACEMENTS = { - 'x86': { - '{hw.cpu.arch}': 'x86', - '{abi.type}': 'x86', - '{extras}': '' - }, - 'arm': { - '{hw.cpu.arch}': 'arm', - '{abi.type}': 'armeabi-v7a', - '{extras}': 'hw.cpu.model=cortex-a8\n' - }, - 'mips': { - '{hw.cpu.arch}': 'mips', - '{abi.type}': 'mips', - '{extras}': '' - } -} - -class EmulatorLaunchException(Exception): - """Emulator failed to launch.""" - pass - -def WaitForEmulatorLaunch(num): - """Wait for emulators to finish booting - - Emulators on bots are launch with a separate background process, to avoid - running tests before the emulators are fully booted, this function waits for - a number of emulators to finish booting - - Arg: - num: the amount of emulators to wait. - """ - for _ in range(num*_BOOT_WAIT_INTERVALS): - emulators = [device_utils.DeviceUtils(a) - for a in adb_wrapper.AdbWrapper.Devices() - if a.is_emulator] - if len(emulators) >= num: - logging.info('All %d emulators launched', num) - return - logging.info( - 'Waiting for %d emulators, %d of them already launched', num, - len(emulators)) - time.sleep(_BOOT_WAIT_INTERVAL_TIME) - raise Exception("Expected %d emulators, %d launched within time limit" % - (num, len(emulators))) - -def KillAllEmulators(): - """Kill all running emulators that look like ones we started. - - There are odd 'sticky' cases where there can be no emulator process - running but a device slot is taken. A little bot trouble and we're out of - room forever. - """ - logging.info('Killing all existing emulators and existing the program') - emulators = [device_utils.DeviceUtils(a) - for a in adb_wrapper.AdbWrapper.Devices() - if a.is_emulator] - if not emulators: - return - for e in emulators: - e.adb.Emu(['kill']) - logging.info('Emulator killing is async; give a few seconds for all to die.') - for _ in range(10): - if not any(a.is_emulator for a in adb_wrapper.AdbWrapper.Devices()): - return - time.sleep(1) - - -def DeleteAllTempAVDs(): - """Delete all temporary AVDs which are created for tests. - - If the test exits abnormally and some temporary AVDs created when testing may - be left in the system. Clean these AVDs. - """ - logging.info('Deleting all the avd files') - avds = device_utils.GetAVDs() - if not avds: - return - for avd_name in avds: - if 'run_tests_avd' in avd_name: - cmd = [_TOOLS_ANDROID_PATH, '-s', 'delete', 'avd', '--name', avd_name] - cmd_helper.RunCmd(cmd) - logging.info('Delete AVD %s', avd_name) - - -class PortPool(object): - """Pool for emulator port starting position that changes over time.""" - _port_min = 5554 - _port_max = 5585 - _port_current_index = 0 - - @classmethod - def port_range(cls): - """Return a range of valid ports for emulator use. - - The port must be an even number between 5554 and 5584. Sometimes - a killed emulator "hangs on" to a port long enough to prevent - relaunch. This is especially true on slow machines (like a bot). - Cycling through a port start position helps make us resilient.""" - ports = range(cls._port_min, cls._port_max, 2) - n = cls._port_current_index - cls._port_current_index = (n + 1) % len(ports) - return ports[n:] + ports[:n] - - -def _GetAvailablePort(): - """Returns an available TCP port for the console.""" - used_ports = [] - emulators = [device_utils.DeviceUtils(a) - for a in adb_wrapper.AdbWrapper.Devices() - if a.is_emulator] - for emulator in emulators: - used_ports.append(emulator.adb.GetDeviceSerial().split('-')[1]) - for port in PortPool.port_range(): - if str(port) not in used_ports: - return port - - -def LaunchTempEmulators(emulator_count, abi, api_level, enable_kvm=False, - kill_and_launch=True, sdcard_size=DEFAULT_SDCARD_SIZE, - storage_size=DEFAULT_STORAGE_SIZE, wait_for_boot=True, - headless=False): - """Create and launch temporary emulators and wait for them to boot. - - Args: - emulator_count: number of emulators to launch. - abi: the emulator target platform - api_level: the api level (e.g., 19 for Android v4.4 - KitKat release) - wait_for_boot: whether or not to wait for emulators to boot up - headless: running emulator with no ui - - Returns: - List of emulators. - """ - emulators = [] - for n in xrange(emulator_count): - t = time_profile.TimeProfile('Emulator launch %d' % n) - # Creates a temporary AVD. - avd_name = 'run_tests_avd_%d' % n - logging.info('Emulator launch %d with avd_name=%s and api=%d', - n, avd_name, api_level) - emulator = Emulator(avd_name, abi, enable_kvm=enable_kvm, - sdcard_size=sdcard_size, storage_size=storage_size, - headless=headless) - emulator.CreateAVD(api_level) - emulator.Launch(kill_all_emulators=(n == 0 and kill_and_launch)) - t.Stop() - emulators.append(emulator) - # Wait for all emulators to boot completed. - if wait_for_boot: - for emulator in emulators: - emulator.ConfirmLaunch(True) - logging.info('All emulators are fully booted') - return emulators - - -def LaunchEmulator(avd_name, abi, kill_and_launch=True, enable_kvm=False, - sdcard_size=DEFAULT_SDCARD_SIZE, - storage_size=DEFAULT_STORAGE_SIZE, headless=False): - """Launch an existing emulator with name avd_name. - - Args: - avd_name: name of existing emulator - abi: the emulator target platform - headless: running emulator with no ui - - Returns: - emulator object. - """ - logging.info('Specified emulator named avd_name=%s launched', avd_name) - emulator = Emulator(avd_name, abi, enable_kvm=enable_kvm, - sdcard_size=sdcard_size, storage_size=storage_size, - headless=headless) - emulator.Launch(kill_all_emulators=kill_and_launch) - emulator.ConfirmLaunch(True) - return emulator - - -class Emulator(object): - """Provides the methods to launch/shutdown the emulator. - - The emulator has the android virtual device named 'avd_armeabi'. - - The emulator could use any even TCP port between 5554 and 5584 for the - console communication, and this port will be part of the device name like - 'emulator-5554'. Assume it is always True, as the device name is the id of - emulator managed in this class. - - Attributes: - emulator: Path of Android's emulator tool. - popen: Popen object of the running emulator process. - device: Device name of this emulator. - """ - - # Signals we listen for to kill the emulator on - _SIGNALS = (signal.SIGINT, signal.SIGHUP) - - # Time to wait for an emulator launch, in seconds. This includes - # the time to launch the emulator and a wait-for-device command. - _LAUNCH_TIMEOUT = 120 - - # Timeout interval of wait-for-device command before bouncing to a a - # process life check. - _WAITFORDEVICE_TIMEOUT = 5 - - # Time to wait for a 'wait for boot complete' (property set on device). - _WAITFORBOOT_TIMEOUT = 300 - - def __init__(self, avd_name, abi, enable_kvm=False, - sdcard_size=DEFAULT_SDCARD_SIZE, - storage_size=DEFAULT_STORAGE_SIZE, headless=False): - """Init an Emulator. - - Args: - avd_name: name of the AVD to create - abi: target platform for emulator being created, defaults to x86 - """ - android_sdk_root = constants.ANDROID_SDK_ROOT - self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator') - self.android = _TOOLS_ANDROID_PATH - self.popen = None - self.device_serial = None - self.abi = abi - self.avd_name = avd_name - self.sdcard_size = sdcard_size - self.storage_size = storage_size - self.enable_kvm = enable_kvm - self.headless = headless - - @staticmethod - def _DeviceName(): - """Return our device name.""" - port = _GetAvailablePort() - return ('emulator-%d' % port, port) - - def CreateAVD(self, api_level): - """Creates an AVD with the given name. - - Args: - api_level: the api level of the image - - Return avd_name. - """ - - if self.abi == 'arm': - abi_option = 'armeabi-v7a' - elif self.abi == 'mips': - abi_option = 'mips' - else: - abi_option = 'x86' - - api_target = 'android-%s' % api_level - - avd_command = [ - self.android, - '--silent', - 'create', 'avd', - '--name', self.avd_name, - '--abi', abi_option, - '--target', api_target, - '--sdcard', self.sdcard_size, - '--force', - ] - avd_cmd_str = ' '.join(avd_command) - logging.info('Create AVD command: %s', avd_cmd_str) - avd_process = pexpect.spawn(avd_cmd_str) - - # Instead of creating a custom profile, we overwrite config files. - avd_process.expect('Do you wish to create a custom hardware profile') - avd_process.sendline('no\n') - avd_process.expect('Created AVD \'%s\'' % self.avd_name) - - # Replace current configuration with default Galaxy Nexus config. - ini_file = os.path.join(_BASE_AVD_DIR, '%s.ini' % self.avd_name) - new_config_ini = os.path.join(_BASE_AVD_DIR, '%s.avd' % self.avd_name, - 'config.ini') - - # Remove config files with defaults to replace with Google's GN settings. - os.unlink(ini_file) - os.unlink(new_config_ini) - - # Create new configuration files with Galaxy Nexus by Google settings. - with open(ini_file, 'w') as new_ini: - new_ini.write('avd.ini.encoding=ISO-8859-1\n') - new_ini.write('target=%s\n' % api_target) - new_ini.write('path=%s/%s.avd\n' % (_BASE_AVD_DIR, self.avd_name)) - new_ini.write('path.rel=avd/%s.avd\n' % self.avd_name) - - custom_config = CONFIG_TEMPLATE - replacements = CONFIG_REPLACEMENTS[self.abi] - for key in replacements: - custom_config = custom_config.replace(key, replacements[key]) - custom_config = custom_config.replace('{api.level}', str(api_level)) - custom_config = custom_config.replace('{sdcard.size}', self.sdcard_size) - custom_config.replace('{gpu}', 'no' if self.headless else 'yes') - - with open(new_config_ini, 'w') as new_config_ini: - new_config_ini.write(custom_config) - - return self.avd_name - - - def _DeleteAVD(self): - """Delete the AVD of this emulator.""" - avd_command = [ - self.android, - '--silent', - 'delete', - 'avd', - '--name', self.avd_name, - ] - logging.info('Delete AVD command: %s', ' '.join(avd_command)) - cmd_helper.RunCmd(avd_command) - - def ResizeAndWipeAvd(self, storage_size): - """Wipes old AVD and creates new AVD of size |storage_size|. - - This serves as a work around for '-partition-size' and '-wipe-data' - """ - userdata_img = os.path.join(_BASE_AVD_DIR, '%s.avd' % self.avd_name, - 'userdata.img') - userdata_qemu_img = os.path.join(_BASE_AVD_DIR, '%s.avd' % self.avd_name, - 'userdata-qemu.img') - resize_cmd = ['resize2fs', userdata_img, '%s' % storage_size] - logging.info('Resizing userdata.img to ideal size') - cmd_helper.RunCmd(resize_cmd) - wipe_cmd = ['cp', userdata_img, userdata_qemu_img] - logging.info('Replacing userdata-qemu.img with the new userdata.img') - cmd_helper.RunCmd(wipe_cmd) - - def Launch(self, kill_all_emulators): - """Launches the emulator asynchronously. Call ConfirmLaunch() to ensure the - emulator is ready for use. - - If fails, an exception will be raised. - """ - if kill_all_emulators: - KillAllEmulators() # just to be sure - self._AggressiveImageCleanup() - (self.device_serial, port) = self._DeviceName() - self.ResizeAndWipeAvd(storage_size=self.storage_size) - emulator_command = [ - self.emulator, - # Speed up emulator launch by 40%. Really. - '-no-boot-anim', - ] - if self.headless: - emulator_command.extend([ - '-no-skin', - '-no-window' - ]) - else: - emulator_command.extend([ - '-gpu', 'on' - ]) - emulator_command.extend([ - # Use a familiar name and port. - '-avd', self.avd_name, - '-port', str(port), - # all the argument after qemu are sub arguments for qemu - '-qemu', '-m', '1024', - ]) - if self.abi == 'x86' and self.enable_kvm: - emulator_command.extend([ - # For x86 emulator --enable-kvm will fail early, avoiding accidental - # runs in a slow mode (i.e. without hardware virtualization support). - '--enable-kvm', - ]) - - logging.info('Emulator launch command: %s', ' '.join(emulator_command)) - self.popen = subprocess.Popen(args=emulator_command, - stderr=subprocess.STDOUT) - self._InstallKillHandler() - - @staticmethod - def _AggressiveImageCleanup(): - """Aggressive cleanup of emulator images. - - Experimentally it looks like our current emulator use on the bot - leaves image files around in /tmp/android-$USER. If a "random" - name gets reused, we choke with a 'File exists' error. - TODO(jrg): is there a less hacky way to accomplish the same goal? - """ - logging.info('Aggressive Image Cleanup') - emulator_imagedir = '/tmp/android-%s' % os.environ['USER'] - if not os.path.exists(emulator_imagedir): - return - for image in os.listdir(emulator_imagedir): - full_name = os.path.join(emulator_imagedir, image) - if 'emulator' in full_name: - logging.info('Deleting emulator image %s', full_name) - os.unlink(full_name) - - def ConfirmLaunch(self, wait_for_boot=False): - """Confirm the emulator launched properly. - - Loop on a wait-for-device with a very small timeout. On each - timeout, check the emulator process is still alive. - After confirming a wait-for-device can be successful, make sure - it returns the right answer. - """ - seconds_waited = 0 - number_of_waits = 2 # Make sure we can wfd twice - - device = device_utils.DeviceUtils(self.device_serial) - while seconds_waited < self._LAUNCH_TIMEOUT: - try: - device.adb.WaitForDevice( - timeout=self._WAITFORDEVICE_TIMEOUT, retries=1) - number_of_waits -= 1 - if not number_of_waits: - break - except device_errors.CommandTimeoutError: - seconds_waited += self._WAITFORDEVICE_TIMEOUT - device.adb.KillServer() - self.popen.poll() - if self.popen.returncode != None: - raise EmulatorLaunchException('EMULATOR DIED') - - if seconds_waited >= self._LAUNCH_TIMEOUT: - raise EmulatorLaunchException('TIMEOUT with wait-for-device') - - logging.info('Seconds waited on wait-for-device: %d', seconds_waited) - if wait_for_boot: - # Now that we checked for obvious problems, wait for a boot complete. - # Waiting for the package manager is sometimes problematic. - device.WaitUntilFullyBooted(timeout=self._WAITFORBOOT_TIMEOUT) - logging.info('%s is now fully booted', self.avd_name) - - def Shutdown(self): - """Shuts down the process started by launch.""" - self._DeleteAVD() - if self.popen: - self.popen.poll() - if self.popen.returncode == None: - self.popen.kill() - self.popen = None - - def _ShutdownOnSignal(self, _signum, _frame): - logging.critical('emulator _ShutdownOnSignal') - for sig in self._SIGNALS: - signal.signal(sig, signal.SIG_DFL) - self.Shutdown() - raise KeyboardInterrupt # print a stack - - def _InstallKillHandler(self): - """Install a handler to kill the emulator when we exit unexpectedly.""" - for sig in self._SIGNALS: - signal.signal(sig, self._ShutdownOnSignal) diff --git a/chromium/build/android/pylib/utils/google_storage_helper.py b/chromium/build/android/pylib/utils/google_storage_helper.py index c48543fcdfe..55e4882c56c 100644 --- a/chromium/build/android/pylib/utils/google_storage_helper.py +++ b/chromium/build/android/pylib/utils/google_storage_helper.py @@ -29,7 +29,8 @@ _AUTHENTICATED_URL = 'https://storage.cloud.google.com/%s/' @decorators.NoRaiseException(default_return_value='') -def upload(name, filepath, bucket, content_type=None, authenticated_link=True): +def upload(name, filepath, bucket, gs_args=None, command_args=None, + content_type=None, authenticated_link=True): """Uploads data to Google Storage. Args: @@ -51,9 +52,10 @@ def upload(name, filepath, bucket, content_type=None, authenticated_link=True): logging.info('Uploading %s to %s', filepath, gs_path) cmd = [_GSUTIL_PATH, '-q'] + cmd.extend(gs_args or []) if content_type: cmd.extend(['-h', 'Content-Type:%s' % content_type]) - cmd.extend(['cp', filepath, gs_path]) + cmd.extend(['cp'] + (command_args or []) + [filepath, gs_path]) cmd_helper.RunCmd(cmd) diff --git a/chromium/build/android/pylib/utils/instrumentation_tracing.py b/chromium/build/android/pylib/utils/instrumentation_tracing.py index 7e00c58be7d..f1d03a0dcf8 100644 --- a/chromium/build/android/pylib/utils/instrumentation_tracing.py +++ b/chromium/build/android/pylib/utils/instrumentation_tracing.py @@ -17,6 +17,7 @@ function from such a module will be added to the trace. import contextlib import functools import inspect +import os import re import sys import threading @@ -108,7 +109,16 @@ def _generate_trace_function(to_include, to_exclude): included = set() excluded = set() + tracing_pid = os.getpid() + def traceFunction(frame, event, arg): + del arg + + # Don't try to trace in subprocesses. + if os.getpid() != tracing_pid: + sys.settrace(None) + return None + # pylint: disable=unused-argument if event not in ("call", "return"): return None diff --git a/chromium/build/android/test_runner.py b/chromium/build/android/test_runner.py index 3236356f3f5..2d34b30cb2e 100755 --- a/chromium/build/android/test_runner.py +++ b/chromium/build/android/test_runner.py @@ -258,6 +258,11 @@ def AddDeviceOptions(parser): 'speed up local development and never on bots ' '(increases flakiness)') parser.add_argument( + '--recover-devices', + action='store_true', + help='Attempt to recover devices prior to the final retry. Warning: ' + 'this will cause all devices to reboot.') + parser.add_argument( '--tool', dest='tool', help='Run the test under a tool ' @@ -295,6 +300,9 @@ def AddGTestOptions(parser): help='Host directory to which app data files will be' ' saved. Used with --app-data-file.') parser.add_argument( + '--chartjson-result-file', + help='If present, store chartjson results on this path.') + parser.add_argument( '--delete-stale-data', dest='delete_stale_data', action='store_true', help='Delete stale test data on the device.') @@ -315,6 +323,10 @@ def AddGTestOptions(parser): 'development, but is not safe to use on bots (' 'http://crbug.com/549214') parser.add_argument( + '--gs-test-artifacts-bucket', + help=('If present, test artifacts will be uploaded to this Google ' + 'Storage bucket.')) + parser.add_argument( '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', dest='run_disabled', action='store_true', help='Also run disabled tests if applicable.') @@ -347,18 +359,17 @@ def AddGTestOptions(parser): filter_group.add_argument( '-f', '--gtest_filter', '--gtest-filter', dest='test_filter', - help='googletest-style filter string.') + help='googletest-style filter string.', + default=os.environ.get('GTEST_FILTER')) filter_group.add_argument( + # Deprecated argument. '--gtest-filter-file', + # New argument. + '--test-launcher-filter-file', dest='test_filter_file', type=os.path.realpath, help='Path to file that contains googletest-style filter strings. ' 'See also //testing/buildbot/filters/README.md.') - parser.add_argument( - '--gs-test-artifacts-bucket', - help=('If present, test artifacts will be uploaded to this Google ' - 'Storage bucket.')) - def AddInstrumentationTestOptions(parser): """Adds Instrumentation test options to |parser|.""" @@ -408,7 +419,8 @@ def AddInstrumentationTestOptions(parser): parser.add_argument( '-f', '--test-filter', '--gtest_filter', '--gtest-filter', dest='test_filter', - help='Test filter (if not fully qualified, will run all matches).') + help='Test filter (if not fully qualified, will run all matches).', + default=os.environ.get('GTEST_FILTER')) parser.add_argument( '--gtest_also_run_disabled_tests', '--gtest-also-run-disabled-tests', dest='run_disabled', action='store_true', @@ -554,7 +566,8 @@ def AddLinkerTestOptions(parser): parser.add_argument( '-f', '--gtest-filter', dest='test_filter', - help='googletest-style filter string.') + help='googletest-style filter string.', + default=os.environ.get('GTEST_FILTER')) parser.add_argument( '--test-apk', type=os.path.realpath, diff --git a/chromium/build/args/fuchsia.gn b/chromium/build/args/fuchsia.gn index d3b83149038..ba10b884cc5 100644 --- a/chromium/build/args/fuchsia.gn +++ b/chromium/build/args/fuchsia.gn @@ -2,7 +2,6 @@ import("//build/args/headless.gn") target_os = "fuchsia" enable_basic_printing = false -enable_webrtc = false headless_fontconfig_utils = false toolkit_views = false enable_plugins = false diff --git a/chromium/build/args/headless.gn b/chromium/build/args/headless.gn index 82d30e4aa91..ae5e043bebd 100644 --- a/chromium/build/args/headless.gn +++ b/chromium/build/args/headless.gn @@ -35,7 +35,6 @@ enable_remoting = false use_alsa = false use_cups = false use_dbus = false -use_gconf = false use_gio = false use_kerberos = false use_libpci = false diff --git a/chromium/build/check_gn_headers_whitelist.txt b/chromium/build/check_gn_headers_whitelist.txt index f7a765c23fc..c268ed13a64 100644 --- a/chromium/build/check_gn_headers_whitelist.txt +++ b/chromium/build/check_gn_headers_whitelist.txt @@ -200,7 +200,7 @@ net/cert/scoped_nss_types.h net/dns/notify_watcher_mac.h net/http/http_status_code_list.h net/http/transport_security_state_static.h -net/quic/core/stream_notifier_interface.h +net/quic/core/session_notifier_interface.h ppapi/cpp/pass_ref.h ppapi/lib/gl/include/GLES2/gl2.h ppapi/lib/gl/include/GLES2/gl2ext.h @@ -256,7 +256,6 @@ third_party/WebKit/Source/core/editing/finder/FindOptions.h third_party/WebKit/Source/core/paint/FindPaintOffsetAndVisualRectNeedingUpdate.h third_party/WebKit/Source/core/style/ShapeValue.h third_party/WebKit/Source/core/style/TransformOrigin.h -third_party/WebKit/Source/platform/ColorSuggestion.h third_party/WebKit/Source/platform/EncryptedMediaRequest.h third_party/WebKit/Source/platform/fonts/FontSelector.h third_party/WebKit/Source/platform/fonts/Glyph.h diff --git a/chromium/build/cipd/android/android.ensure b/chromium/build/cipd/android/android.ensure index 9a2c705c0d0..a6327b3357e 100644 --- a/chromium/build/cipd/android/android.ensure +++ b/chromium/build/cipd/android/android.ensure @@ -70,7 +70,7 @@ chromium/third_party/gson version:2.8.0-cr0 # endless merge conflicts @Subdir third_party/guava -chromium/third_party/guava version:20.0-cr0 +chromium/third_party/guava version:23.0-cr0 # Three unchanging lines # avoid the horror that is diff --git a/chromium/build/cipd/cipd_wrapper.py b/chromium/build/cipd/cipd_wrapper.py index 630f9e62f8e..73b13666881 100755 --- a/chromium/build/cipd/cipd_wrapper.py +++ b/chromium/build/cipd/cipd_wrapper.py @@ -41,11 +41,24 @@ def cipd_ensure(root, service_url, ensure_file): return retcode +def build_ensure_file(sub_files): + pieces = [] + for sub in sub_files: + pieces.append('### Sourced from //%s' % os.path.relpath(sub, _SRC_ROOT)) + with open(sub) as f: + pieces.append(f.read()) + return '\n'.join(pieces) + + def main(): parser = argparse.ArgumentParser( description='Updates CIPD-managed dependencies based on the given OS.') parser.add_argument( + '--keep-generated-file', + action='store_true', + help='Don\'t delete the generated ensure file, if any, on success.') + parser.add_argument( '--chromium-root', required=True, help='Root directory for dependency.') @@ -55,12 +68,35 @@ def main(): default='https://chrome-infra-packages.appspot.com') parser.add_argument( '--ensure-file', + action='append', type=os.path.realpath, required=True, - help='The path to the ensure file.') + help='The path to the ensure file. If given multiple times, this will ' + 'concatenate the given ensure files before passing them to cipd.') args = parser.parse_args() - return cipd_ensure(args.chromium_root, args.service_url, args.ensure_file) + build_own_ensure_file = len(args.ensure_file) > 1 + if build_own_ensure_file: + ensure_file_contents = build_ensure_file(args.ensure_file) + with tempfile.NamedTemporaryFile(suffix='.ensure') as ensure_file: + ensure_file.write(ensure_file_contents) + ensure_file_name = ensure_file.name + ensure_file.delete = False + else: + ensure_file_name = args.ensure_file[0] + + retcode = cipd_ensure(args.chromium_root, args.service_url, ensure_file_name) + if retcode: + if build_own_ensure_file: + print 'Ensure failed; generated input file is at', ensure_file_name + return retcode + + if build_own_ensure_file: + if args.keep_generated_file: + print 'Leaving the generated .ensure file at', ensure_file_name + else: + os.unlink(ensure_file_name) + return 0 if __name__ == '__main__': sys.exit(main()) diff --git a/chromium/build/cipd/fuchsia/OWNERS b/chromium/build/cipd/fuchsia/OWNERS deleted file mode 100644 index e7034eabb1e..00000000000 --- a/chromium/build/cipd/fuchsia/OWNERS +++ /dev/null @@ -1 +0,0 @@ -file://build/fuchsia/OWNERS diff --git a/chromium/build/cipd/fuchsia/qemu.ensure b/chromium/build/cipd/fuchsia/qemu.ensure deleted file mode 100644 index 7cc9b994dc5..00000000000 --- a/chromium/build/cipd/fuchsia/qemu.ensure +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -@Subdir third_party/qemu-aarch64 -fuchsia/qemu/linux-arm64 5c0de765eec81c8587d363121a0fdac3ed17313e - -@Subdir third_party/qemu-x86_64 -fuchsia/qemu/linux-amd64 ff5977bcc054ab81e4f1b887f89b690f86fad969 diff --git a/chromium/build/config/BUILDCONFIG.gn b/chromium/build/config/BUILDCONFIG.gn index 78038b04ddf..853c8492ce9 100644 --- a/chromium/build/config/BUILDCONFIG.gn +++ b/chromium/build/config/BUILDCONFIG.gn @@ -242,9 +242,10 @@ if (target_os == "android") { _default_toolchain = host_toolchain } else if (target_os == "win") { # On Windows we use the same toolchain for host and target by default. - # Beware, win cross builds mostly don't work yet, see docs/win_cross.md - # TODO(thakis): Allow on Mac as well soon. - assert(host_os != "mac", "https://crbug.com/774209") + # Beware, win cross builds have some caveats, see docs/win_cross.md + # TODO(thakis): See if we want to make 32-bit builds on mac hosts work. + assert(host_os != "mac" || target_cpu == "x64", + "Mac hosts can only build 64-bit chrome/win, https://crbug.com/794838") if (is_clang) { _default_toolchain = "//build/toolchain/win:win_clang_$target_cpu" } else { @@ -524,6 +525,9 @@ default_compiler_configs = [ "//build/config/compiler:default_optimization", "//build/config/compiler:default_stack_frames", "//build/config/compiler:default_symbols", + + # TODO(crbug.com/795158): Remove once libwidevinecdmadapter.so is fixed. + "//build/config/compiler:default_fatal_linker_warnings", "//build/config/compiler:no_exceptions", "//build/config/compiler:no_rtti", "//build/config/compiler:runtime_library", diff --git a/chromium/build/config/allocator.gni b/chromium/build/config/allocator.gni index 5ac3ed67049..fc5000a3c23 100644 --- a/chromium/build/config/allocator.gni +++ b/chromium/build/config/allocator.gni @@ -30,6 +30,9 @@ declare_args() { # Causes all the allocations to be routed via allocator_shim.cc. use_allocator_shim = _default_use_allocator_shim + + # Partition alloc is included by default except iOS. + use_partition_alloc = !is_ios } if (is_nacl) { diff --git a/chromium/build/config/android/BUILD.gn b/chromium/build/config/android/BUILD.gn index d575b84ac95..4e73318ac66 100644 --- a/chromium/build/config/android/BUILD.gn +++ b/chromium/build/config/android/BUILD.gn @@ -48,27 +48,54 @@ config("compiler") { "-Wl,--exclude-libs=libvpx_assembly_arm.a", ] + # $compile_api_level corresponds to the API level used for the sysroot path + # calculation in //build/config/android/config.gni if (current_cpu == "arm") { abi_target = "arm-linux-androideabi" + compile_api_level = android32_ndk_api_level } else if (current_cpu == "x86") { - abi_target = "i686-linux-androideabi" + abi_target = "i686-linux-android" + compile_api_level = android32_ndk_api_level } else if (current_cpu == "arm64") { abi_target = "aarch64-linux-android" + compile_api_level = android64_ndk_api_level } else if (current_cpu == "x64") { # Place holder for x64 support, not tested. # TODO: Enable clang support for Android x64. http://crbug.com/539781 - abi_target = "x86_64-linux-androideabi" + abi_target = "x86_64-linux-android" + compile_api_level = android64_ndk_api_level } else if (current_cpu == "mipsel") { abi_target = "mipsel-linux-android" + compile_api_level = android32_ndk_api_level } else if (current_cpu == "mips64el") { # Place holder for mips64 support, not tested. - abi_target = "mips64el-linux-androideabi" + abi_target = "mips64el-linux-android" + compile_api_level = android64_ndk_api_level } else { assert(false, "Architecture not supported") } - cflags += [ "--target=$abi_target" ] + cflags += [ + "--target=$abi_target", + "-isystem" + + rebase_path("$android_ndk_root/sysroot/usr/include/$abi_target", + root_build_dir), + "-D__ANDROID_API__=$compile_api_level", + + # Temporary workaround for third party dependencies requiring this to be + # defined. + # TODO(crbug.com/771171): Remove this once the third party deps have been + # fixed to be compatible with newer NDK versions + "-D__NDK_FPABI__=", + ] ldflags += [ "--target=$abi_target" ] + # TODO(crbug.com/771171): Remove this define once code that uses it has been + # updated to no longer need it. This is leftover from older Android NDK + # versions. + if (compile_api_level < 20) { + cflags += [ "-DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC=1" ] + } + # Assign any flags set for the C compiler to asmflags so that they are sent # to the assembler. asmflags = cflags @@ -143,28 +170,6 @@ config("runtime_library") { libs += [ "atomic" ] } - # Work around incompatibilities between bionic and clang headers. - # TODO(thakis): Check if we still need this. - defines += [ - "__compiler_offsetof=__builtin_offsetof", - "nan=__builtin_nan", - ] - - if (current_cpu == "x64" || current_cpu == "arm64" || - current_cpu == "mips64el") { - # 64-bit targets build with NDK 21, 32-bit targets with NDK 16 - # (see ./config.gni). When using clang, NDK 21 defines snprintf to - # something for a kind of for of _FORTIFY_SOURCE support, see - # third_party/android_tools/ndk/platforms/android-21/arch-x86_64/usr/include/stdio.h - # Making snprintf a macro breaks base/strings/string_utils.h which - # defines base::snprintf(). So define snprintf to itself to force the - # NDK to not redefine it. This disables _chk for snprintf, but since - # 32-bit versions use NDK 16 which doesn't have any fortify support, that - # seems ok. b/32067310 tracks better fortify support with clang. - # TODO(thakis): Remove this once b/32067310 is fixed. - defines += [ "snprintf=snprintf" ] - } - # TODO(jdduke) Re-enable on mips after resolving linking # issues with libc++ (crbug.com/456380). if (current_cpu != "mipsel" && current_cpu != "mips64el") { @@ -211,7 +216,11 @@ config("default_cygprofile_instrumentation") { config("cygprofile_instrumentation") { defines = [ "CYGPROFILE_INSTRUMENTATION=1" ] - cflags = [ "-finstrument-functions-after-inlining" ] + if (use_lightweight_order_profiling) { + cflags = [ "-finstrument-function-entry-bare" ] + } else { + cflags = [ "-finstrument-functions-after-inlining" ] + } } config("no_cygprofile_instrumentation") { diff --git a/chromium/build/config/android/config.gni b/chromium/build/config/android/config.gni index d8eb8db67cb..a533ce96135 100644 --- a/chromium/build/config/android/config.gni +++ b/chromium/build/config/android/config.gni @@ -23,6 +23,12 @@ if (is_android) { # The main purpose of this argument is to avoid having to maintain 2 # repositories to support both public only and internal builds. enable_chrome_android_internal = has_chrome_android_internal + + # Android API level for 32 bits platforms + android32_ndk_api_level = 16 + + # Android API level for 64 bits platforms + android64_ndk_api_level = 21 } if (enable_chrome_android_internal) { @@ -33,6 +39,16 @@ if (is_android) { # Android SDK release. Currently, only "o_mr1" is publicly supported. android_sdk_release = default_android_sdk_release } + + # This is the result of profiling Chromium. Blindly applying it to arbitrary + # downstream projects and hoping it'll grant a speedup seems fragile. (Not + # to mention that it resides in a Chromium-specific directory.) + if (build_with_chromium) { + # The default AFDO profile used by public builds. Value may differ in + # internal builds. + clang_default_afdo_profile = + rebase_path("//chrome/android/profiles/chrome-profile-3309-text.prof") + } } if (!defined(extra_chrome_shared_library_configs)) { @@ -43,9 +59,9 @@ if (is_android) { } if (!defined(default_android_ndk_root)) { - default_android_ndk_root = "//third_party/android_tools/ndk" - default_android_ndk_version = "r12b" - default_android_ndk_major_version = 12 + default_android_ndk_root = "//third_party/android_ndk" + default_android_ndk_version = "r16" + default_android_ndk_major_version = 16 } else { assert(defined(default_android_ndk_version)) assert(defined(default_android_ndk_major_version)) @@ -243,23 +259,18 @@ if (is_android) { # Subdirectories inside android_ndk_root that contain the sysroot for the # associated platform. - # If you raise this, reevaluate the snprintf=snprintf in ./BUILD.gn. - _android_api_level = 16 x86_android_sysroot_subdir = - "platforms/android-${_android_api_level}/arch-x86" + "platforms/android-${android32_ndk_api_level}/arch-x86" arm_android_sysroot_subdir = - "platforms/android-${_android_api_level}/arch-arm" + "platforms/android-${android32_ndk_api_level}/arch-arm" mips_android_sysroot_subdir = - "platforms/android-${_android_api_level}/arch-mips" - - # If you raise this, reevaluate the snprintf=snprintf in ./BUILD.gn. - _android64_api_level = 21 + "platforms/android-${android32_ndk_api_level}/arch-mips" x86_64_android_sysroot_subdir = - "platforms/android-${_android64_api_level}/arch-x86_64" + "platforms/android-${android64_ndk_api_level}/arch-x86_64" arm64_android_sysroot_subdir = - "platforms/android-${_android64_api_level}/arch-arm64" + "platforms/android-${android64_ndk_api_level}/arch-arm64" mips64_android_sysroot_subdir = - "platforms/android-${_android64_api_level}/arch-mips64" + "platforms/android-${android64_ndk_api_level}/arch-mips64" # Toolchain root directory for each build. The actual binaries are inside # a "bin" directory inside of these. diff --git a/chromium/build/config/android/internal_rules.gni b/chromium/build/config/android/internal_rules.gni index cd2941d837b..6278645c5db 100644 --- a/chromium/build/config/android/internal_rules.gni +++ b/chromium/build/config/android/internal_rules.gni @@ -32,7 +32,6 @@ _java_target_whitelist = [ # TODO(agrieve): Rename targets below to match above patterns. "*android_webview/glue:glue", - "//chrome/test/android/cast_emulator:cast_emulator", ] # Targets that match the whitelist but are not actually java targets. @@ -53,14 +52,13 @@ _default_proguard_jar_path = "//third_party/proguard/lib/proguard.jar" # See build/android/gyp/write_build_config.py and # build/android/gyp/util/build_utils.py:ExpandFileArgs template("write_build_config") { - type = invoker.type - _is_prebuilt_binary = - defined(invoker.is_prebuilt_binary) && invoker.is_prebuilt_binary + _type = invoker.type # Don't need to enforce naming scheme for these targets since we never # consider them in dependency chains. - if (!_is_prebuilt_binary && type != "android_apk" && type != "java_binary" && - type != "resource_rewriter" && type != "dist_jar") { + if (_type != "android_apk" && _type != "java_binary" && + _type != "resource_rewriter" && _type != "dist_jar" && + _type != "java_annotation_processor" && _type != "dist_aar") { set_sources_assignment_filter(_java_target_whitelist) _parent_invoker = invoker.invoker _target_label = @@ -82,15 +80,6 @@ template("write_build_config") { } action(target_name) { - set_sources_assignment_filter([]) - build_config = invoker.build_config - - assert(type == "android_apk" || type == "java_library" || - type == "android_resources" || type == "deps_dex" || - type == "dist_jar" || type == "android_assets" || - type == "resource_rewriter" || type == "java_binary" || - type == "group" || type == "java_prebuilt" || type == "junit_binary") - forward_variables_from(invoker, [ "deps", @@ -99,10 +88,16 @@ template("write_build_config") { if (!defined(deps)) { deps = [] } + if (defined(invoker.android_manifest_dep)) { + deps += [ invoker.android_manifest_dep ] + } script = "//build/android/gyp/write_build_config.py" depfile = "$target_gen_dir/$target_name.d" inputs = [] + outputs = [ + invoker.build_config, + ] _deps_configs = [] if (defined(invoker.possible_config_deps)) { @@ -127,72 +122,71 @@ template("write_build_config") { } sources = [] } - set_sources_assignment_filter([]) } _rebased_deps_configs = rebase_path(_deps_configs, root_build_dir) - outputs = [ - build_config, - ] - args = [ - "--type", - type, + "--type=$_type", "--depfile", rebase_path(depfile, root_build_dir), "--deps-configs=$_rebased_deps_configs", "--build-config", - rebase_path(build_config, root_build_dir), + rebase_path(invoker.build_config, root_build_dir), ] - is_apk = type == "android_apk" - is_android_assets = type == "android_assets" - is_android_resources = type == "android_resources" - is_deps_dex = type == "deps_dex" - is_group = type == "group" - - supports_android = - is_apk || is_android_assets || is_android_resources || is_deps_dex || - is_group || - (defined(invoker.supports_android) && invoker.supports_android) - requires_android = - is_apk || is_android_assets || is_android_resources || is_deps_dex || - (defined(invoker.requires_android) && invoker.requires_android) - - assert(!requires_android || supports_android, - "requires_android requires" + " supports_android") - - # Mark these variables as used. - assert(is_apk || true) - assert(is_android_resources || true) - assert(is_deps_dex || true) - assert(is_group || true) - if (defined(invoker.jar_path)) { args += [ "--jar-path", rebase_path(invoker.jar_path, root_build_dir), ] } - + if (defined(invoker.unprocessed_jar_path)) { + args += [ + "--unprocessed-jar-path", + rebase_path(invoker.unprocessed_jar_path, root_build_dir), + ] + } + if (defined(invoker.ijar_path)) { + args += [ + "--interface-jar-path", + rebase_path(invoker.ijar_path, root_build_dir), + ] + } if (defined(invoker.java_resources_jar)) { args += [ "--java-resources-jar-path", rebase_path(invoker.java_resources_jar, root_build_dir), ] } + if (defined(invoker.annotation_processor_deps)) { + _processor_configs = [] + foreach(_processor_dep, invoker.annotation_processor_deps) { + _target_label = get_label_info(_processor_dep, "label_no_toolchain") + _dep_gen_dir = get_label_info(_processor_dep, "target_gen_dir") + _dep_name = get_label_info(_processor_dep, "name") + deps += [ "${_target_label}__build_config" ] + _processor_configs += [ "$_dep_gen_dir/$_dep_name.build_config" ] + } + _rebased_processor_configs = + rebase_path(_processor_configs, root_build_dir) + args += [ "--annotation-processor-configs=$_rebased_processor_configs" ] + } + if (defined(invoker.dex_path)) { args += [ "--dex-path", rebase_path(invoker.dex_path, root_build_dir), ] } - if (supports_android) { + if (defined(invoker.supports_android) && invoker.supports_android) { args += [ "--supports-android" ] } - if (requires_android) { + if (defined(invoker.requires_android) && invoker.requires_android) { args += [ "--requires-android" ] } + if (defined(invoker.is_prebuilt) && invoker.is_prebuilt) { + args += [ "--is-prebuilt" ] + } if (defined(invoker.bypass_platform_checks) && invoker.bypass_platform_checks) { args += [ "--bypass-platform-checks" ] @@ -211,104 +205,97 @@ template("write_build_config") { ] } - if (is_android_assets) { - if (defined(invoker.asset_sources)) { - _rebased_asset_sources = - rebase_path(invoker.asset_sources, root_build_dir) - args += [ "--asset-sources=$_rebased_asset_sources" ] - } - if (defined(invoker.asset_renaming_sources)) { - _rebased_asset_renaming_sources = - rebase_path(invoker.asset_renaming_sources, root_build_dir) - args += [ "--asset-renaming-sources=$_rebased_asset_renaming_sources" ] + if (defined(invoker.asset_sources)) { + _rebased_asset_sources = + rebase_path(invoker.asset_sources, root_build_dir) + args += [ "--asset-sources=$_rebased_asset_sources" ] + } + if (defined(invoker.asset_renaming_sources)) { + _rebased_asset_renaming_sources = + rebase_path(invoker.asset_renaming_sources, root_build_dir) + args += [ "--asset-renaming-sources=$_rebased_asset_renaming_sources" ] - # These are zip paths, so no need to rebase. - args += [ "--asset-renaming-destinations=${invoker.asset_renaming_destinations}" ] - } - if (defined(invoker.disable_compression) && invoker.disable_compression) { - args += [ "--disable-asset-compression" ] - } - if (defined(invoker.treat_as_locale_paks) && - invoker.treat_as_locale_paks) { - args += [ "--treat-as-locale-paks" ] - } + # These are zip paths, so no need to rebase. + args += [ + "--asset-renaming-destinations=${invoker.asset_renaming_destinations}", + ] + } + if (defined(invoker.disable_compression) && invoker.disable_compression) { + args += [ "--disable-asset-compression" ] + } + if (defined(invoker.treat_as_locale_paks) && invoker.treat_as_locale_paks) { + args += [ "--treat-as-locale-paks" ] } - if (is_android_resources || is_apk) { - if (defined(invoker.resources_zip)) { - args += [ - "--resources-zip", - rebase_path(invoker.resources_zip, root_build_dir), - ] - } - if (defined(invoker.android_manifest)) { - inputs += [ invoker.android_manifest ] - args += [ - "--android-manifest", - rebase_path(invoker.android_manifest, root_build_dir), - ] - } else { - assert(!is_apk, "apk build configs require an android_manifest") - } - if (defined(invoker.custom_package)) { - args += [ - "--package-name", - invoker.custom_package, - ] - } - if (defined(invoker.r_text)) { - args += [ - "--r-text", - rebase_path(invoker.r_text, root_build_dir), - ] - } + if (defined(invoker.android_manifest)) { + inputs += [ invoker.android_manifest ] + args += [ + "--android-manifest", + rebase_path(invoker.android_manifest, root_build_dir), + ] + } + if (defined(invoker.resources_zip)) { + args += [ + "--resources-zip", + rebase_path(invoker.resources_zip, root_build_dir), + ] + } + if (defined(invoker.custom_package)) { + args += [ + "--package-name", + invoker.custom_package, + ] + } + if (defined(invoker.r_text)) { + args += [ + "--r-text", + rebase_path(invoker.r_text, root_build_dir), + ] } - if (is_android_resources && defined(invoker.resource_dirs)) { + if (defined(invoker.resource_dirs)) { resource_dirs = rebase_path(invoker.resource_dirs, root_build_dir) args += [ "--resource-dirs=$resource_dirs" ] } - if (is_apk) { - if (defined(invoker.shared_libraries_runtime_deps_file)) { - # Don't list shared_libraries_runtime_deps_file as an input in order to - # avoid having to depend on the runtime_deps target. See comment in - # rules.gni for why we do this. - args += [ - "--shared-libraries-runtime-deps", - rebase_path(invoker.shared_libraries_runtime_deps_file, - root_build_dir), - ] - } + if (defined(invoker.shared_libraries_runtime_deps_file)) { + # Don't list shared_libraries_runtime_deps_file as an input in order to + # avoid having to depend on the runtime_deps target. See comment in + # rules.gni for why we do this. + args += [ + "--shared-libraries-runtime-deps", + rebase_path(invoker.shared_libraries_runtime_deps_file, root_build_dir), + ] + } - if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) { - # Don't list secondary_abi_shared_libraries_runtime_deps_file as an - # input in order to avoid having to depend on the runtime_deps target. - # See comment in rules.gni for why we do this. - args += [ - "--secondary-abi-shared-libraries-runtime-deps", - rebase_path(invoker.secondary_abi_shared_libraries_runtime_deps_file, - root_build_dir), - ] - } + if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) { + # Don't list secondary_abi_shared_libraries_runtime_deps_file as an + # input in order to avoid having to depend on the runtime_deps target. + # See comment in rules.gni for why we do this. + args += [ + "--secondary-abi-shared-libraries-runtime-deps", + rebase_path(invoker.secondary_abi_shared_libraries_runtime_deps_file, + root_build_dir), + ] + } - if (defined(invoker.apk_path)) { - _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) - _rebased_incremental_apk_path = - rebase_path(invoker.incremental_apk_path, root_build_dir) - _rebased_incremental_install_json_path = - rebase_path(invoker.incremental_install_json_path, root_build_dir) - _incremental_allowed = - defined(invoker.incremental_allowed) && invoker.incremental_allowed - args += [ "--apk-path=$_rebased_apk_path" ] - args += [ "--incremental-install-json-path=$_rebased_incremental_install_json_path" ] - - assert(_rebased_incremental_apk_path != "") # Mark as used. - if (_incremental_allowed) { - args += [ "--incremental-apk-path=$_rebased_incremental_apk_path" ] - } + if (defined(invoker.apk_path)) { + _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) + _rebased_incremental_apk_path = + rebase_path(invoker.incremental_apk_path, root_build_dir) + _rebased_incremental_install_json_path = + rebase_path(invoker.incremental_install_json_path, root_build_dir) + _incremental_allowed = + defined(invoker.incremental_allowed) && invoker.incremental_allowed + args += [ "--apk-path=$_rebased_apk_path" ] + args += [ "--incremental-install-json-path=$_rebased_incremental_install_json_path" ] + + assert(_rebased_incremental_apk_path != "") # Mark as used. + if (_incremental_allowed) { + args += [ "--incremental-apk-path=$_rebased_incremental_apk_path" ] } } + if (defined(invoker.non_native_packed_relocations) && invoker.non_native_packed_relocations) { args += [ "--non-native-packed-relocations" ] @@ -770,7 +757,7 @@ if (enable_java_templates) { lint_suppressions_file = "//build/android/lint/suppressions.xml" } - _lint_path = "$lint_android_sdk_root/tools-lint/bin/lint" + _lint_path = "$lint_android_sdk_root/tools/bin/lint" _cache_dir = "$root_build_dir/android_lint_cache" _result_path = "$target_gen_dir/$target_name/result.xml" _config_path = "$target_gen_dir/$target_name/config.xml" @@ -783,7 +770,6 @@ if (enable_java_templates) { inputs = [ _platform_xml_path, _suppressions_file, - invoker.android_manifest, ] outputs = [ @@ -803,14 +789,20 @@ if (enable_java_templates) { rebase_path(depfile, root_build_dir), "--config-path", rebase_path(_suppressions_file, root_build_dir), - "--manifest-path", - rebase_path(invoker.android_manifest, root_build_dir), "--product-dir=.", "--processed-config-path", rebase_path(_config_path, root_build_dir), "--result-path", rebase_path(_result_path, root_build_dir), + "--include-unexpected-failures", ] + if (defined(invoker.android_manifest)) { + inputs += [ invoker.android_manifest ] + args += [ + "--manifest-path", + rebase_path(invoker.android_manifest, root_build_dir), + ] + } if (defined(invoker.disable)) { args += [ "--disable=${invoker.disable}" ] @@ -919,50 +911,54 @@ if (enable_java_templates) { # # Variables # main_class: The class containing the program entry point. - # jar_path: The path to the jar to run. + # jar_file: Optional first classpath entry. # script_name: Name of the script to generate. # build_config: Path to .build_config for the jar (contains classpath). # wrapper_script_args: List of extra arguments to pass to the executable. # template("java_binary_script") { - set_sources_assignment_filter([]) - forward_variables_from(invoker, [ "testonly" ]) + action(target_name) { + forward_variables_from(invoker, + [ + "deps", + "testonly", + ]) - _main_class = invoker.main_class - _build_config = invoker.build_config - _jar_path = invoker.jar_path - _script_name = invoker.script_name + _main_class = invoker.main_class + _build_config = invoker.build_config + _script_name = invoker.script_name - action(target_name) { script = "//build/android/gyp/create_java_binary_script.py" depfile = "$target_gen_dir/$_script_name.d" - java_script = "$root_build_dir/bin/$_script_name" + _java_script = "$root_build_dir/bin/$_script_name" inputs = [ _build_config, ] outputs = [ - java_script, + _java_script, ] - forward_variables_from(invoker, [ "deps" ]) _rebased_build_config = rebase_path(_build_config, root_build_dir) args = [ "--depfile", rebase_path(depfile, root_build_dir), "--output", - rebase_path(java_script, root_build_dir), - "--classpath=@FileArg($_rebased_build_config:deps_info:java:full_classpath)", - "--jar-path", - rebase_path(_jar_path, root_build_dir), + rebase_path(_java_script, root_build_dir), "--main-class", _main_class, ] + if (defined(invoker.jar_path)) { + _jar_path_list = [ rebase_path(invoker.jar_path, root_build_dir) ] + args += [ "--classpath=$_jar_path_list" ] + } + args += [ "--classpath=@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)" ] + if (emma_coverage) { args += [ "--classpath", rebase_path("//third_party/android_tools/sdk/tools/lib/emma.jar", root_build_dir), + "--noverify", ] - args += [ "--noverify" ] } if (defined(invoker.wrapper_script_args)) { args += [ "--" ] + invoker.wrapper_script_args @@ -1110,6 +1106,60 @@ if (enable_java_templates) { } } + template("emma_instr") { + action(target_name) { + forward_variables_from(invoker, + [ + "deps", + "public_deps", + "testonly", + ]) + + _coverage_file = "$target_out_dir/${target_name}.em" + _source_dirs_listing_file = "$target_out_dir/${target_name}_sources.txt" + _emma_jar = "${android_sdk_root}/tools/lib/emma.jar" + + script = "//build/android/gyp/emma_instr.py" + depfile = "${target_gen_dir}/${target_name}.d" + inputs = invoker.java_files + [ + _emma_jar, + invoker.input_jar_path, + ] + outputs = [ + _coverage_file, + _source_dirs_listing_file, + invoker.output_jar_path, + ] + args = [ + "instrument_jar", + "--input-path", + rebase_path(invoker.input_jar_path, root_build_dir), + "--output-path", + rebase_path(invoker.output_jar_path, root_build_dir), + "--depfile", + rebase_path(depfile, root_build_dir), + "--coverage-file", + rebase_path(_coverage_file, root_build_dir), + "--sources-list-file", + rebase_path(_source_dirs_listing_file, root_build_dir), + "--src-root", + rebase_path("//", root_build_dir), + "--emma-jar", + rebase_path(_emma_jar, root_build_dir), + ] + _rebased_java_sources_file = + rebase_path(invoker.java_sources_file, root_build_dir) + args += [ "--java-sources-file=$_rebased_java_sources_file" ] + + if (emma_filter != "") { + args += [ + "--filter-string", + emma_filter, + ] + } + } + } + template("process_java_prebuilt") { set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) @@ -1130,6 +1180,7 @@ if (enable_java_templates) { invoker.enable_build_hooks_android _desugar = defined(invoker.supports_android) && invoker.supports_android + _emma_instrument = invoker.emma_instrument _jar_excluded_patterns = [] if (defined(invoker.jar_excluded_patterns)) { @@ -1202,7 +1253,7 @@ if (enable_java_templates) { "--extra-classpath-jar", rebase_path(_android_sdk_jar, root_build_dir), "--extra-classpath-jar", - "@FileArg($_rebased_build_config:deps_info:java:full_classpath)", + "@FileArg($_rebased_build_config:deps_info:javac_full_classpath)", ] } @@ -1294,6 +1345,36 @@ if (enable_java_templates) { _previous_output_jar = _filter_output_jar } + if (_emma_instrument) { + # Emma must run after desugar (or else desugar sometimes fails). + _emma_target = "${target_name}__emma" + _emma_input_jar = _previous_output_jar + _emma_output_jar = "$target_out_dir/$target_name-instrumented.jar" + + emma_instr(_emma_target) { + deps = _deps + if (defined(invoker.deps)) { + deps += invoker.deps + } + if (defined(invoker.public_deps)) { + public_deps = invoker.public_deps + } + + forward_variables_from(invoker, + [ + "java_files", + "java_sources_file", + ]) + + input_jar_path = _emma_input_jar + output_jar_path = _emma_output_jar + } + + _deps = [] + _deps = [ ":$_emma_target" ] + _previous_output_jar = _emma_output_jar + } + _output_jar_target = "${target_name}__copy" # This is copy_ex rather than copy to ensure that JARs (rather than @@ -1328,62 +1409,25 @@ if (enable_java_templates) { } } - template("emma_instr") { - action(target_name) { - forward_variables_from(invoker, - [ - "deps", - "testonly", - ]) - - _coverage_file = "$target_out_dir/${target_name}.em" - _source_dirs_listing_file = "$target_out_dir/${target_name}_sources.txt" - _emma_jar = "${android_sdk_root}/tools/lib/emma.jar" - - script = "//build/android/gyp/emma_instr.py" - depfile = "${target_gen_dir}/${target_name}.d" - inputs = invoker.java_files + [ - _emma_jar, - invoker.input_jar_path, - ] - outputs = [ - _coverage_file, - _source_dirs_listing_file, - invoker.output_jar_path, - ] - args = [ - "instrument_jar", - "--input-path", - rebase_path(invoker.input_jar_path, root_build_dir), - "--output-path", - rebase_path(invoker.output_jar_path, root_build_dir), - "--depfile", - rebase_path(depfile, root_build_dir), - "--coverage-file", - rebase_path(_coverage_file, root_build_dir), - "--sources-list-file", - rebase_path(_source_dirs_listing_file, root_build_dir), - "--src-root", - rebase_path("//", root_build_dir), - "--emma-jar", - rebase_path(_emma_jar, root_build_dir), - ] - _rebased_java_sources_file = - rebase_path(invoker.java_sources_file, root_build_dir) - args += [ "--java-sources-file=$_rebased_java_sources_file" ] - - if (emma_filter != "") { - args += [ - "--filter-string", - emma_filter, - ] - } - } - } - # Runs process_resources.py template("process_resources") { - action(target_name) { + _process_resources_target_name = target_name + if (defined(invoker.srcjar_path)) { + _srcjar_path = invoker.srcjar_path + } + if (defined(invoker.output)) { + _post_process = defined(invoker.post_process_script) + _packaged_resources_path = invoker.output + if (_post_process) { + _process_resources_target_name = "${target_name}__intermediate" + _packaged_resources_path = + get_path_info(_packaged_resources_path, "dir") + "/" + + get_path_info(_packaged_resources_path, "name") + + ".intermediate.ap_" + _srcjar_path = "${_srcjar_path}.intermediate.srcjar" + } + } + action(_process_resources_target_name) { set_sources_assignment_filter([]) forward_variables_from(invoker, [ @@ -1426,8 +1470,8 @@ if (enable_java_templates) { } inputs = [ + android_default_aapt_path, invoker.build_config, - invoker.android_manifest, _android_aapt_path, _android_sdk_jar, ] @@ -1443,28 +1487,66 @@ if (enable_java_templates) { rebase_path(_android_sdk_jar, root_build_dir), "--aapt-path", rebase_path(_android_aapt_path, root_build_dir), - "--android-manifest", - rebase_path(invoker.android_manifest, root_build_dir), - "--resource-dirs=$_rebased_all_resource_dirs", "--dependencies-res-zips=@FileArg($_rebased_build_config:resources:dependency_zips)", "--extra-res-packages=@FileArg($_rebased_build_config:resources:extra_package_names)", "--extra-r-text-files=@FileArg($_rebased_build_config:resources:extra_r_text_files)", ] - if (defined(invoker.zip_path)) { - outputs += [ invoker.zip_path ] + if (defined(invoker.android_manifest)) { + inputs += [ invoker.android_manifest ] args += [ - "--resource-zip-out", - rebase_path(invoker.zip_path, root_build_dir), + "--android-manifest", + rebase_path(invoker.android_manifest, root_build_dir), ] } - if (defined(invoker.all_resources_zip_path)) { - _all_resources_zip = invoker.all_resources_zip_path - outputs += [ _all_resources_zip ] + if (_rebased_all_resource_dirs != []) { + args += [ "--resource-dirs=$_rebased_all_resource_dirs" ] + } + + if (defined(invoker.shared_resources_whitelist)) { + inputs += [ invoker.shared_resources_whitelist ] args += [ - "--all-resources-zip-out", - rebase_path(_all_resources_zip, root_build_dir), + "--shared-resources-whitelist", + rebase_path(invoker.shared_resources_whitelist, root_build_dir), + ] + } + + if (defined(invoker.no_xml_namespaces) && invoker.no_xml_namespaces) { + args += [ "--no-xml-namespaces" ] + } + + if (defined(invoker.version_code)) { + args += [ + "--version-code", + invoker.version_code, + ] + } + if (defined(invoker.version_name)) { + args += [ + "--version-name", + invoker.version_name, + ] + } + if (defined(_packaged_resources_path)) { + outputs += [ _packaged_resources_path ] + args += [ + "--apk-path", + rebase_path(_packaged_resources_path, root_build_dir), + ] + } + + # Useful to have android:debuggable in the manifest even for Release + # builds. Just omit it for officai + if (debuggable_apks) { + args += [ "--debuggable" ] + } + + if (defined(invoker.zip_path)) { + outputs += [ invoker.zip_path ] + args += [ + "--resource-zip-out", + rebase_path(invoker.zip_path, root_build_dir), ] } @@ -1476,11 +1558,11 @@ if (enable_java_templates) { ] } - if (defined(invoker.srcjar_path)) { - outputs += [ invoker.srcjar_path ] + if (defined(_srcjar_path)) { + outputs += [ _srcjar_path ] args += [ "--srcjar-out", - rebase_path(invoker.srcjar_path, root_build_dir), + rebase_path(_srcjar_path, root_build_dir), ] } @@ -1517,11 +1599,6 @@ if (enable_java_templates) { args += [ "--app-as-shared-lib" ] } - if (defined(invoker.include_all_resources) && - invoker.include_all_resources) { - args += [ "--include-all-resources" ] - } - if (defined(invoker.proguard_file)) { outputs += [ invoker.proguard_file ] args += [ @@ -1538,112 +1615,6 @@ if (enable_java_templates) { ] } - if (defined(invoker.support_zh_hk) && invoker.support_zh_hk) { - args += [ "--support-zh-hk" ] - } - - if (defined(invoker.args)) { - args += invoker.args - } - } - } - - # Runs aapt to create an .ap_ file, which is a zip file containing - # compiled xml and a resources.arsc file. - # - # Required Variables: - # output: Path to .ap_ to create. - # android_manifest: The AndroidManifest.xml for the apk. - # version_code: The verison code to use. - # version_name: The verison name to use. - # Optional Variables: - # aapt_locale_whitelist: If set, all locales not in this list will be - # stripped from resources.arsc. - # alternative_android_sdk_jar: An alternative android sdk jar. - # app_as_shared_lib: Enables --app-as-shared-lib. - # exclude_xxxhdpi: Causes all drawable-xxxhdpi images to be excluded - # (mipmaps are still included). - # png_to_webp: If true, pngs (with the exception of 9-patch) are - # converted to webp. - # post_process_script: Script to call to post-process the .ap_. - # resources_zip: Resource .zip file created by process_resources to package. - # shared_resources: Enables --shared-lib. - # density_splits: A list of densities to create apk splits for. - # language_splits: A list of language codes to create apk splits for. - # xxxhdpi_whitelist: A list of globs used when exclude_xxxhdpi=true. Files - # that match this whitelist will still be included. - template("package_resources") { - _post_process = defined(invoker.post_process_script) - _package_resources_target_name = target_name - _packaged_resources_path = invoker.output - if (_post_process) { - _package_resources_target_name = "${target_name}__intermediate" - _packaged_resources_path = - get_path_info(_packaged_resources_path, "dir") + "/" + - get_path_info(_packaged_resources_path, "name") + ".intermediate.ap_" - } - - action(_package_resources_target_name) { - forward_variables_from(invoker, - [ - "deps", - "testonly", - "visibility", - ]) - - script = "//build/android/gyp/package_resources.py" - depfile = "${target_gen_dir}/${target_name}.d" - outputs = [ - _packaged_resources_path, - ] - - _android_sdk_jar = android_sdk_jar - if (defined(invoker.alternative_android_sdk_jar)) { - _android_sdk_jar = invoker.alternative_android_sdk_jar - } - - inputs = [ - android_default_aapt_path, - _android_sdk_jar, - invoker.android_manifest, - ] - - args = [ - "--depfile", - rebase_path(depfile, root_build_dir), - "--android-sdk-jar", - rebase_path(_android_sdk_jar, root_build_dir), - "--aapt-path", - rebase_path(android_default_aapt_path, root_build_dir), - "--android-manifest", - rebase_path(invoker.android_manifest, root_build_dir), - "--version-code", - invoker.version_code, - "--version-name", - invoker.version_name, - "--apk-path", - rebase_path(_packaged_resources_path, root_build_dir), - ] - - # Useful to have android:debuggable in the manifest even for Release - # builds. Just omit it for officai - if (debuggable_apks) { - args += [ "--debuggable" ] - } - - if (defined(invoker.resources_zip)) { - inputs += [ invoker.resources_zip ] - args += [ - "--resource-zips", - rebase_path(invoker.resources_zip, root_build_dir), - ] - } - if (defined(invoker.shared_resources) && invoker.shared_resources) { - args += [ "--shared-resources" ] - } - if (defined(invoker.app_as_shared_lib) && invoker.app_as_shared_lib) { - args += [ "--app-as-shared-lib" ] - } if (defined(invoker.density_splits) && invoker.density_splits != []) { args += [ "--create-density-splits" ] foreach(_density, invoker.density_splits) { @@ -1675,32 +1646,42 @@ if (enable_java_templates) { args += [ "--xxxhdpi-whitelist=${invoker.xxxhdpi_whitelist}" ] } } + if (defined(invoker.support_zh_hk) && invoker.support_zh_hk) { args += [ "--support-zh-hk" ] } + + if (defined(invoker.args)) { + args += invoker.args + } } - if (_post_process) { + if (defined(_packaged_resources_path) && _post_process) { action(target_name) { depfile = "${target_gen_dir}/${target_name}.d" script = invoker.post_process_script args = [ - "--depfile", - rebase_path(depfile, root_build_dir), - "--apk-path", - rebase_path(_packaged_resources_path, root_build_dir), - "--output", - rebase_path(invoker.output, root_build_dir), - ] + "--depfile", + rebase_path(depfile, root_build_dir), + "--apk-path", + rebase_path(_packaged_resources_path, root_build_dir), + "--output", + rebase_path(invoker.output, root_build_dir), + "--srcjar-in", + rebase_path(_srcjar_path, root_build_dir), + "--srcjar-out", + rebase_path(invoker.srcjar_path, root_build_dir), + ] + invoker.post_process_args inputs = [ + _srcjar_path, _packaged_resources_path, ] outputs = [ invoker.output, + invoker.srcjar_path, ] - public_deps = [ - ":${_package_resources_target_name}", - ] + public_deps = + [ ":${_process_resources_target_name}" ] + invoker.post_process_deps } } } @@ -1778,6 +1759,7 @@ if (enable_java_templates) { "--apk-pak-info-path", _apk_pak_info_path, ] + outputs += [ "$root_build_dir/$_apk_pak_info_path" ] } } if (defined(invoker.write_asset_list) && invoker.write_asset_list) { @@ -2113,226 +2095,17 @@ if (enable_java_templates) { } } - template("java_prebuilt_impl") { - set_sources_assignment_filter([]) - forward_variables_from(invoker, [ "testonly" ]) - _supports_android = - defined(invoker.supports_android) && invoker.supports_android - _requires_android = - defined(invoker.requires_android) && invoker.requires_android - - assert(defined(invoker.jar_path)) - if (defined(invoker.output_name)) { - _output_name = invoker.output_name - } else { - _output_name = get_path_info(invoker.jar_path, "name") - } - _base_path = "${target_gen_dir}/$target_name" - - # Jar files can be needed at runtime (by Robolectric tests or java binaries), - # so do not put them under gen/. - _target_dir_name = get_label_info(":$target_name", "dir") - _jar_path = "$root_out_dir/lib.java$_target_dir_name/$_output_name.jar" - _ijar_path = - "$root_out_dir/lib.java$_target_dir_name/$_output_name.interface.jar" - _build_config = _base_path + ".build_config" - - if (_supports_android) { - _dex_path = _base_path + ".dex.jar" - } - _deps = [] - if (defined(invoker.deps)) { - _deps = invoker.deps - } - _jar_deps = [] - if (defined(invoker.jar_dep)) { - _jar_deps = [ invoker.jar_dep ] - } - - _template_name = target_name - - _build_config_target_name = "${_template_name}__build_config" - _process_jar_target_name = "${_template_name}__process_jar" - _ijar_target_name = "${_template_name}__ijar" - if (_supports_android) { - _dex_target_name = "${_template_name}__dex" - } - - _enable_build_hooks = - _supports_android && - (!defined(invoker.no_build_hooks) || !invoker.no_build_hooks) - if (_enable_build_hooks) { - _deps += [ "//build/android/buildhooks:build_hooks_java" ] - } - - # Some testonly targets use their own resources and the code being - # tested will use custom resources so there's no need to enable this - # for testonly targets. - _enable_build_hooks_android = - _enable_build_hooks && _requires_android && - (!defined(invoker.testonly) || !invoker.testonly) - if (_enable_build_hooks_android) { - _deps += [ "//build/android/buildhooks:build_hooks_android_java" ] - } - - write_build_config(_build_config_target_name) { - type = "java_prebuilt" - is_prebuilt_binary = defined(invoker.main_class) - forward_variables_from(invoker, - [ - "input_jars_paths", - "proguard_configs", - ]) - supports_android = _supports_android - requires_android = _requires_android - - if (defined(invoker.deps)) { - possible_config_deps = _deps - } - build_config = _build_config - jar_path = _jar_path - if (_supports_android) { - dex_path = _dex_path - } - if (defined(invoker.include_java_resources) && - invoker.include_java_resources) { - # Use original jar_path because _jar_path points to a library without - # resources. - java_resources_jar = invoker.jar_path - } - } - - process_java_prebuilt(_process_jar_target_name) { - forward_variables_from(invoker, - [ - "jar_excluded_patterns", - "strip_resource_classes", - ]) - - visibility = [ - ":$_ijar_target_name", - ":$_template_name", - ] - if (_supports_android) { - visibility += [ ":$_dex_target_name" ] - } - - supports_android = _supports_android - enable_build_hooks = _enable_build_hooks - enable_build_hooks_android = _enable_build_hooks_android - build_config = _build_config - input_jar_path = invoker.jar_path - output_jar_path = _jar_path - - deps = [ ":$_build_config_target_name" ] + _deps + _jar_deps - } - - generate_interface_jar(_ijar_target_name) { - # Always used the unfiltered .jar to create the interface jar so that - # other targets will resolve filtered classes when depending on - # BuildConfig, NativeLibraries, etc. - input_jar = invoker.jar_path - deps = _deps + _jar_deps - output_jar = _ijar_path - } - - if (_supports_android) { - dex(_dex_target_name) { - sources = [ - _jar_path, - ] - output = _dex_path - deps = [ ":$_process_jar_target_name" ] + _deps + _jar_deps - } - } - - if (defined(invoker.main_class)) { - _binary_script_target_name = "${_template_name}__java_binary_script" - java_binary_script(_binary_script_target_name) { - forward_variables_from(invoker, - [ - "bootclasspath", - "deps", - "main_class", - "wrapper_script_args", - ]) - if (!defined(deps)) { - deps = [] - } - build_config = _build_config - jar_path = _jar_path - script_name = _template_name - if (defined(invoker.wrapper_script_name)) { - script_name = invoker.wrapper_script_name - } - deps += [ ":$_build_config_target_name" ] - } - } - - group(target_name) { - forward_variables_from(invoker, - [ - "data", - "data_deps", - "visibility", - ]) - public_deps = [ - ":$_ijar_target_name", - ":$_process_jar_target_name", - ] - if (_supports_android) { - public_deps += [ ":$_dex_target_name" ] - } - if (defined(invoker.main_class)) { - # Some targets use the generated script while building, so make it a dep - # rather than a data_dep. - public_deps += [ ":$_binary_script_target_name" ] - } - } - } - - # Compiles and jars a set of java files. - # - # Outputs: - # $jar_path.jar - # $jar_path.interface.jar - # - # Variables - # java_files: List of .java files to compile (same as exists in java_sources_file) - # java_sources_file: Path to file containing list of files to compile. - # chromium_code: If true, enable extra warnings. - # srcjar_deps: List of srcjar dependencies. The .java files contained in the - # dependencies srcjar outputs will be compiled and added to the output jar. - # jar_path: Use this to explicitly set the output jar path. Defaults to - # "${target_gen_dir}/${target_name}.jar. - # javac_args: Additional arguments to pass to javac. template("compile_java") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - assert(defined(invoker.build_config)) - assert(defined(invoker.jar_path)) - _build_config = invoker.build_config + _chromium_code = invoker.chromium_code + _requires_android = invoker.requires_android - _chromium_code = false - if (defined(invoker.chromium_code)) { - _chromium_code = invoker.chromium_code - } - - _supports_android = true - if (defined(invoker.supports_android)) { - _supports_android = invoker.supports_android - } - - _requires_android = - defined(invoker.requires_android) && invoker.requires_android - - _enable_errorprone = use_errorprone_java_compiler - if (!_chromium_code) { - _enable_errorprone = false - } else if (defined(invoker.enable_errorprone)) { + if (defined(invoker.enable_errorprone)) { _enable_errorprone = invoker.enable_errorprone + } else { + _enable_errorprone = use_errorprone_java_compiler && _chromium_code } _provider_configurations = [] @@ -2340,13 +2113,6 @@ if (enable_java_templates) { _provider_configurations = invoker.provider_configurations } - _processors = [] - _enable_interface_jars_javac = true - if (defined(invoker.processors_javac)) { - _processors = invoker.processors_javac - _enable_interface_jars_javac = _processors == [] - } - _processor_args = [] if (defined(invoker.processor_args_javac)) { _processor_args = invoker.processor_args_javac @@ -2376,9 +2142,6 @@ if (enable_java_templates) { } _java_srcjars = [] - if (defined(invoker.srcjars)) { - _java_srcjars = invoker.srcjars - } foreach(dep, _srcjar_deps) { _dep_gen_dir = get_label_info(dep, "target_gen_dir") _dep_name = get_label_info(dep, "name") @@ -2390,32 +2153,7 @@ if (enable_java_templates) { _javac_args = invoker.javac_args } - # Mark srcjar_deps as used. - assert(_srcjar_deps == [] || true) - - _javac_target_name = "${target_name}__javac" - _process_prebuilt_target_name = "${target_name}__process_prebuilt" - _ijar_target_name = "${target_name}__ijar" - _final_target_name = target_name - - _final_jar_path = invoker.jar_path - _javac_jar_path = "$target_gen_dir/$target_name.javac.jar" - _process_prebuilt_jar_path = _final_jar_path - _final_ijar_path = get_path_info(_final_jar_path, "dir") + "/" + - get_path_info(_final_jar_path, "name") + ".interface.jar" - - _emma_instrument = defined(invoker.emma_instrument) && - invoker.emma_instrument && invoker.java_files != [] - if (_emma_instrument) { - _emma_instr_target_name = "${target_name}__emma_instr" - _process_prebuilt_jar_path = - "$target_gen_dir/$target_name.process_prebuilt.jar" - } - - _rebased_build_config = rebase_path(_build_config, root_build_dir) - _rebased_jar_path = rebase_path(_javac_jar_path, root_build_dir) - - action(_javac_target_name) { + action(target_name) { script = "//build/android/gyp/javac.py" depfile = "$target_gen_dir/$target_name.d" deps = _srcjar_deps @@ -2424,37 +2162,35 @@ if (enable_java_templates) { } outputs = [ - _javac_jar_path, - _javac_jar_path + ".md5.stamp", - ] - sources = invoker.java_files + _java_srcjars - inputs = [ - _build_config, + invoker.javac_jar_path, + invoker.javac_jar_path + ".md5.stamp", ] + inputs = invoker.java_files + _java_srcjars + [ _build_config ] if (invoker.java_files != []) { inputs += [ invoker.java_sources_file ] } + _rebased_build_config = rebase_path(_build_config, root_build_dir) + _rebased_javac_jar_path = + rebase_path(invoker.javac_jar_path, root_build_dir) _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir) _rebased_depfile = rebase_path(depfile, root_build_dir) args = [ "--depfile=$_rebased_depfile", - "--jar-path=$_rebased_jar_path", + "--jar-path=$_rebased_javac_jar_path", "--java-srcjars=$_rebased_java_srcjars", "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)", "--java-version=1.8", + "--classpath=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)", + "--interface-classpath=@FileArg($_rebased_build_config:deps_info:javac_full_interface_classpath)", + "--processorpath=@FileArg($_rebased_build_config:javac:processor_classpath)", + "--processors=@FileArg($_rebased_build_config:javac:processor_classes)", ] - if (_enable_interface_jars_javac) { - args += [ "--classpath=@FileArg($_rebased_build_config:javac:interface_classpath)" ] - } else { - args += - [ "--classpath=@FileArg($_rebased_build_config:javac:classpath)" ] - } if (_enable_incremental_javac) { args += [ "--incremental" ] deps += [ "//third_party/jmake($default_toolchain)" ] inputs += [ "$root_build_dir/bin/jmake" ] - outputs += [ "${_javac_jar_path}.pdb" ] + outputs += [ "${invoker.javac_jar_path}.pdb" ] } if (_requires_android) { if (defined(invoker.alternative_android_sdk_ijar)) { @@ -2476,22 +2212,20 @@ if (enable_java_templates) { args += [ "--chromium-code=1" ] } if (_enable_errorprone) { - deps += - [ "//third_party/errorprone:errorprone_java($default_toolchain)" ] + deps += [ "//third_party/errorprone:errorprone($default_toolchain)" ] deps += [ "//tools/android/errorprone_plugin:errorprone_plugin_java($default_toolchain)" ] + _rebased_errorprone_processorpath = [ + "lib.java/tools/android/errorprone_plugin/errorprone_plugin_java.jar", + ] args += [ "--use-errorprone-path", - "bin/errorprone_java", - "--processorpath", - "lib.java/tools/android/errorprone_plugin/errorprone_plugin_java.jar", + "bin/errorprone", + "--processorpath=$_rebased_errorprone_processorpath", ] } foreach(e, _provider_configurations) { args += [ "--provider-configuration=" + rebase_path(e, root_build_dir) ] } - foreach(e, _processors) { - args += [ "--processor=" + e ] - } foreach(e, _processor_args) { args += [ "--processor-arg=" + e ] } @@ -2509,119 +2243,96 @@ if (enable_java_templates) { args += [ "--javac-arg=" + e ] } } + } - process_java_prebuilt(_process_prebuilt_target_name) { - forward_variables_from(invoker, - [ - "alternative_android_sdk_ijar", - "alternative_android_sdk_ijar_dep", - "alternative_android_sdk_jar", - "enable_build_hooks", - "enable_build_hooks_android", - "jar_excluded_patterns", - ]) - supports_android = _supports_android - build_config = _build_config - input_jar_path = _javac_jar_path - output_jar_path = _process_prebuilt_jar_path + template("java_library_impl") { + set_sources_assignment_filter([]) + forward_variables_from(invoker, [ "testonly" ]) + _is_prebuilt = defined(invoker.jar_path) + _is_annotation_processor = invoker.type == "java_annotation_processor" + _is_java_binary = + invoker.type == "java_binary" || invoker.type == "junit_binary" + _supports_android = + defined(invoker.supports_android) && invoker.supports_android + _requires_android = + defined(invoker.requires_android) && invoker.requires_android - deps = [ - ":$_javac_target_name", - ] - if (defined(invoker.deps)) { - deps += invoker.deps - } + _main_target_name = target_name + if (defined(invoker.main_target_name)) { + _main_target_name = invoker.main_target_name } + _java_files = [] + if (defined(invoker.java_files)) { + _java_files = invoker.java_files + } + _srcjar_deps = [] + if (defined(invoker.srcjar_deps)) { + _srcjar_deps = invoker.srcjar_deps + } + _has_sources = _java_files != [] || _srcjar_deps != [] - if (_emma_instrument) { - emma_instr(_emma_instr_target_name) { - forward_variables_from(invoker, - [ - "deps", - "java_files", - "java_sources_file", - ]) - - input_jar_path = _process_prebuilt_jar_path - output_jar_path = _final_jar_path - - if (!defined(deps)) { - deps = [] - } - deps += [ ":$_process_prebuilt_target_name" ] - } + if (_is_prebuilt) { + assert(!_has_sources) + } else { + # Allow java_binary to not specify any sources. This is needed when a prebuilt + # is needed as a library as well as a binary. + assert(_is_annotation_processor || _is_java_binary || _has_sources) } - generate_interface_jar(_ijar_target_name) { - # Always used the unfiltered .jar to create the interface jar so that - # other targets will resolve filtered classes when depending on - # BuildConfig, NativeLibraries, etc. - input_jar = _javac_jar_path - deps = [ - ":$_javac_target_name", - ] - output_jar = _final_ijar_path + if (_is_java_binary) { + assert(defined(invoker.main_class), + "${invoker.type}() must set main_class") + } else if (_is_annotation_processor) { + assert(defined(invoker.main_class), + "java_annotation_processor() must set main_class") + } else { + assert(!defined(invoker.main_class), + "main_class cannot be used for target of type ${invoker.type}") } - group(_final_target_name) { - forward_variables_from(invoker, [ "visibility" ]) - public_deps = [ - ":$_ijar_target_name", - ":$_javac_target_name", - ] - if (_emma_instrument) { - public_deps += [ ":$_emma_instr_target_name" ] + if (_is_prebuilt || _has_sources) { + if (defined(invoker.output_name)) { + _output_name = invoker.output_name + } else if (_is_prebuilt) { + _output_name = get_path_info(invoker.jar_path, "name") } else { - public_deps += [ ":$_process_prebuilt_target_name" ] + _output_name = _main_target_name } - } - } - - template("java_library_impl") { - set_sources_assignment_filter([]) - forward_variables_from(invoker, [ "testonly" ]) - _accumulated_deps = [] - if (defined(invoker.deps)) { - _accumulated_deps = invoker.deps - } - # Caller overriding build config must have valid java sources file if it has - # java files. - assert(!defined(invoker.override_build_config) || - !defined(invoker.java_files) || defined(invoker.java_sources_file)) + # Jar files can be needed at runtime (by Robolectric tests or java binaries), + # so do not put them under gen/. + _target_dir_name = get_label_info(":$_main_target_name", "dir") + _final_jar_path = + "$root_out_dir/lib.java$_target_dir_name/$_output_name.jar" + if (defined(invoker.final_jar_path)) { + _final_jar_path = invoker.final_jar_path + } + _final_ijar_path = + get_path_info(_final_jar_path, "dir") + "/" + + get_path_info(_final_jar_path, "name") + ".interface.jar" - assert(defined(invoker.java_files) || defined(invoker.srcjars) || - defined(invoker.srcjar_deps)) - _base_path = "$target_gen_dir/$target_name" - assert(_base_path != "") # Mark as used + if (_has_sources) { + _javac_jar_path = "$target_gen_dir/$_main_target_name.javac.jar" + } - if (defined(invoker.output_name)) { - _output_name = invoker.output_name - } else { - _output_name = target_name - } + if (_is_prebuilt) { + _unprocessed_jar_path = invoker.jar_path + } else { + _unprocessed_jar_path = _javac_jar_path + } - # Jar files can be needed at runtime (by Robolectric tests or java binaries), - # so do not put them under gen/. - target_dir_name = get_label_info(":$target_name", "dir") - _jar_path = "$root_out_dir/lib.java$target_dir_name/$_output_name.jar" - if (defined(invoker.jar_path)) { - _jar_path = invoker.jar_path + if (_supports_android) { + _dex_path = "$target_gen_dir/$_main_target_name.dex.jar" + if (defined(invoker.dex_path)) { + _dex_path = invoker.dex_path + } + } } - _template_name = target_name - - _final_deps = [] - _supports_android = - defined(invoker.supports_android) && invoker.supports_android - _requires_android = - defined(invoker.requires_android) && invoker.requires_android - assert(_requires_android || true) # Mark as used. - _android_manifest = "//build/android/AndroidManifest.xml" - if (defined(invoker.android_manifest)) { - _android_manifest = invoker.android_manifest + _accumulated_deps = [] + if (defined(invoker.deps)) { + _accumulated_deps = invoker.deps } - assert(_android_manifest != "") # Mark as used. _enable_build_hooks = _supports_android && @@ -2646,224 +2357,258 @@ if (enable_java_templates) { if (defined(invoker.chromium_code)) { _chromium_code = invoker.chromium_code } else { - _chromium_code = defined(invoker.java_files) && invoker.java_files != [] - if (_chromium_code) { - # Make chromium_code = false be the default for targets within - # third_party which contain no chromium-namespaced java files. - set_sources_assignment_filter([ "*\bthird_party\b*" ]) - sources = [ - get_label_info(":$target_name", "dir"), - ] - if (sources == []) { - set_sources_assignment_filter([ "*\bchromium\b*" ]) - sources = invoker.java_files - _chromium_code = invoker.java_files != sources - } - set_sources_assignment_filter([]) - sources = [] + # Default based on whether target is in third_party. + set_sources_assignment_filter([ "*\bthird_party\b*" ]) + sources = [ + get_label_info(":$_main_target_name", "dir"), + ] + _chromium_code = sources != [] + if (!_chromium_code && !_is_prebuilt && _java_files != []) { + # Unless third_party code has an org.chromium file in it. + set_sources_assignment_filter([ "*\bchromium\b*" ]) + sources = _java_files + _chromium_code = _java_files != sources } + set_sources_assignment_filter([]) + sources = [] } - _emma_never_instrument = !_chromium_code - if (defined(invoker.emma_never_instrument)) { - _emma_never_instrument = invoker.emma_never_instrument - } - assert(_emma_never_instrument || true) # Mark as used - _emma_instrument = emma_coverage && !_emma_never_instrument - - if (_supports_android) { - _dex_path = _base_path + ".dex.jar" - if (defined(invoker.dex_path)) { - _dex_path = invoker.dex_path + if (defined(_final_jar_path)) { + _emma_instrument = emma_coverage && _chromium_code && _java_files != [] && + (!defined(invoker.testonly) || !invoker.testonly) + if (defined(invoker.emma_never_instrument)) { + _emma_instrument = !invoker.emma_never_instrument && _emma_instrument + } + if (_emma_instrument) { + _accumulated_deps += [ "//third_party/android_tools:emma_device_java" ] } } - _java_files = [] - if (defined(invoker.java_files)) { - _java_files += invoker.java_files - } if (_java_files != []) { + _java_sources_file = "$target_gen_dir/$_main_target_name.sources" if (defined(invoker.java_sources_file)) { _java_sources_file = invoker.java_sources_file - } else { - _java_sources_file = "$_base_path.sources" } write_file(_java_sources_file, rebase_path(_java_files, root_build_dir)) } # Define build_config_deps which will be a list of targets required to # build the _build_config. - if (defined(invoker.override_build_config)) { - _build_config = invoker.override_build_config - } else { - _build_config = _base_path + ".build_config" - build_config_target_name = "${_template_name}__build_config" + _build_config = "$target_gen_dir/$_main_target_name.build_config" + _build_config_target_name = "${_main_target_name}__build_config" - write_build_config(build_config_target_name) { + write_build_config(_build_config_target_name) { + forward_variables_from( + invoker, + [ + "alternative_android_sdk_ijar", + "annotation_processor_deps", + "apk_path", + "apk_under_test", + "classpath_deps", + "gradle_treat_as_prebuilt", + "incremental_allowed", + "incremental_apk_path", + "incremental_install_json_path", + "proguard_enabled", + "proguard_info", + "non_native_packed_relocations", + "shared_libraries_runtime_deps_file", + "secondary_abi_shared_libraries_runtime_deps_file", + "input_jars_paths", + "main_class", + "proguard_configs", + "type", + ]) + if (type == "android_apk") { forward_variables_from(invoker, [ - "alternative_android_sdk_ijar", - "classpath_deps", - "gradle_treat_as_prebuilt", - "input_jars_paths", - "main_class", - "proguard_configs", + "android_manifest", + "android_manifest_dep", ]) - if (defined(invoker.is_java_binary) && invoker.is_java_binary) { - type = "java_binary" - } else { - type = "java_library" - } - possible_config_deps = _accumulated_deps - supports_android = _supports_android - requires_android = _requires_android - bypass_platform_checks = defined(invoker.bypass_platform_checks) && - invoker.bypass_platform_checks + } + build_config = _build_config + is_prebuilt = _is_prebuilt + possible_config_deps = _accumulated_deps + supports_android = _supports_android + requires_android = _requires_android + bypass_platform_checks = defined(invoker.bypass_platform_checks) && + invoker.bypass_platform_checks - build_config = _build_config - jar_path = _jar_path - if (_supports_android) { - dex_path = _dex_path - } - if (_java_files != []) { - java_sources_file = _java_sources_file - } + if (defined(_final_jar_path)) { + jar_path = _final_jar_path + ijar_path = _final_ijar_path + unprocessed_jar_path = _unprocessed_jar_path + } + if (defined(_dex_path)) { + dex_path = _dex_path + } + if (_java_files != []) { + java_sources_file = _java_sources_file + } - if (defined(invoker.srcjar_deps)) { - bundled_srcjars = [] - foreach(d, invoker.srcjar_deps) { - _dep_gen_dir = get_label_info(d, "target_gen_dir") - _dep_name = get_label_info(d, "name") - bundled_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ] - } - } + bundled_srcjars = [] + foreach(d, _srcjar_deps) { + _dep_gen_dir = get_label_info(d, "target_gen_dir") + _dep_name = get_label_info(d, "name") + bundled_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ] } - _accumulated_deps += [ ":$build_config_target_name" ] + if (defined(invoker.include_java_resources) && + invoker.include_java_resources) { + # Use original jar_path because _jar_path points to a library without + # resources. + java_resources_jar = invoker.jar_path + } + } + _accumulated_deps += [ ":$_build_config_target_name" ] + if (defined(invoker.android_manifest_dep)) { + _accumulated_deps += [ invoker.android_manifest_dep ] } if (defined(invoker.classpath_deps)) { _accumulated_deps += invoker.classpath_deps } - - _srcjar_deps = [] - if (defined(invoker.srcjar_deps)) { - _srcjar_deps = invoker.srcjar_deps - } - - _srcjars = [] - if (defined(invoker.srcjars)) { - _srcjars = invoker.srcjars + if (defined(invoker.annotation_processor_deps)) { + _accumulated_deps += invoker.annotation_processor_deps } - assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) - - _compile_java_target = "${_template_name}__compile_java" - _final_deps += [ ":$_compile_java_target" ] - compile_java(_compile_java_target) { - forward_variables_from(invoker, - [ - "additional_jar_files", - "alternative_android_sdk_ijar", - "alternative_android_sdk_ijar_dep", - "alternative_android_sdk_jar", - "dist_jar_path", - "enable_errorprone", - "enable_incremental_javac_override", - "jar_excluded_patterns", - "manifest_entries", - "processors_javac", - "processor_args_javac", - "provider_configurations", - "javac_args", - ]) - jar_path = _jar_path - build_config = _build_config - java_files = _java_files - if (_java_files != []) { - java_sources_file = _java_sources_file - } - srcjar_deps = _srcjar_deps - srcjars = _srcjars - chromium_code = _chromium_code - supports_android = _supports_android - requires_android = _requires_android - emma_instrument = _emma_instrument - enable_build_hooks = _enable_build_hooks - enable_build_hooks_android = _enable_build_hooks_android - deps = _accumulated_deps - } - _accumulated_deps += [ ":$_compile_java_target" ] - assert(_accumulated_deps != []) # Mark used. - - if (defined(invoker.main_class)) { - # Targets might use the generated script while building, so make it a dep - # rather than a data_dep. - _final_deps += [ ":${_template_name}__java_binary_script" ] - java_binary_script("${_template_name}__java_binary_script") { + # TODO(agrieve): Enable lint for _has_sources rather than just _java_files. + _has_lint_target = _java_files != [] && _supports_android && _chromium_code + if (_has_sources) { + _compile_java_target = "${_main_target_name}__compile_java" + compile_java(_compile_java_target) { forward_variables_from(invoker, [ - "bootclasspath", - "main_class", - "wrapper_script_args", + "additional_jar_files", + "alternative_android_sdk_ijar", + "alternative_android_sdk_ijar_dep", + "enable_errorprone", + "enable_incremental_javac_override", + "manifest_entries", + "processors_javac", + "processor_args_javac", + "provider_configurations", + "javac_args", ]) build_config = _build_config - jar_path = _jar_path - script_name = _template_name - if (defined(invoker.wrapper_script_name)) { - script_name = invoker.wrapper_script_name + java_files = _java_files + if (_java_files != []) { + java_sources_file = _java_sources_file } + srcjar_deps = _srcjar_deps + chromium_code = _chromium_code + requires_android = _requires_android deps = _accumulated_deps + javac_jar_path = _javac_jar_path } - } + _accumulated_deps += [ ":$_compile_java_target" ] - _has_lint_target = false - if (_supports_android) { - if (_chromium_code) { - _has_lint_target = true - android_lint("${_template_name}__lint") { - if (defined(invoker.lint_suppressions_file)) { - lint_suppressions_file = invoker.lint_suppressions_file + if (_has_lint_target) { + android_lint("${_main_target_name}__lint") { + if (invoker.type == "android_apk") { + forward_variables_from(invoker, [ "android_manifest" ]) + } else if (defined(invoker.android_manifest_for_lint)) { + android_manifest = invoker.android_manifest_for_lint } - - android_manifest = _android_manifest build_config = _build_config - - # Run lint on javac output. - jar_path = "$target_gen_dir/$_compile_java_target.javac.jar" - + jar_path = _javac_jar_path + deps = _accumulated_deps java_files = _java_files if (_java_files != []) { java_sources_file = _java_sources_file } - deps = _accumulated_deps - if (_emma_instrument) { - # Disable the NewApi lint warning when building with coverage - # enabled. Coverage seems to mess with how the linter detects - # the usages of a new API within a conditional. See - # crbug.com/677320 for more. - disable = [ "NewApi" ] + if (defined(invoker.lint_suppressions_file)) { + lint_suppressions_file = invoker.lint_suppressions_file } } # Use an intermediate group() rather as the data_deps target in order to # avoid lint artifacts showing up as runtime_deps (while still having lint # run in parallel to other targets). - group("${_template_name}__analysis") { + group("${_main_target_name}__analysis") { public_deps = [ - ":${_template_name}__lint", + ":${_main_target_name}__lint", ] } } + } # _has_sources - _final_deps += [ ":${_template_name}__dex" ] - dex("${_template_name}__dex") { - sources = [ - _jar_path, - ] - output = _dex_path - deps = [ - ":$_compile_java_target", - ] + if (defined(_final_jar_path)) { + _process_prebuilt_target_name = "${target_name}__process_prebuilt" + process_java_prebuilt(_process_prebuilt_target_name) { + forward_variables_from(invoker, + [ + "alternative_android_sdk_ijar", + "alternative_android_sdk_ijar_dep", + "alternative_android_sdk_jar", + "jar_excluded_patterns", + ]) + supports_android = _supports_android + enable_build_hooks = _enable_build_hooks + enable_build_hooks_android = _enable_build_hooks_android + build_config = _build_config + input_jar_path = _unprocessed_jar_path + emma_instrument = _emma_instrument + if (_emma_instrument) { + java_files = _java_files + java_sources_file = _java_sources_file + } + output_jar_path = _final_jar_path + deps = _accumulated_deps + } + _accumulated_deps += [ ":$_process_prebuilt_target_name" ] + + if (defined(_dex_path)) { + dex("${target_name}__dex") { + sources = [ + _final_jar_path, + ] + output = _dex_path + deps = [ + ":$_process_prebuilt_target_name", + ] + } + _accumulated_deps += [ ":${target_name}__dex" ] } + + _ijar_target_name = "${target_name}__ijar" + generate_interface_jar(_ijar_target_name) { + # Always used the unfiltered .jar to create the interface jar so that + # other targets will resolve filtered classes when depending on + # BuildConfig, NativeLibraries, etc. + input_jar = _unprocessed_jar_path + if (_is_prebuilt) { + forward_variables_from(invoker, [ "deps" ]) + } else { + deps = [ + ":$_compile_java_target", + ] + } + output_jar = _final_ijar_path + } + _accumulated_deps += [ ":$_ijar_target_name" ] + } + + if (_is_java_binary) { + # Targets might use the generated script while building, so make it a dep + # rather than a data_dep. + java_binary_script("${target_name}__java_binary_script") { + forward_variables_from(invoker, + [ + "bootclasspath", + "main_class", + "wrapper_script_args", + ]) + build_config = _build_config + if (defined(_final_jar_path)) { + jar_path = _final_jar_path + } + script_name = _main_target_name + if (defined(invoker.wrapper_script_name)) { + script_name = invoker.wrapper_script_name + } + deps = _accumulated_deps + } + _accumulated_deps += [ ":${target_name}__java_binary_script" ] } group(target_name) { @@ -2873,46 +2618,13 @@ if (enable_java_templates) { "data_deps", "visibility", ]) - if (!defined(data_deps)) { - data_deps = [] - } - public_deps = _final_deps + public_deps = _accumulated_deps if (_has_lint_target) { - data_deps += [ ":${_template_name}__analysis" ] - } - } - } - - # Produces a single .dex.jar out of a set of Java dependencies. - template("deps_dex") { - set_sources_assignment_filter([]) - build_config = "$target_gen_dir/${target_name}.build_config" - build_config_target_name = "${target_name}__build_config" - - write_build_config(build_config_target_name) { - forward_variables_from(invoker, [ "dex_path" ]) - if (defined(invoker.deps)) { - possible_config_deps = invoker.deps - } - type = "deps_dex" - build_config = build_config - } - - rebased_build_config = rebase_path(build_config, root_build_dir) - dex(target_name) { - inputs = [ - build_config, - ] - output = invoker.dex_path - dex_arg_key = "${rebased_build_config}:final_dex:dependency_dex_files" - args = [ "--inputs=@FileArg($dex_arg_key)" ] - if (defined(invoker.excluded_jars)) { - excluded_jars = rebase_path(invoker.excluded_jars, root_build_dir) - args += [ "--excluded-paths=${excluded_jars}" ] + if (!defined(data_deps)) { + data_deps = [] + } + data_deps += [ ":${_main_target_name}__analysis" ] } - deps = [ - ":$build_config_target_name", - ] } } diff --git a/chromium/build/config/android/rules.gni b/chromium/build/config/android/rules.gni index 62d500f771c..0704250c7bc 100644 --- a/chromium/build/config/android/rules.gni +++ b/chromium/build/config/android/rules.gni @@ -13,6 +13,19 @@ import("//build/toolchain/toolchain.gni") assert(is_android) +if (target_cpu == "arm") { + _sanitizer_arch = "arm" +} else if (target_cpu == "arm64") { + _sanitizer_arch = "aarch64" +} else if (target_cpu == "x86") { + _sanitizer_arch = "i686" +} + +_sanitizer_runtimes = [] +if (use_cfi_diag || is_ubsan || is_ubsan_security || is_ubsan_vptr) { + _sanitizer_runtimes = [ "$clang_base_path/lib/clang/$clang_version/lib/linux/libclang_rt.ubsan_standalone-$_sanitizer_arch-android.so" ] +} + # Creates a dist directory for a native executable. # # Running a native executable on a device requires all the shared library @@ -40,35 +53,40 @@ template("create_native_executable_dist") { _libraries_list = "${target_gen_dir}/${target_name}_library_dependencies.list" + _runtime_deps_file = "$target_gen_dir/${target_name}.runtimedeps" + _runtime_deps_target_name = "${target_name}__runtime_deps" + group(_runtime_deps_target_name) { + data = _sanitizer_runtimes + data_deps = [] + if (defined(invoker.deps)) { + data_deps += invoker.deps + } + if (is_component_build || is_asan) { + data_deps += [ "//build/android:cpplib_stripped" ] + } + write_runtime_deps = _runtime_deps_file + } + _find_deps_target_name = "${target_name}__find_library_dependencies" # TODO(agrieve): Extract dependent libs from GN rather than readelf. action(_find_deps_target_name) { - forward_variables_from(invoker, [ "deps" ]) - + deps = invoker.deps + [ ":$_runtime_deps_target_name" ] script = "//build/android/gyp/write_ordered_libraries.py" depfile = "$target_gen_dir/$target_name.d" inputs = [ invoker.binary, + _runtime_deps_file, android_readelf, ] outputs = [ _libraries_list, ] - rebased_binaries = rebase_path([ invoker.binary ], root_build_dir) - _libraries_dir = rebase_path(root_shlib_dir, root_build_dir) - if (is_clang) { - _libraries_dir += - "," + - rebase_path("$clang_base_path/lib/clang/$clang_version/lib/linux", - root_build_dir) - } args = [ "--depfile", rebase_path(depfile, root_build_dir), - "--input-libraries=$rebased_binaries", - "--libraries-dir", - _libraries_dir, + "--runtime-deps", + rebase_path(_runtime_deps_file, root_build_dir), "--output", rebase_path(_libraries_list, root_build_dir), "--readelf", @@ -188,27 +206,24 @@ if (enable_java_templates) { set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - assert(defined(invoker.sources)) - assert(defined(invoker.jni_package)) - jni_package = invoker.jni_package - base_output_dir = "${target_gen_dir}/${target_name}" - package_output_dir = "${base_output_dir}/${jni_package}" - jni_output_dir = "${package_output_dir}/jni" + _base_output_dir = "${target_gen_dir}/${target_name}" + _package_output_dir = "${_base_output_dir}/${invoker.jni_package}" + _jni_output_dir = "${_package_output_dir}/jni" if (defined(invoker.jni_generator_include)) { - jni_generator_include = invoker.jni_generator_include + _jni_generator_include = invoker.jni_generator_include } else { - jni_generator_include = + _jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h" } - foreach_target_name = "${target_name}__jni_gen" - action_foreach(foreach_target_name) { + _foreach_target_name = "${target_name}__jni_gen" + action_foreach(_foreach_target_name) { script = "//base/android/jni_generator/jni_generator.py" depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d" sources = invoker.sources outputs = [ - "${jni_output_dir}/{{source_name_part}}_jni.h", + "${_jni_output_dir}/{{source_name_part}}_jni.h", ] args = [ @@ -217,9 +232,9 @@ if (enable_java_templates) { "--input_file={{source}}", "--ptr_type=long", "--output_dir", - rebase_path(jni_output_dir, root_build_dir), + rebase_path(_jni_output_dir, root_build_dir), "--includes", - rebase_path(jni_generator_include, jni_output_dir), + rebase_path(_jni_generator_include, _jni_output_dir), ] if (enable_profiling) { @@ -229,11 +244,11 @@ if (enable_java_templates) { config("jni_includes_${target_name}") { # TODO(cjhopman): #includes should probably all be relative to - # base_output_dir. Remove that from this config once the includes are + # _base_output_dir. Remove that from this config once the includes are # updated. include_dirs = [ - base_output_dir, - package_output_dir, + _base_output_dir, + _package_output_dir, ] } @@ -247,7 +262,7 @@ if (enable_java_templates) { if (!defined(public_deps)) { public_deps = [] } - public_deps += [ ":$foreach_target_name" ] + public_deps += [ ":$_foreach_target_name" ] public_configs = [ ":jni_includes_${target_name}" ] } } @@ -276,62 +291,55 @@ if (enable_java_templates) { # jni_package = "foo" # } template("generate_jar_jni") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - assert(defined(invoker.classes)) - assert(defined(invoker.jni_package)) - if (defined(invoker.jar_file)) { - jar_file = invoker.jar_file + _jar_file = invoker.jar_file } else { - jar_file = android_sdk_jar + _jar_file = android_sdk_jar } - jni_package = invoker.jni_package - base_output_dir = "${target_gen_dir}/${target_name}/${jni_package}" - jni_output_dir = "${base_output_dir}/jni" + _base_output_dir = "${target_gen_dir}/${target_name}/${invoker.jni_package}" + _jni_output_dir = "${_base_output_dir}/jni" if (defined(invoker.jni_generator_include)) { - jni_generator_include = invoker.jni_generator_include + _jni_generator_include = invoker.jni_generator_include } else { - jni_generator_include = + _jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h" } # TODO(cjhopman): make jni_generator.py support generating jni for multiple # .class files from a .jar. - jni_actions = [] - foreach(class, invoker.classes) { - _classname_list = [] - _classname_list = process_file_template([ class ], "{{source_name_part}}") - classname = _classname_list[0] - jni_target_name = "${target_name}__jni_${classname}" - jni_actions += [ ":$jni_target_name" ] - action(jni_target_name) { + _jni_actions = [] + foreach(_class, invoker.classes) { + _classname = get_path_info(_class, "name") + _jni_target_name = "${target_name}__jni_${_classname}" + _jni_actions += [ ":$_jni_target_name" ] + action(_jni_target_name) { # The sources aren't compiled so don't check their dependencies. check_includes = false depfile = "$target_gen_dir/$target_name.d" script = "//base/android/jni_generator/jni_generator.py" - sources = [ - jar_file, + inputs = [ + _jar_file, ] outputs = [ - "${jni_output_dir}/${classname}_jni.h", + "${_jni_output_dir}/${_classname}_jni.h", ] args = [ "--depfile", rebase_path(depfile, root_build_dir), "--jar_file", - rebase_path(jar_file, root_build_dir), + rebase_path(_jar_file, root_build_dir), "--input_file", - class, + _class, "--ptr_type=long", "--output_dir", - rebase_path(jni_output_dir, root_build_dir), + rebase_path(_jni_output_dir, root_build_dir), "--includes", - rebase_path(jni_generator_include, jni_output_dir), + rebase_path(_jni_generator_include, _jni_output_dir), ] if (enable_profiling) { @@ -341,7 +349,7 @@ if (enable_java_templates) { } config("jni_includes_${target_name}") { - include_dirs = [ base_output_dir ] + include_dirs = [ _base_output_dir ] } group(target_name) { @@ -352,7 +360,7 @@ if (enable_java_templates) { "public_deps", "visibility", ]) - public_deps += jni_actions + public_deps += _jni_actions public_configs = [ ":jni_includes_${target_name}" ] } } @@ -461,34 +469,24 @@ if (enable_java_templates) { _apply_gcc_target_name = "${target_name}__apply_gcc" _base_gen_dir = "${target_gen_dir}/${target_name}/java_cpp_template" - - if (defined(invoker.package_path)) { - package_path = invoker.package_path - } else { - # TODO(jbudorick): Back this out once all clients have been switched to - # package_path. - assert(defined(invoker.package_name)) - package_path = invoker.package_name - } + _package_path = invoker.package_path action_foreach(_apply_gcc_target_name) { forward_variables_from(invoker, [ "deps", + "inputs", "public_deps", "data_deps", ]) script = "//build/android/gyp/gcc_preprocess.py" - if (defined(invoker.inputs)) { - inputs = invoker.inputs + [] - } depfile = "${target_gen_dir}/${invoker.target_name}_{{source_name_part}}.d" sources = invoker.sources outputs = [ - "$_base_gen_dir/${package_path}/{{source_name_part}}.java", + "$_base_gen_dir/${_package_path}/{{source_name_part}}.java", ] args = [ @@ -502,10 +500,10 @@ if (enable_java_templates) { ] if (defined(invoker.defines)) { - foreach(def, invoker.defines) { + foreach(_def, invoker.defines) { args += [ "--defines", - def, + _def, ] } } @@ -546,12 +544,8 @@ if (enable_java_templates) { # ] # } template("java_cpp_enum") { + set_sources_assignment_filter([]) action(target_name) { - # The sources aren't compiled so don't check their dependencies. - check_includes = false - set_sources_assignment_filter([]) - - assert(defined(invoker.sources)) forward_variables_from(invoker, [ "sources", @@ -559,6 +553,8 @@ if (enable_java_templates) { "visibility", ]) + # The sources aren't compiled so don't check their dependencies. + check_includes = false script = "//build/android/gyp/java_cpp_enum.py" depfile = "$target_gen_dir/$target_name.d" @@ -591,12 +587,8 @@ if (enable_java_templates) { # output = "$target_gen_dir/AndroidManifest.xml" # } template("jinja_template") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - assert(defined(invoker.input)) - assert(defined(invoker.output)) - action(target_name) { forward_variables_from(invoker, [ @@ -604,7 +596,7 @@ if (enable_java_templates) { "deps", ]) - sources = [ + inputs = [ invoker.input, ] script = "//build/android/gyp/jinja_template.py" @@ -625,8 +617,7 @@ if (enable_java_templates) { rebase_path(depfile, root_build_dir), ] if (defined(invoker.variables)) { - variables = invoker.variables - args += [ "--variables=${variables}" ] + args += [ "--variables=${invoker.variables}" ] } } } @@ -653,19 +644,13 @@ if (enable_java_templates) { # variables = ["color=red"] # } template("jinja_template_resources") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - assert(defined(invoker.resources)) - assert(defined(invoker.res_dir)) - - _base_path = "$target_gen_dir/$target_name" - # JUnit tests use resource zip files. These must not be put in gen/ # directory or they will not be available to tester bots. _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir) _resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${target_name}.resources.zip" - _build_config = _base_path + ".build_config" + _build_config = "$target_gen_dir/$target_name.build_config" write_build_config("${target_name}__build_config") { build_config = _build_config @@ -678,7 +663,7 @@ if (enable_java_templates) { action("${target_name}__template") { forward_variables_from(invoker, [ "deps" ]) - sources = invoker.resources + inputs = invoker.resources script = "//build/android/gyp/jinja_template.py" depfile = "$target_gen_dir/$target_name.d" @@ -686,9 +671,9 @@ if (enable_java_templates) { _resources_zip, ] - rebased_resources = rebase_path(invoker.resources, root_build_dir) + _rebased_resources = rebase_path(invoker.resources, root_build_dir) args = [ - "--inputs=${rebased_resources}", + "--inputs=${_rebased_resources}", "--inputs-base-dir", rebase_path(invoker.res_dir, root_build_dir), "--outputs-zip", @@ -730,8 +715,8 @@ if (enable_java_templates) { # generated_resource_files: List of all files in |generated_resource_dirs|. # |generated_resource_dirs| must be specified in |generated_resource_files| # is specified. - # android_manifest: AndroidManifest.xml for this target. Defaults to - # //build/android/AndroidManifest.xml. + # android_manifest: AndroidManifest.xml for this target (optional). Will be + # merged into apks that directly or indirectly depend on this target. # android_manifest_dep: Target that generates AndroidManifest (if applicable) # custom_package: java package for generated .java files. # v14_skip: If true, don't run v14 resource generator on this. Defaults to @@ -788,6 +773,7 @@ if (enable_java_templates) { forward_variables_from(invoker, [ "android_manifest", + "android_manifest_dep", "custom_package", ]) @@ -804,11 +790,6 @@ if (enable_java_templates) { if (defined(invoker.deps)) { possible_config_deps = invoker.deps } - if (defined(invoker.android_manifest_dep)) { - deps = [ - invoker.android_manifest_dep, - ] - } } process_resources(target_name) { @@ -847,9 +828,6 @@ if (enable_java_templates) { # compiling ResourceRewriter, there is no side effect because the # generated R.class isn't used in final apk. shared_resources = true - if (!defined(android_manifest)) { - android_manifest = "//build/android/AndroidManifest.xml" - } } } @@ -893,7 +871,6 @@ if (enable_java_templates) { # renaming_destinations = [ "renamed/asset2.png" ] # } template("android_assets") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) _build_config = "$target_gen_dir/$target_name.build_config" @@ -959,6 +936,7 @@ if (enable_java_templates) { write_build_config("${target_name}__build_config") { type = "group" build_config = "$target_gen_dir/${invoker.target_name}.build_config" + supports_android = true if (defined(invoker.deps)) { possible_config_deps = invoker.deps } @@ -987,56 +965,44 @@ if (enable_java_templates) { # grd_file = "foo_strings.grd" # } template("java_strings_grd") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - base_path = "$target_gen_dir/$target_name" - # JUnit tests use resource zip files. These must not be put in gen/ # directory or they will not be available to tester bots. _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir) - resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${target_name}.resources.zip" - build_config = base_path + ".build_config" + _resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${target_name}.resources.zip" + _build_config = "$target_gen_dir/$target_name.build_config" write_build_config("${target_name}__build_config") { type = "android_resources" + build_config = _build_config + resources_zip = _resources_zip } - # Put grit files into this subdirectory of target_gen_dir. - extra_output_path = target_name + "_grit_output" - - grit_target_name = "${target_name}__grit" - grit_output_dir = "$target_gen_dir/$extra_output_path" + _grit_target_name = "${target_name}__grit" + _grit_output_dir = "$target_gen_dir/${target_name}_grit_output" - grit(grit_target_name) { + grit(_grit_target_name) { forward_variables_from(invoker, [ "deps" ]) grit_flags = [ "-E", "ANDROID_JAVA_TAGGED_ONLY=false", ] - output_dir = grit_output_dir + output_dir = _grit_output_dir resource_ids = "" source = invoker.grd_file outputs = invoker.outputs } - # This needs to get outputs from grit's internal target, not the final - # source_set. - generate_strings_outputs = get_target_outputs(":${grit_target_name}_grit") + zip(target_name) { + base_dir = _grit_output_dir - zip("${target_name}__zip") { - base_dir = grit_output_dir - inputs = generate_strings_outputs - output = resources_zip + # This needs to get outputs from grit's internal target, not the final + # source_set. + inputs = get_target_outputs(":${_grit_target_name}_grit") + output = _resources_zip deps = [ - ":$grit_target_name", - ] - } - - group(target_name) { - public_deps = [ - ":${target_name}__build_config", - ":${target_name}__zip", + ":$_grit_target_name", ] } } @@ -1058,91 +1024,95 @@ if (enable_java_templates) { # ] # } template("java_strings_grd_prebuilt") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) - base_path = "$target_gen_dir/$target_name" - # JUnit tests use resource zip files. These must not be put in gen/ # directory or they will not be available to tester bots. _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir) - resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${target_name}.resources.zip" - build_config = base_path + ".build_config" - - build_config_target_name = "${target_name}__build_config" - zip_target_name = "${target_name}__zip" - final_target_name = target_name + _resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${target_name}.resources.zip" + _build_config = "$target_gen_dir/$target_name.build_config" + _build_config_target_name = "${target_name}__build_config" - write_build_config(build_config_target_name) { + write_build_config(_build_config_target_name) { type = "android_resources" + build_config = _build_config + resources_zip = _resources_zip } - zip(zip_target_name) { - visibility = [ ":$final_target_name" ] + zip(target_name) { + forward_variables_from(invoker, [ "visibility" ]) base_dir = invoker.grit_output_dir inputs = rebase_path(invoker.generated_files, ".", base_dir) - output = resources_zip + output = _resources_zip deps = [ - ":$build_config_target_name", + ":$_build_config_target_name", ] if (defined(invoker.deps)) { deps += invoker.deps } } - - group(final_target_name) { - forward_variables_from(invoker, [ "visibility" ]) - public_deps = [ - ":$zip_target_name", - ] - } } # Declare a Java executable target # - # This target creates an executable from java code and libraries. The executable - # will be in the output folder's /bin/ directory. + # Same as java_library, but also creates a wrapper script within + # $root_out_dir/bin. # - # Variables - # deps: Specifies the dependencies of this target. Java targets in this list - # will be included in the executable (and the javac classpath). - # classpath_deps: Deps that should added to the classpath for this target, - # but not linked into the apk (use this for annotation processors). - # java_files: List of .java files included in this library. - # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars - # will be added to java_files and be included in this library. - # srcjars: List of srcjars to be included in this library, together with the - # ones obtained from srcjar_deps. - # bypass_platform_checks: Disables checks about cross-platform (Java/Android) - # dependencies for this target. This will allow depending on an - # android_library target, for example. - # chromium_code: If true, extra analysis warning/errors will be enabled. - # enable_errorprone: If true, enables the errorprone compiler. - # enable_incremental_javac_override: Overrides the - # global enable_incremental_javac. + # Supports all variables of java_library(), plus: # main_class: When specified, a wrapper script is created within # $root_build_dir/bin to launch the binary with the given class as the # entrypoint. + # wrapper_script_name: Filename for the wrapper script (default=target_name) # wrapper_script_args: List of additional arguments for the wrapper script. # - # data_deps, testonly - # # Example # java_binary("foo") { # java_files = [ "org/chromium/foo/FooMain.java" ] # deps = [ ":bar_java" ] # main_class = "org.chromium.foo.FooMain" # } + # + # java_binary("foo") { + # jar_path = "lib/prebuilt.jar" + # deps = [ ":bar_java" ] + # main_class = "org.chromium.foo.FooMain" + # } template("java_binary") { - set_sources_assignment_filter([]) + java_library_impl(target_name) { + forward_variables_from(invoker, "*") + type = "java_binary" + } + } + # Declare a Java Annotation Processor. + # + # Supports all variables of java_library(), plus: + # jar_path: Path to a prebuilt jar. Mutually exclusive with java_files & + # srcjar_deps. + # main_class: The fully-quallified class name of the processor's entry + # point. + # + # Example + # java_annotation_processor("foo_processor") { + # java_files = [ "org/chromium/foo/FooProcessor.java" ] + # deps = [ ":bar_java" ] + # main_class = "org.chromium.foo.FooProcessor" + # } + # + # java_annotation_processor("foo_processor") { + # jar_path = "lib/prebuilt.jar" + # main_class = "org.chromium.foo.FooMain" + # } + # + # java_library("...") { + # annotation_processor_deps = [":foo_processor"] + # } + # + template("java_annotation_processor") { java_library_impl(target_name) { forward_variables_from(invoker, "*") - supports_android = false - main_class = invoker.main_class - is_java_binary = true - assert(is_java_binary) # Mark as used. + type = "java_annotation_processor" } } @@ -1151,17 +1121,7 @@ if (enable_java_templates) { # This target creates an executable from java code for running as a junit test # suite. The executable will be in the output folder's /bin/ directory. # - # Variables - # deps: Specifies the dependencies of this target. Java targets in this list - # will be included in the executable (and the javac classpath). - # - # java_files: List of .java files included in this library. - # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars - # will be added to java_files and be included in this library. - # srcjars: List of srcjars to be included in this library, together with the - # ones obtained from srcjar_deps. - # - # chromium_code: If true, extra analysis warning/errors will be enabled. + # Supports all variables of java_binary(). # # Example # junit_binary("foo") { @@ -1169,7 +1129,6 @@ if (enable_java_templates) { # deps = [ ":bar_java" ] # } template("junit_binary") { - set_sources_assignment_filter([]) testonly = true _java_binary_target_name = "${target_name}__java_binary" @@ -1191,29 +1150,6 @@ if (enable_java_templates) { if (defined(invoker.deps)) { _deps += invoker.deps } - if (defined(invoker.java_files)) { - _java_sources_file = "$target_gen_dir/$target_name.sources" - } - write_build_config(_build_config_target_name) { - forward_variables_from(invoker, [ "classpath_deps" ]) - type = "junit_binary" - build_config = _build_config - main_class = _main_class - - # Robolectric can handle deps that set !supports_android as well those - # that set requires_android. - bypass_platform_checks = true - possible_config_deps = _deps - if (defined(_java_sources_file)) { - java_sources_file = _java_sources_file - } - _target_dir_name = get_label_info(":$target_name", "dir") - jar_path = "$root_out_dir/lib.java$_target_dir_name/$target_name.jar" - } - - if (defined(invoker.classpath_deps)) { - _deps += invoker.classpath_deps - } _process_resources_target = "${target_name}__process_resources" process_resources(_process_resources_target) { @@ -1230,6 +1166,24 @@ if (enable_java_templates) { } } + java_library_impl(_java_binary_target_name) { + forward_variables_from(invoker, "*", [ "deps" ]) + type = "junit_binary" + main_target_name = invoker.target_name + + # Robolectric can handle deps that set !supports_android as well those + # that set requires_android. + bypass_platform_checks = true + deps = _deps + testonly = true + main_class = _main_class + wrapper_script_name = "helper/$main_target_name" + if (!defined(srcjar_deps)) { + srcjar_deps = [] + } + srcjar_deps += [ ":$_process_resources_target" ] + } + test_runner_script(_test_runner_target_name) { test_name = invoker.target_name test_suite = invoker.target_name @@ -1242,22 +1196,6 @@ if (enable_java_templates) { ]) } - java_binary(_java_binary_target_name) { - forward_variables_from(invoker, "*", [ "deps" ]) - output_name = invoker.target_name - deps = _deps + [ ":$_build_config_target_name" ] - testonly = true - override_build_config = _build_config - if (defined(_java_sources_file)) { - java_sources_file = _java_sources_file - } - main_class = _main_class - wrapper_script_name = "helper/$target_name" - if (!defined(srcjar_deps)) { - srcjar_deps = [] - } - srcjar_deps += [ ":$_process_resources_target" ] - } group(target_name) { public_deps = [ ":$_build_config_target_name", @@ -1272,18 +1210,20 @@ if (enable_java_templates) { # Variables # deps: Specifies the dependencies of this target. Java targets in this list # will be added to the javac classpath. - # classpath_deps: Deps that should added to the classpath for this target, - # but not linked into the apk (use this for annotation processors). + # annotation_processor_deps: List of java_annotation_processor targets to + # use when compiling. # + # jar_path: Path to a prebuilt jar. Mutually exclusive with java_files & + # srcjar_deps. # java_files: List of .java files included in this library. # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars # will be added to java_files and be included in this library. - # srcjars: List of srcjars to be included in this library, together with the - # ones obtained from srcjar_deps. # # input_jars_paths: A list of paths to the jars that should be included - # in the classpath. These are in addition to library .jars that - # appear in deps. + # in the compile-time classpath. These are in addition to library .jars + # that appear in deps. + # classpath_deps: Deps that should added to the classpath for this target, + # but not linked into the apk (use this for annotation processors). # # chromium_code: If true, extra analysis warning/errors will be enabled. # enable_errorprone: If true, enables the errorprone compiler. @@ -1306,13 +1246,12 @@ if (enable_java_templates) { # dependencies for this target. This will allow depending on an # android_library target, for example. # - # additional_jar_files: Use to package additional files into the output jar. - # Pass a list of length-2 lists with format - # [ [ path_to_file, path_to_put_in_jar ] ] + # additional_jar_files: Use to package additional files (Java resources) + # into the output jar. Pass a list of length-2 lists with format: + # [ [ path_to_file, path_to_put_in_jar ] ] # # javac_args: Additional arguments to pass to javac. # - # # data_deps, testonly # # Example @@ -1333,29 +1272,15 @@ if (enable_java_templates) { # ] # } template("java_library") { - set_sources_assignment_filter([]) java_library_impl(target_name) { forward_variables_from(invoker, "*") + type = "java_library" } } # Declare a java library target for a prebuilt jar # - # Variables - # deps: Specifies the dependencies of this target. Java targets in this list - # will be added to the javac classpath. - # jar_path: Path to the prebuilt jar. - # jar_dep: Target that builds jar_path (optional). - # main_class: When specified, a wrapper script is created within - # $root_build_dir/bin to launch the binary with the given class as the - # entrypoint. - # output_name: File name for the output .jar (not including extension). - # Defaults to the input .jar file name. - # proguard_configs: List of proguard configs to use in final apk step for - # any apk that depends on this library. - # supports_android: If true, Android targets (android_library, android_apk) - # may depend on this target. Note: if true, this target must only use the - # subset of Java available on Android. + # Supports all variables of java_library(). # # Example # java_prebuilt("foo_java") { @@ -1366,9 +1291,9 @@ if (enable_java_templates) { # ] # } template("java_prebuilt") { - set_sources_assignment_filter([]) - java_prebuilt_impl(target_name) { + java_library_impl(target_name) { forward_variables_from(invoker, "*") + type = "java_library" } } @@ -1381,8 +1306,8 @@ if (enable_java_templates) { # "apk". # use_interface_jars: Use all dependent interface .jars rather than # implementation .jars. + # use_unprocessed_jars: Use unprocessed / undesugared .jars. # direct_deps_only: Do not recurse on deps. - # data, deps, testonly, visibility: Usual meaning. # proguard_enabled: Whether to run ProGuard on resulting jar. # proguard_configs: List of proguard configs. # proguard_jar_path: The path to proguard.jar you wish to use. If undefined, @@ -1394,6 +1319,11 @@ if (enable_java_templates) { # deps = [ ":my_java_lib" ] # output = "$root_build_dir/MyLibrary.jar" # } + # dist_jar("sideloaded_dex") { + # deps = [ ":my_java_lib" ] + # output = "$root_build_dir/MyLibrary.jar" + # dex_path = "$root_build_dir/MyLibrary.dex" + # } template("dist_jar") { forward_variables_from(invoker, [ "testonly" ]) _supports_android = @@ -1404,14 +1334,16 @@ if (enable_java_templates) { defined(invoker.proguard_enabled) && invoker.proguard_enabled _use_interface_jars = defined(invoker.use_interface_jars) && invoker.use_interface_jars + _use_unprocessed_jars = + defined(invoker.use_unprocessed_jars) && invoker.use_unprocessed_jars _direct_deps_only = defined(invoker.direct_deps_only) && invoker.direct_deps_only - assert( - !(_proguard_enabled && _use_interface_jars), - "Cannot set both proguard_enabled and use_interface_jars (target=$target_name)") - assert( - !(_proguard_enabled && _direct_deps_only), - "Cannot set both proguard_enabled and direct_deps_only (target=$target_name)") + assert(!(_proguard_enabled && _use_interface_jars), + "Cannot set both proguard_enabled and use_interface_jars") + assert(!(_proguard_enabled && _direct_deps_only), + "Cannot set both proguard_enabled and direct_deps_only") + assert(!(_use_unprocessed_jars && _use_interface_jars), + "Cannot set both use_interface_jars and use_unprocessed_jars") _jar_target_name = target_name if (defined(invoker.dex_path)) { @@ -1443,8 +1375,8 @@ if (enable_java_templates) { type = "dist_jar" forward_variables_from(invoker, [ - "dex_path", "proguard_enabled", + "proguard_configs", ]) supports_android = _supports_android requires_android = _requires_android @@ -1459,7 +1391,6 @@ if (enable_java_templates) { } _rebased_build_config = rebase_path(_build_config, root_build_dir) - if (_proguard_enabled) { proguard(_jar_target_name) { forward_variables_from(invoker, @@ -1475,19 +1406,16 @@ if (enable_java_templates) { output_jar_path = invoker.output args = [ - "--proguard-configs=@FileArg($_rebased_build_config:proguard:lib_configs)", - "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", - "--classpath=@FileArg($_rebased_build_config:proguard:lib_paths)", + "--proguard-configs=@FileArg($_rebased_build_config:proguard:all_configs)", + "--input-paths=@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)", + "--classpath=@FileArg($_rebased_build_config:proguard:extra_jars)", ] - if (defined(invoker.proguard_configs)) { - _rebased_proguard_configs = - rebase_path(invoker.proguard_configs, root_build_dir) - args += [ "--proguard-configs=$_rebased_proguard_configs" ] - } if (defined(invoker.proguard_config_exclusions)) { _rebased_proguard_config_exclusions = rebase_path(invoker.proguard_config_exclusions, root_build_dir) - args += [ "--proguard-config-exclusions=$_rebased_proguard_config_exclusions" ] + args += [ + "--proguard-config-exclusions=$_rebased_proguard_config_exclusions", + ] } } } else { @@ -1514,16 +1442,22 @@ if (enable_java_templates) { if (_direct_deps_only) { if (_use_interface_jars) { - args += [ "--inputs=@FileArg($_rebased_build_config:javac:interface_classpath)" ] - } else { + args += [ "--jars=@FileArg($_rebased_build_config:javac:interface_classpath)" ] + } else if (_use_unprocessed_jars) { args += - [ "--inputs=@FileArg($_rebased_build_config:javac:classpath)" ] + [ "--jars=@FileArg($_rebased_build_config:javac:classpath)" ] + } else { + assert( + false, + "direct_deps_only does not work without use_interface_jars or use_unprocessed_jars") } } else { if (_use_interface_jars) { - args += [ "--inputs=@FileArg($_rebased_build_config:dist_jar:all_interface_jars)" ] + args += [ "--jars=@FileArg($_rebased_build_config:dist_jar:all_interface_jars)" ] + } else if (_use_unprocessed_jars) { + args += [ "--jars=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)" ] } else { - args += [ "--inputs=@FileArg($_rebased_build_config:dist_jar:dependency_jars)" ] + args += [ "--jars=@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)" ] } } } @@ -1541,57 +1475,110 @@ if (enable_java_templates) { } } + # Creates an Android .aar library. + # + # Currently supports: + # * AndroidManifest.xml + # * classes.jar + # * res/ + # * R.txt + # * proguard.txt + # Does not yet support: + # * public.txt + # * annotations.zip + # * assets/ + # * jni/ + # See: https://developer.android.com/studio/projects/android-library.html#aar-contents + # + # Variables: + # output: Path to the output .aar. + # proguard_configs: List of proguard configs (optional). + # android_manifest: Path to AndroidManifest.xml (optional). + # + # Example + # dist_aar("my_aar") { + # deps = [ ":my_java_lib" ] + # output = "$root_build_dir/MyLibrary.aar" + # } + template("dist_aar") { + forward_variables_from(invoker, [ "testonly" ]) + + _deps = [] + if (defined(invoker.deps)) { + _deps = invoker.deps + } + + _build_config = "$target_gen_dir/$target_name.build_config" + _build_config_target_name = "${target_name}__build_config" + + write_build_config(_build_config_target_name) { + type = "dist_aar" + forward_variables_from(invoker, [ "proguard_configs" ]) + possible_config_deps = _deps + supports_android = true + requires_android = true + build_config = _build_config + } + + _deps += [ ":$_build_config_target_name" ] + + _rebased_build_config = rebase_path(_build_config, root_build_dir) + + action(target_name) { + forward_variables_from(invoker, [ "data" ]) + depfile = "$target_gen_dir/$target_name.d" + deps = _deps + script = "//build/android/gyp/dist_aar.py" + + inputs = [ + _build_config, + ] + + outputs = [ + invoker.output, + ] + + args = [ + "--depfile", + rebase_path(depfile, root_build_dir), + "--output", + rebase_path(invoker.output, root_build_dir), + "--jars=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)", + "--dependencies-res-zips=@FileArg($_rebased_build_config:resources:dependency_zips)", + "--r-text-files=@FileArg($_rebased_build_config:resources:extra_r_text_files)", + "--proguard-configs=@FileArg($_rebased_build_config:proguard:all_configs)", + ] + if (defined(invoker.android_manifest)) { + args += [ + "--android-manifest", + rebase_path(invoker.android_manifest, root_build_dir), + ] + } + } + } + # Declare an Android library target # # This target creates an Android library containing java code and Android # resources. # - # Variables - # deps: Specifies the dependencies of this target. Java targets in this list - # will be added to the javac classpath. Android resources in dependencies - # will be used when building this library. - # classpath_deps: Deps that should added to the classpath for this target, - # but not linked into the apk (use this for annotation processors). - # - # java_files: List of .java files included in this library. - # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars - # will be added to java_files and be included in this library. - # srcjars: List of srcjars to be included in this library, together with the - # ones obtained from srcjar_deps. - # - # input_jars_paths: A list of paths to the jars that should be included - # in the classpath. These are in addition to library .jars that - # appear in deps. - # - # chromium_code: If true, extra analysis warning/errors will be enabled. - # enable_errorprone: If true, enables the errorprone compiler. - # enable_incremental_javac_override: Overrides the global - # enable_incremental_javac. - # - # jar_excluded_patterns: List of patterns of .class files to exclude from the - # final jar. - # - # proguard_configs: List of proguard configs to use in final apk step for - # any apk that depends on this library. - # - # output_name: File name for the output .jar (not including extension). - # Defaults to the input .jar file name. + # Supports all variables of java_library(), plus: + # android_manifest_for_lint: Path to AndroidManifest.xml (optional). This + # manifest will be used by Android lint, but will not be merged into apks. + # To have a manifest merged, add it to an android_resources() target. + # deps: In addition to defining java deps, this can also include + # android_assets() and android_resources() targets. # dex_path: If set, the resulting .dex.jar file will be placed under this # path. - # # alternative_android_sdk_ijar: if set, the given android_sdk_ijar file # replaces the default android_sdk_ijar. - # # alternative_android_sdk_ijar_dep: the target that generates # alternative_android_sdk_ijar, must be set if alternative_android_sdk_ijar # is used. - # # alternative_android_sdk_jar: actual jar corresponding to # alternative_android_sdk_ijar, must be set if alternative_android_sdk_ijar # is used. # - # emma_never_instrument: Disables EMMA Java code coverage for this target. - # # Example # android_library("foo_java") { # java_files = [ @@ -1610,18 +1597,14 @@ if (enable_java_templates) { # ] # } template("android_library") { - set_sources_assignment_filter([]) - assert(!defined(invoker.jar_path), - "android_library does not support a custom jar path") - - if (defined(invoker.alternative_android_sdk_ijar)) { - assert(defined(invoker.alternative_android_sdk_ijar_dep)) - assert(defined(invoker.alternative_android_sdk_jar)) - } - - java_library_impl(target_name) { + java_library(target_name) { forward_variables_from(invoker, "*") + if (defined(alternative_android_sdk_ijar)) { + assert(defined(alternative_android_sdk_ijar_dep)) + assert(defined(alternative_android_sdk_jar)) + } + supports_android = true requires_android = true @@ -1637,39 +1620,12 @@ if (enable_java_templates) { } } - # Declare a target that packages a set of Java dependencies into a standalone - # .dex.jar. - # - # Variables - # deps: specifies the dependencies of this target. Android libraries in deps - # will be packaged into the resulting .dex.jar file. - # dex_path: location at which the output file will be put - template("android_standalone_library") { - set_sources_assignment_filter([]) - deps_dex(target_name) { - forward_variables_from(invoker, - [ - "deps", - "dex_path", - "excluded_jars", - ]) - } - } - # Declare an Android library target for a prebuilt jar # # This target creates an Android library containing java code and Android # resources. # - # Variables - # deps: Specifies the dependencies of this target. Java targets in this list - # will be added to the javac classpath. Android resources in dependencies - # will be used when building this library. - # jar_path: Path to the prebuilt jar. - # output_name: File name for the output .jar (not including extension). - # Defaults to the input .jar file name. - # proguard_configs: List of proguard configs to use in final apk step for - # any apk that depends on this library. + # Supports all variables of android_library(). # # Example # android_java_prebuilt("foo_java") { @@ -1680,12 +1636,8 @@ if (enable_java_templates) { # ] # } template("android_java_prebuilt") { - set_sources_assignment_filter([]) - java_prebuilt_impl(target_name) { + android_library(target_name) { forward_variables_from(invoker, "*") - supports_android = true - requires_android = true - strip_resource_classes = true } } @@ -1694,30 +1646,13 @@ if (enable_java_templates) { # This target creates an Android APK containing java code, resources, assets, # and (possibly) native libraries. # - # Variables - # alternative_android_sdk_jar: The alternative android sdk jar used in - # proguard. + # Supports all variables of android_library(), plus: # android_manifest: Path to AndroidManifest.xml. # android_manifest_dep: Target that generates AndroidManifest (if applicable) - # chromium_code: If true, extra analysis warning/errors will be enabled. # png_to_webp: If true, pngs (with the exception of 9-patch) are # converted to webp during resource packaging. # dist_ijar_path: Path to create "${target_name}_dist_ijar" target # (used by instrumentation_test_apk). - # data_deps: List of dependencies needed at runtime. These will be built but - # won't change the generated .apk in any way (in fact they may be built - # after the .apk is). - # deps: List of dependencies. All Android java resources and libraries in the - # "transitive closure" of these dependencies will be included in the apk. - # Note: this "transitive closure" actually only includes such targets if - # they are depended on through android_library or android_resources targets - # (and so not through builtin targets like 'action', 'group', etc). - # classpath_deps: Deps that should added to the classpath for this target, - # but not linked into the apk. - # install_script_name: Name of wrapper script (default=target_name). - # java_files: List of .java files to include in the apk. - # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars - # will be added to java_files and be included in this apk. # apk_name: Name for final apk. # final_apk_path: Path to final built apk. Default is # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. @@ -1740,9 +1675,6 @@ if (enable_java_templates) { # (optional). # apk_under_test: For an instrumentation test apk, this is the target of the # tested apk. - # include_all_resources - If true include all resource IDs in all generated - # R.java files. - # testonly: Marks this target as "test-only". # write_asset_list: Adds an extra file to the assets, which contains a list of # all other asset files. # generate_buildconfig_java: If defined and false, skip generating the @@ -1762,7 +1694,6 @@ if (enable_java_templates) { # (mipmaps are still included). # xxxhdpi_whitelist: A list of globs used when exclude_xxxhdpi=true. Files # that match this whitelist will still be included. - # javac_args: Additional arguments to pass to javac. # # Example # android_apk("foo_apk") { @@ -1783,7 +1714,6 @@ if (enable_java_templates) { # ] # } template("android_apk") { - set_sources_assignment_filter([]) forward_variables_from(invoker, [ "testonly" ]) assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) @@ -1791,17 +1721,14 @@ if (enable_java_templates) { _gen_dir = "$target_gen_dir/$target_name" _base_path = "$_gen_dir/$target_name" _build_config = "$target_gen_dir/$target_name.build_config" + _build_config_target = "${target_name}__build_config" # JUnit tests use resource zip files. These must not be put in gen/ # directory or they will not be available to tester bots. - _all_resources_zip_path = "$_base_path.resources.all.zip" _jar_path = "$_base_path.jar" _lib_dex_path = "$_base_path.dex.jar" _rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir) _template_name = target_name - if (defined(invoker.java_files)) { - _java_sources_file = "$_base_path.sources" - } _enable_multidex = defined(invoker.enable_multidex) && invoker.enable_multidex @@ -1864,9 +1791,6 @@ if (enable_java_templates) { } sources = [] } - if (emma_coverage && !_emma_never_instrument) { - _deps += [ "//third_party/android_tools:emma_device_java" ] - } _srcjar_deps = [] if (defined(invoker.srcjar_deps)) { @@ -1929,7 +1853,9 @@ if (enable_java_templates) { _native_libs_deps += [ "//build/android:cpplib_stripped" ] } if (_secondary_abi_shared_libraries_is_valid) { - _secondary_abi_native_libs_deps += [ "//build/android:cpplib_stripped($android_secondary_abi_toolchain)" ] + _secondary_abi_native_libs_deps += [ + "//build/android:cpplib_stripped($android_secondary_abi_toolchain)", + ] } } @@ -2018,61 +1944,13 @@ if (enable_java_templates) { _proguard_output_jar_path = "$_base_path.proguard.jar" } - _emma_never_instrument = defined(invoker.testonly) && invoker.testonly _incremental_allowed = !(defined(invoker.never_incremental) && invoker.never_incremental) - _build_config_target = "${_template_name}__build_config" - write_build_config(_build_config_target) { - forward_variables_from(invoker, - [ - "apk_under_test", - "classpath_deps", - ]) - type = "android_apk" - jar_path = _jar_path - dex_path = _final_dex_path - apk_path = _final_apk_path - incremental_allowed = _incremental_allowed - incremental_apk_path = "${_final_apk_path_no_ext}_incremental.apk" - incremental_install_json_path = _incremental_install_json_path - build_config = _build_config - android_manifest = _android_root_manifest - - if (defined(_java_sources_file)) { - java_sources_file = _java_sources_file - } - - deps = _android_root_manifest_deps - possible_config_deps = _deps - - proguard_enabled = _proguard_enabled - if (_proguard_enabled) { - proguard_info = "$_proguard_output_jar_path.info" - } - non_native_packed_relocations = _pack_relocations - - # Don't depend on the runtime_deps target in order to avoid having to - # build the native libraries just to create the .build_config file. - # The dep is unnecessary since the runtime_deps file is created by gn gen - # and the runtime_deps file is added to write_build_config.py's depfile. - if (_native_libs_deps != []) { - shared_libraries_runtime_deps_file = _runtime_deps_file - } - if (_secondary_abi_native_libs_deps != []) { - secondary_abi_shared_libraries_runtime_deps_file = - _secondary_abi_runtime_deps_file - } - } - - if (defined(invoker.classpath_deps)) { - _deps += invoker.classpath_deps - } - _android_manifest = "$target_gen_dir/${_template_name}_manifest/AndroidManifest.xml" - _android_manifest_target = "${_template_name}__merge_manifests" - action(_android_manifest_target) { + _merge_manifest_target = "${_template_name}__merge_manifests" + action(_merge_manifest_target) { script = "//build/android/gyp/merge_manifest.py" depfile = "$target_gen_dir/$target_name.d" @@ -2113,55 +1991,53 @@ if (enable_java_templates) { [ "alternative_android_sdk_jar", "app_as_shared_lib", - "include_all_resources", "shared_resources", "support_zh_hk", - ]) - srcjar_path = "${target_gen_dir}/${target_name}.srcjar" - r_text_out_path = "${target_gen_dir}/${target_name}_R.txt" - android_manifest = _android_manifest - all_resources_zip_path = _all_resources_zip_path - generate_constant_ids = true - proguard_file = _generated_proguard_config - if (_enable_multidex) { - proguard_file_main_dex = _generated_proguard_main_dex_config - } - - build_config = _build_config - deps = _deps + [ - ":$_android_manifest_target", - ":$_build_config_target", - ] - } - _srcjar_deps += [ ":$_process_resources_target" ] - _package_resources_target = "${target_name}__package_resources" - package_resources(_package_resources_target) { - forward_variables_from(invoker, - [ "aapt_locale_whitelist", - "alternative_android_sdk_jar", - "app_as_shared_lib", "exclude_xxxhdpi", "png_to_webp", - "shared_resources", - "support_zh_hk", "xxxhdpi_whitelist", + "no_xml_namespaces", ]) - deps = _deps + [ - ":$_android_manifest_target", - ":$_process_resources_target", - ] android_manifest = _android_manifest version_code = _version_code version_name = _version_name if (defined(invoker.post_process_package_resources_script)) { post_process_script = invoker.post_process_package_resources_script + post_process_deps = invoker.post_process_package_resources_deps + post_process_args = invoker.post_process_package_resources_args + } + srcjar_path = "${target_gen_dir}/${target_name}.srcjar" + r_text_out_path = "${target_gen_dir}/${target_name}_R.txt" + generate_constant_ids = true + proguard_file = _generated_proguard_config + if (_enable_multidex) { + proguard_file_main_dex = _generated_proguard_main_dex_config } - resources_zip = _all_resources_zip_path output = _packaged_resources_path density_splits = _density_splits language_splits = _language_splits + + build_config = _build_config + deps = _deps + [ + ":$_merge_manifest_target", + ":$_build_config_target", + ] + if (defined(invoker.shared_resources_whitelist_target)) { + _whitelist_gen_dir = + get_label_info(invoker.shared_resources_whitelist_target, + "target_gen_dir") + _whitelist_target_name = + get_label_info(invoker.shared_resources_whitelist_target, "name") + shared_resources_whitelist = + "${_whitelist_gen_dir}/${_whitelist_target_name}" + + "__process_resources_R.txt" + deps += [ + "${invoker.shared_resources_whitelist_target}__process_resources", + ] + } } + _srcjar_deps += [ ":$_process_resources_target" ] if (_native_libs_deps != []) { _enable_chromium_linker_tests = false @@ -2178,7 +2054,13 @@ if (enable_java_templates) { # not need this manual sorting step. action(_ordered_libraries_target) { script = "//build/android/gyp/write_ordered_libraries.py" - deps = _native_libs_deps + [ ":$_build_config_target" ] + deps = [ + ":$_build_config_target", + ":${_template_name}__runtime_deps", + ] + inputs = [ + _runtime_deps_file, + ] outputs = [ _ordered_libraries_json, ] @@ -2186,8 +2068,7 @@ if (enable_java_templates) { args = [ "--readelf=$_rebased_android_readelf", "--output=$_rebased_ordered_libraries_json", - "--libraries-dir=.", - "--input-libraries=@FileArg($_rebased_build_config:native:libraries)", + "--runtime-deps=" + rebase_path(_runtime_deps_file, root_build_dir), ] } @@ -2211,6 +2092,15 @@ if (enable_java_templates) { "@FileArg($_rebased_ordered_libraries_json:java_libraries_list)", "NATIVE_LIBRARIES_VERSION_NUMBER=$_native_lib_version_arg", ] + if (current_cpu == "arm" || current_cpu == "arm64") { + defines += [ "ANDROID_APP_CPU_FAMILY_ARM" ] + } else if (current_cpu == "x86" || current_cpu == "x64") { + defines += [ "ANDROID_APP_CPU_FAMILY_X86" ] + } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { + defines += [ "ANDROID_APP_CPU_FAMILY_MIPS" ] + } else { + assert(false, "Unsupported CPU family") + } if (_use_chromium_linker) { defines += [ "ENABLE_CHROMIUM_LINKER" ] } @@ -2241,6 +2131,9 @@ if (enable_java_templates) { if (is_java_debug || dcheck_always_on) { defines += [ "_DCHECK_IS_ON" ] } + if (use_cfi_diag || is_ubsan || is_ubsan_security || is_ubsan_vptr) { + defines += [ "_IS_UBSAN" ] + } defines += [ "COMPRESSED_LOCALE_LIST=" + "@FileArg($_rebased_build_config:compressed_locales_java_list)", @@ -2255,30 +2148,57 @@ if (enable_java_templates) { java_library_impl(_java_target) { forward_variables_from(invoker, [ + "android_manifest", + "android_manifest_dep", + "apk_under_test", "chromium_code", + "classpath_deps", + "emma_never_instrument", "java_files", "no_build_hooks", "javac_args", ]) + type = "android_apk" + main_target_name = _template_name supports_android = true requires_android = true - override_build_config = _build_config - deps = _deps + [ - ":$_android_manifest_target", - ":$_build_config_target", - ] + deps = _deps - android_manifest = _android_manifest srcjar_deps = _srcjar_deps - jar_path = _jar_path + final_jar_path = _jar_path dex_path = _lib_dex_path - emma_never_instrument = _emma_never_instrument - if (defined(_java_sources_file)) { - java_sources_file = _java_sources_file - } + apk_path = _final_apk_path if (defined(invoker.apk_under_test)) { - deps += [ "${invoker.apk_under_test}__java" ] + deps += [ "${invoker.apk_under_test}" ] + } + incremental_allowed = _incremental_allowed + incremental_apk_path = "${_final_apk_path_no_ext}_incremental.apk" + incremental_install_json_path = _incremental_install_json_path + + proguard_enabled = _proguard_enabled + if (_proguard_enabled) { + proguard_info = "$_proguard_output_jar_path.info" + proguard_configs = [ _generated_proguard_config ] + if (defined(invoker.proguard_configs)) { + proguard_configs += invoker.proguard_configs + } + if (_enable_multidex) { + proguard_configs += [ "//build/android/multidex.flags" ] + } + } + non_native_packed_relocations = _pack_relocations + + # Don't depend on the runtime_deps target in order to avoid having to + # build the native libraries just to create the .build_config file. + # The dep is unnecessary since the runtime_deps file is created by gn gen + # and the runtime_deps file is added to write_build_config.py's depfile. + if (_native_libs_deps != []) { + shared_libraries_runtime_deps_file = _runtime_deps_file + } + if (_secondary_abi_native_libs_deps != []) { + secondary_abi_shared_libraries_runtime_deps_file = + _secondary_abi_runtime_deps_file } } @@ -2302,14 +2222,6 @@ if (enable_java_templates) { } if (_proguard_enabled) { - _proguard_configs = [ _generated_proguard_config ] - if (defined(invoker.proguard_configs)) { - _proguard_configs += invoker.proguard_configs - } - if (_enable_multidex) { - _proguard_configs += [ "//build/android/multidex.flags" ] - } - assert(_proguard_configs != []) # Mark as used. _proguard_target = "${_template_name}__proguard" proguard(_proguard_target) { forward_variables_from(invoker, @@ -2323,23 +2235,22 @@ if (enable_java_templates) { ":$_java_target", ] inputs = [ - _build_config, - _jar_path, - ] + _proguard_configs + _build_config, + _jar_path, + ] output_jar_path = _proguard_output_jar_path - _rebased_proguard_configs = - rebase_path(_proguard_configs, root_build_dir) args = [ - "--proguard-configs=$_rebased_proguard_configs", - "--proguard-configs=@FileArg($_rebased_build_config:proguard:lib_configs)", - "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", - "--classpath=@FileArg($_rebased_build_config:proguard:lib_paths)", + "--proguard-configs=@FileArg($_rebased_build_config:proguard:all_configs)", + "--input-paths=@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)", + "--classpath=@FileArg($_rebased_build_config:proguard:extra_jars)", ] if (defined(invoker.proguard_config_exclusions)) { _rebased_proguard_config_exclusions = rebase_path(invoker.proguard_config_exclusions, root_build_dir) - args += [ "--proguard-config-exclusions=$_rebased_proguard_config_exclusions" ] + args += [ + "--proguard-config-exclusions=$_rebased_proguard_config_exclusions", + ] } if (defined(invoker.apk_under_test)) { @@ -2372,7 +2283,8 @@ if (enable_java_templates) { } } else { if (_enable_multidex) { - _dex_sources = [ _jar_path ] + # .jar already included in java_runtime_classpath. + _dex_sources = [] } else { _dex_sources = [ _lib_dex_path ] } @@ -2391,7 +2303,8 @@ if (enable_java_templates) { # All deps are already included in _dex_sources when proguard is used. if (!_proguard_enabled) { if (_enable_multidex) { - _dex_arg_key = "${_rebased_build_config}:dist_jar:dependency_jars" + _dex_arg_key = + "${_rebased_build_config}:deps_info:java_runtime_classpath" extra_main_dex_proguard_config = _generated_proguard_main_dex_config deps += [ ":$_process_resources_target" ] } else { @@ -2456,13 +2369,13 @@ if (enable_java_templates) { } } - _extra_native_libs = [] + _extra_native_libs = _sanitizer_runtimes _extra_native_libs_deps = [] assert(_extra_native_libs_deps == []) # Mark as used. _extra_native_libs_even_when_incremental = [] if (_native_libs_deps != []) { if (_use_chromium_linker) { - _extra_native_libs = + _extra_native_libs += [ "$root_shlib_dir/libchromium_android_linker$shlib_extension" ] _extra_native_libs_deps += [ "//base/android/linker:chromium_android_linker" ] @@ -2480,10 +2393,6 @@ if (enable_java_templates) { } } - if (use_cfi_diag || is_ubsan || is_ubsan_security || is_ubsan_vptr) { - _extra_native_libs += [ "$clang_base_path/lib/clang/$clang_version/lib/linux/libclang_rt.ubsan_standalone-arm-android.so" ] - } - if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { _extra_native_libs_even_when_incremental += invoker.loadable_modules } @@ -2518,17 +2427,17 @@ if (enable_java_templates) { # Incremental apk does not use native libs nor final dex. incremental_deps = _deps + [ - ":$_android_manifest_target", + ":$_merge_manifest_target", ":$_build_config_target", - ":$_package_resources_target", + ":$_process_resources_target", ] # This target generates the input file _all_resources_zip_path. deps = _deps + [ - ":$_android_manifest_target", + ":$_merge_manifest_target", ":$_build_config_target", ":$_final_dex_target_name", - ":$_package_resources_target", + ":$_process_resources_target", ] if ((_native_libs_deps != [] || @@ -2566,11 +2475,11 @@ if (enable_java_templates) { out_manifest = _split_manifest_path split_name = "abi_${android_app_abi}" deps = [ - ":$_android_manifest_target", + ":$_merge_manifest_target", ] } - package_resources("${_apk_rule}__process_resources") { + process_resources("${_apk_rule}__process_resources") { deps = [ ":${_apk_rule}__generate_manifest", ] @@ -2929,12 +2838,6 @@ if (enable_java_templates) { } } - # TODO: Delete once recipes no longer use this target. - group("${target_name}_run") { - public_deps = [ - ":${invoker.target_name}", - ] - } group("${target_name}_incremental") { public_deps = [ ":$_incremental_test_runner_target_name", @@ -2991,7 +2894,6 @@ if (enable_java_templates) { } android_apk(target_name) { - set_sources_assignment_filter([]) data_deps = [] deps = [] forward_variables_from(invoker, "*") @@ -3053,55 +2955,54 @@ if (enable_java_templates) { # ] # } template("android_aidl") { - set_sources_assignment_filter([]) - forward_variables_from(invoker, [ "testonly" ]) - - srcjar_path = "${target_gen_dir}/${target_name}.srcjar" - aidl_path = "${android_sdk_build_tools}/aidl" - framework_aidl = "$android_sdk/framework.aidl" - action(target_name) { + set_sources_assignment_filter([]) + forward_variables_from(invoker, [ "testonly" ]) + script = "//build/android/gyp/aidl.py" sources = invoker.sources - imports = [ framework_aidl ] + _srcjar_path = "${target_gen_dir}/${target_name}.srcjar" + _aidl_path = "${android_sdk_build_tools}/aidl" + _framework_aidl = "$android_sdk/framework.aidl" + _imports = [ _framework_aidl ] if (defined(invoker.interface_file)) { assert(invoker.interface_file != "") - imports += [ invoker.interface_file ] + _imports += [ invoker.interface_file ] } - inputs = [ aidl_path ] + imports + inputs = [ _aidl_path ] + _imports depfile = "${target_gen_dir}/${target_name}.d" outputs = [ - srcjar_path, + _srcjar_path, ] - rebased_imports = rebase_path(imports, root_build_dir) + _rebased_imports = rebase_path(_imports, root_build_dir) args = [ "--depfile", rebase_path(depfile, root_build_dir), "--aidl-path", - rebase_path(aidl_path, root_build_dir), - "--imports=$rebased_imports", + rebase_path(_aidl_path, root_build_dir), + "--imports=$_rebased_imports", "--srcjar", - rebase_path(srcjar_path, root_build_dir), + rebase_path(_srcjar_path, root_build_dir), ] if (defined(invoker.import_include) && invoker.import_include != []) { # TODO(cjhopman): aidl supports creating a depfile. We should be able to # switch to constructing a depfile for the overall action from that # instead of having all the .java files in the include paths as inputs. - rebased_import_paths = [] - foreach(import_path, invoker.import_include) { + _rebased_import_paths = [] + foreach(_import_path, invoker.import_include) { _rebased_import_path = [] - _rebased_import_path += rebase_path([ import_path ], root_build_dir) - rebased_import_paths += _rebased_import_path + _rebased_import_path = [ rebase_path(_import_path, root_build_dir) ] + _rebased_import_paths += _rebased_import_path _java_files_build_rel = [] _java_files_build_rel = exec_script("//build/android/gyp/find.py", _rebased_import_path, "list lines") inputs += rebase_path(_java_files_build_rel, ".", root_build_dir) } - args += [ "--includes=$rebased_import_paths" ] + args += [ "--includes=$_rebased_import_paths" ] } args += rebase_path(sources, root_build_dir) } @@ -3153,7 +3054,7 @@ if (enable_java_templates) { _template_name = target_name action("${_template_name}__protoc_java") { - srcjar_path = "$target_gen_dir/$target_name.srcjar" + _srcjar_path = "$target_gen_dir/$target_name.srcjar" script = "//build/protoc_java.py" deps = [ @@ -3166,7 +3067,7 @@ if (enable_java_templates) { sources = invoker.sources depfile = "$target_gen_dir/$target_name.d" outputs = [ - srcjar_path, + _srcjar_path, ] args = [ "--depfile", @@ -3176,7 +3077,7 @@ if (enable_java_templates) { "--proto-path", rebase_path(_proto_path, root_build_dir), "--srcjar", - rebase_path(srcjar_path, root_build_dir), + rebase_path(_srcjar_path, root_build_dir), ] + rebase_path(sources, root_build_dir) if (_generate_lite) { args += [ "--lite" ] diff --git a/chromium/build/config/compiler/BUILD.gn b/chromium/build/config/compiler/BUILD.gn index fff8488778d..2673c6a7988 100644 --- a/chromium/build/config/compiler/BUILD.gn +++ b/chromium/build/config/compiler/BUILD.gn @@ -101,6 +101,24 @@ declare_args() { # Strip the debug info of symbols file in lib.unstripped to reduce size. strip_debug_info = false + + # Path to an AFDO profile to use while building with clang, if any. Empty + # implies none. + # + # Please note that you need to be very careful about changing your profile at + # the moment. See the `BUG(gbiv)` comment later in this file. + clang_sample_profile_path = "" + + # Some configurations have default sample profiles. If this is true and + # clang_sample_profile_path is empty, we'll fall back to the default. + clang_use_default_sample_profile = + is_official_build && defined(clang_default_afdo_profile) + + # Whether to assert to the compiler that the AFDO profiles are accurate. + # True will cause the compiler to optimize uncovered functions for size + # (despite passing -O2 or -O3), which reduces binary size by quite a bit, + # potentially at the cost of some performance. + clang_sample_profile_is_accurate = true } declare_args() { @@ -197,6 +215,34 @@ config("compiler") { # -------------------------------- cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204 + # AFDO on clang. Clang doesn't seem to suffer from the bug that caused GCC's + # AFDO to be split into its own config, so this isn't part of that config. + # + # Since we only profile the browser, skip it if we're building host tools. + # + # XXX(gbiv): There is currently *no* dependency between the profile we use + # and the compilations/links that we do. So, if the profile gets updated, + # the user has to manually clean build artifacts. CL:827560 should fix this + # by allowing us to specify `inputs` here, but until then, the only "good" + # workaround is changing your profile name each time you update the profile. + if (is_clang && current_toolchain == default_toolchain) { + _sample_path = "" + if (clang_sample_profile_path != "") { + _sample_path = clang_sample_profile_path + } else if (clang_use_default_sample_profile) { + assert(defined(clang_default_afdo_profile), + "This platform has no default sample profiles") + _sample_path = clang_default_afdo_profile + } + + if (_sample_path != "") { + cflags += [ "-fprofile-sample-use=${_sample_path}" ] + if (clang_sample_profile_is_accurate) { + cflags += [ "-fprofile-sample-accurate" ] + } + } + } + # Stack protection. if (is_mac) { # The strong variant of the stack protector significantly increases @@ -219,16 +265,6 @@ config("compiler") { cflags += [ "-fstack-protector" ] } } - - # Linker warnings. - if (fatal_linker_warnings && !(is_chromeos && current_cpu == "arm") && - !(is_android && use_order_profiling) && !is_mac && !is_ios && - current_os != "aix") { - # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 - # TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1 - # crbug.com/485542 - ldflags += [ "-Wl,--fatal-warnings" ] - } } # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for @@ -288,10 +324,12 @@ config("compiler") { ldflags += [ "-Wl,--build-id=sha1" ] } - defines += [ "_FILE_OFFSET_BITS=64" ] - if (!is_android) { defines += [ + # _FILE_OFFSET_BITS=64 should not be set on Android in order to maintain + # the behavior of the Android NDK from earlier versions. + # See https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html + "_FILE_OFFSET_BITS=64", "_LARGEFILE_SOURCE", "_LARGEFILE64_SOURCE", ] @@ -356,6 +394,12 @@ config("compiler") { if (is_posix && use_lld && !is_nacl) { ldflags += [ "-fuse-ld=lld" ] + if (current_cpu == "arm64") { + # Reduce the page size from 65536 in order to reduce binary size slightly + # by shrinking the alignment gap between segments. This also causes all + # segments to be mapped adjacently, which breakpad relies on. + ldflags += [ "-Wl,-z,max-page-size=4096" ] + } } else if (use_gold) { ldflags += [ "-fuse-ld=gold" ] if (!is_android) { @@ -587,6 +631,7 @@ config("compiler") { config("compiler_cpu_abi") { cflags = [] ldflags = [] + defines = [] if (is_posix && !(is_mac || is_ios)) { # CPU architecture. We may or may not be doing a cross compile now, so for @@ -643,18 +688,20 @@ config("compiler_cpu_abi") { } if (mips_arch_variant == "r6") { + cflags += [ "-mno-odd-spreg" ] + ldflags += [ "-mips32r6" ] if (is_clang) { - cflags += [ "-march=mips32r6" ] + cflags += [ + "-march=mipsel", + "-mcpu=mips32r6", + ] } else { cflags += [ "-mips32r6", "-Wa,-mips32r6", ] if (is_android) { - ldflags += [ - "-mips32r6", - "-Wl,-melf32ltsmip", - ] + ldflags += [ "-Wl,-melf32ltsmip" ] } } if (mips_use_msa == true) { @@ -664,18 +711,12 @@ config("compiler_cpu_abi") { ] } } else if (mips_arch_variant == "r2") { + ldflags += [ "-mips32r2" ] if (is_clang) { - if (is_android) { - cflags += [ - "-march=mipsel", - "-mcpu=mips32r2", - ] - } else { - cflags += [ - "-march=mipsel", - "-mcpu=mips32r2", - ] - } + cflags += [ + "-march=mipsel", + "-mcpu=mips32r2", + ] } else { cflags += [ "-mips32r2", @@ -686,18 +727,12 @@ config("compiler_cpu_abi") { } } } else if (mips_arch_variant == "r1") { + ldflags += [ "-mips32" ] if (is_clang) { - if (is_android) { - cflags += [ - "-march=mipsel", - "-mcpu=mips32", - ] - } else { - cflags += [ - "-march=mipsel", - "-mcpu=mips32", - ] - } + cflags += [ + "-march=mipsel", + "-mcpu=mips32", + ] } else { cflags += [ "-mips32", @@ -705,6 +740,7 @@ config("compiler_cpu_abi") { ] } } else if (mips_arch_variant == "loongson3") { + defines += [ "_MIPS_ARCH_LOONGSON" ] cflags += [ "-march=loongson3a", "-mno-branch-likely", @@ -811,6 +847,7 @@ config("compiler_cpu_abi") { ] ldflags += [ "-mips64r2" ] } else if (mips_arch_variant == "loongson3") { + defines += [ "_MIPS_ARCH_LOONGSON" ] cflags += [ "-march=loongson3a", "-mno-branch-likely", @@ -1189,7 +1226,7 @@ config("default_warnings") { ] } } else { - if (is_mac && !is_nacl) { + if ((is_mac || is_ios) && !is_nacl) { # When compiling Objective-C, warns if a method is used whose # availability is newer than the deployment target. cflags += [ "-Wunguarded-availability" ] @@ -1364,13 +1401,6 @@ config("chromium_code") { cflags_objc = [ "-Wobjc-missing-property-synthesis" ] cflags_objcc = [ "-Wobjc-missing-property-synthesis" ] } - - # TODO(crbug.com/761419): Add to default_warnings instead of to - # chromium_code once fixed in third_party. - if (is_ios) { - cflags_objc += [ "-Wunguarded-availability" ] - cflags_objcc += [ "-Wunguarded-availability" ] - } } configs = [ ":default_warnings" ] @@ -1565,7 +1595,9 @@ if (is_win) { if (is_official_build) { common_optimize_on_ldflags += [ "/OPT:REF" ] # Remove unreferenced data. - if (!use_lld) { + + # TODO(thakis): Remove is_clang here, https://crbug.com/598772 + if (!use_lld && !is_clang) { common_optimize_on_ldflags += [ # Set the number of LTCG code-gen threads to eight. The default is four. # This gives a 5-10% link speedup. @@ -2011,3 +2043,19 @@ if (is_ios || is_mac) { cflags_objcc = common_flags } } + +# Default linker warnings. +config("default_fatal_linker_warnings") { + ldflags = [] + + # Linker warnings. + if (!is_win && fatal_linker_warnings && + !(is_chromeos && current_cpu == "arm") && + !(is_android && use_order_profiling) && !is_mac && !is_ios && + current_os != "aix") { + # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 + # TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1 + # crbug.com/485542 + ldflags += [ "-Wl,--fatal-warnings" ] + } +} diff --git a/chromium/build/config/compiler/compiler.gni b/chromium/build/config/compiler/compiler.gni index 2c6b988564c..6fddf3d0526 100644 --- a/chromium/build/config/compiler/compiler.gni +++ b/chromium/build/config/compiler/compiler.gni @@ -108,6 +108,7 @@ if (is_mac || is_ios || is_linux) { enable_frame_pointers = current_cpu != "arm" } else if (is_android) { enable_frame_pointers = + enable_profiling || # Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706). current_cpu == "arm64" || # For x86 Android, unwind tables are huge without frame pointers diff --git a/chromium/build/config/features.gni b/chromium/build/config/features.gni index d014d0e12f1..09cddfd90c5 100644 --- a/chromium/build/config/features.gni +++ b/chromium/build/config/features.gni @@ -50,11 +50,6 @@ declare_args() { use_dbus = is_linux && !is_chromecast - # Option controlling the use of GConf (the classic GNOME configuration - # system). - use_gconf = is_linux && !is_chromeos && !is_chromecast && - current_toolchain == default_toolchain - use_gio = is_linux && !is_chromeos && !is_chromecast } # diff --git a/chromium/build/config/fuchsia/rules.gni b/chromium/build/config/fuchsia/rules.gni index 5f0b9a45b59..4ecf71a89eb 100644 --- a/chromium/build/config/fuchsia/rules.gni +++ b/chromium/build/config/fuchsia/rules.gni @@ -55,8 +55,6 @@ template("generate_runner_script") { "//build/fuchsia/runner_common.py", "//build/util/lib/", "//third_party/fuchsia-sdk/", - "//third_party/qemu-aarch64/", - "//third_party/qemu-x86_64/", ] runner_args += [ diff --git a/chromium/build/config/gcc/BUILD.gn b/chromium/build/config/gcc/BUILD.gn index 0f4493fdd8d..f1950bfec32 100644 --- a/chromium/build/config/gcc/BUILD.gn +++ b/chromium/build/config/gcc/BUILD.gn @@ -16,6 +16,7 @@ declare_args() { # especially when cross-compiling. # Note: this gn arg is similar to gyp target_rpath generator flag. gcc_target_rpath = "" + ldso_path = "" } # This config causes functions not to be automatically exported from shared @@ -88,6 +89,9 @@ config("rpath_for_built_shared_libraries") { "-Wl,-rpath-link=${rpath_link}", ] } + if (current_toolchain == default_toolchain && ldso_path != "") { + ldflags += [ "-Wl,--dynamic-linker=${ldso_path}" ] + } } } diff --git a/chromium/build/config/ios/rules.gni b/chromium/build/config/ios/rules.gni index e6f45b26df1..95f72f72f53 100644 --- a/chromium/build/config/ios/rules.gni +++ b/chromium/build/config/ios/rules.gni @@ -537,24 +537,28 @@ template("ios_app_bundle") { assert(defined(_variant.bundle_deps), "bundle_deps must be defined for all $target_name variants") - _variants += [ { - name = _variant.name - bundle_deps = _variant.bundle_deps - target_name = "${_target_name}_variants_${_variant.name}" - bundle_gen_dir = "$root_out_dir/variants/${_variant.name}" - } ] + _variants += [ + { + name = _variant.name + bundle_deps = _variant.bundle_deps + target_name = "${_target_name}_variants_${_variant.name}" + bundle_gen_dir = "$root_out_dir/variants/${_variant.name}" + }, + ] } } else { # If no variants are passed to the template, use a fake variant with # no name to avoid duplicating code. As no variant can have an empty # name except this fake variant, it is possible to know if a variant # is fake or not. - _variants = [ { - name = "" - bundle_deps = [] - target_name = _target_name - bundle_gen_dir = root_out_dir - } ] + _variants = [ + { + name = "" + bundle_deps = [] + target_name = _target_name + bundle_gen_dir = root_out_dir + }, + ] } _default_variant = _variants[0] diff --git a/chromium/build/config/jumbo.gni b/chromium/build/config/jumbo.gni index b6a7f80751b..427bb1fb541 100644 --- a/chromium/build/config/jumbo.gni +++ b/chromium/build/config/jumbo.gni @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/split_static_library.gni") # When someone uses that target_type +import("//build/toolchain/goma.gni") declare_args() { # If true, use a jumbo build (files compiled together) to speed up @@ -25,10 +26,17 @@ declare_args() { # jumbofied. At the same time it increases the compile time for the # largest jumbo chunks by 10-20% and reduces the chance to use all # available CPU cores. So set the default to 50 to balance between - # high and low-core build performance. - jumbo_file_merge_limit = 50 + # high and low-core build performance. -1 means do the default which + # varies depending on whether goma is enabled. + jumbo_file_merge_limit = -1 } +# Normal builds benefit from lots of jumbification +jumbo_file_merge_default = 50 + +# Goma builds benefit from more parallelism +jumbo_file_merge_goma = 8 + # Use one of the targets jumbo_source_set, jumbo_static_library, # jumbo_split_static_library or jumbo_component to generate a target # which merges sources if possible to compile much faster. @@ -111,13 +119,32 @@ template("internal_jumbo_target") { current_file_index = 0 next_chunk_start = 0 next_chunk_number = 1 + merge_limit = jumbo_file_merge_limit + if (merge_limit == -1) { + if (use_goma) { + merge_limit = jumbo_file_merge_goma + } else { + merge_limit = jumbo_file_merge_default + } + } + has_c_file = false + has_objective_c_file = false + has_S_file = false + assert(merge_limit > 0) foreach(source_file, invoker_sources) { - if (get_path_info(source_file, "extension") != "h") { + source_ext = get_path_info(source_file, "extension") + if (source_ext == "c") { + has_c_file = true + } else if (source_ext == "mm") { + has_objective_c_file = true + } else if (source_ext == "S") { + has_S_file = true + } else if (source_ext == "cc" || source_ext == "cpp") { if (current_file_index == next_chunk_start) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_" + next_chunk_number + ".cc" ] next_chunk_number += 1 - next_chunk_start += jumbo_file_merge_limit + next_chunk_start += merge_limit } current_file_index += 1 } @@ -131,22 +158,7 @@ template("internal_jumbo_target") { assert(next_chunk_start >= 0) # Prevent "unused variable" assert(next_chunk_number <= 2) # Prevent "unused variable" } - } - if (use_jumbo_build_for_target) { - has_c_file = false - has_objective_c_file = false - has_S_file = false - foreach(source_file, invoker_sources) { - source_ext = get_path_info(source_file, "extension") - if (source_ext == "c") { - has_c_file = true - } else if (source_ext == "mm") { - has_objective_c_file = true - } else if (source_ext == "S") { - has_S_file = true - } - } if (has_c_file) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_c.c" ] } @@ -156,7 +168,9 @@ template("internal_jumbo_target") { if (has_S_file) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_S.S" ] } + } + if (use_jumbo_build_for_target) { merge_action_name = target_name + "__jumbo_merge" # Create an action that calls a script that merges all the source files. diff --git a/chromium/build/config/linux/atk/BUILD.gn b/chromium/build/config/linux/atk/BUILD.gn index 63a7222d6bd..16a3f8c51aa 100644 --- a/chromium/build/config/linux/atk/BUILD.gn +++ b/chromium/build/config/linux/atk/BUILD.gn @@ -7,12 +7,10 @@ import("//build/config/linux/gtk/gtk.gni") import("//build/config/linux/pkg_config.gni") import("//build/config/ui.gni") -# CrOS doesn't install GTK, gconf or any gnome packages. +# CrOS doesn't install GTK or any gnome packages. assert(!is_chromeos) # These packages should _only_ be expected when building for a target. -# If these extra checks are not run, gconf is required when building host -# tools for a CrOS build. assert(current_toolchain == default_toolchain) if (use_atk) { diff --git a/chromium/build/config/linux/gconf/BUILD.gn b/chromium/build/config/linux/gconf/BUILD.gn deleted file mode 100644 index 262e96aa8e4..00000000000 --- a/chromium/build/config/linux/gconf/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/features.gni") -import("//build/config/linux/pkg_config.gni") - -# CrOS doesn't install GTK, gconf or any gnome packages. -assert(!is_chromeos && use_gconf) - -# These packages should _only_ be expected when building for a target. -# If these extra checks are not run, gconf is required when building host -# tools for a CrOS build. -assert(current_toolchain == default_toolchain) - -pkg_config("gconf") { - packages = [ "gconf-2.0" ] - defines = [ "USE_GCONF" ] -} diff --git a/chromium/build/config/merge_for_jumbo.py b/chromium/build/config/merge_for_jumbo.py index 7e5e2d42b68..4892c07e231 100755 --- a/chromium/build/config/merge_for_jumbo.py +++ b/chromium/build/config/merge_for_jumbo.py @@ -19,9 +19,11 @@ import os # ignored by the build system. We warn for unexpected files in the # sources list, but these are ok. NOOP_FILE_SUFFIXES = ( + ".css", ".g", ".idl", ".inc", + ".js", ".json", ".py", ) diff --git a/chromium/build/config/posix/BUILD.gn b/chromium/build/config/posix/BUILD.gn index 4ab2544294d..ae4a1bff8f0 100644 --- a/chromium/build/config/posix/BUILD.gn +++ b/chromium/build/config/posix/BUILD.gn @@ -63,37 +63,49 @@ config("runtime_library") { } else { ldflags += [ "-nodefaultlibs" ] - # Unfortunately, there's no way to disable linking against just - # libc++ (besides using clang instead of clang++); -nodefaultlibs - # removes all of the default libraries, so add back the ones that we - # need. + # Unfortunately, there's no way to disable linking against just libc++ + # (gcc doesn't have -notstdlib++: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83931); -nodefaultlibs + # removes all of the default libraries, so add back the ones that we need. libs += [ "c", + "gcc_s", "m", + "rt", ] - - if (!is_mac && !is_fuchsia && !is_android) { - libs += [ - "gcc_s", - "rt", - ] - } - - if (is_mac && using_sanitizer) { - lib_dirs += [ "//third_party/llvm-build/Release+Asserts/lib/clang/$clang_version/lib/darwin" ] - - if (is_asan) { - libs += [ "clang_rt.asan_osx_dynamic" ] - } - } } } if (!is_mac && !is_ios && sysroot != "") { # Pass the sysroot to all C compiler variants, the assembler, and linker. sysroot_flags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] + + # Android uses unified headers in NDK r16 and later, meaning that the + # compile time sysroot and link time sysroot are different + link_sysroot = sysroot + if (is_android) { + if (current_cpu == "arm") { + link_sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" + } else if (current_cpu == "arm64") { + link_sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir" + } else if (current_cpu == "x86") { + link_sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" + } else if (current_cpu == "x64") { + link_sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir" + } else if (current_cpu == "mipsel") { + link_sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" + } else if (current_cpu == "mips64el") { + link_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" + } else { + assert(false, "No android link sysroot for cpu: $target_cpu") + } + } + asmflags += sysroot_flags - ldflags += sysroot_flags + + link_sysroot_flags = + [ "--sysroot=" + rebase_path(link_sysroot, root_build_dir) ] + ldflags += link_sysroot_flags # When use_custom_libcxx=true, some -isystem flags get passed to # cflags_cc to set up libc++ include paths. We want to make sure @@ -113,7 +125,7 @@ config("runtime_library") { [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir), - rebase_path(sysroot), + rebase_path(link_sysroot), ], "list lines") foreach(ld_path, ld_paths) { diff --git a/chromium/build/config/sanitizers/BUILD.gn b/chromium/build/config/sanitizers/BUILD.gn index 4b1278157c4..6e651a6f5e8 100644 --- a/chromium/build/config/sanitizers/BUILD.gn +++ b/chromium/build/config/sanitizers/BUILD.gn @@ -397,7 +397,6 @@ config("cfi_icall_generalize_pointers") { config("coverage_flags") { cflags = [] - if (use_sanitizer_coverage) { cflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags", diff --git a/chromium/build/config/sanitizers/sanitizers.gni b/chromium/build/config/sanitizers/sanitizers.gni index 8ba5ce2987c..efea1d48b62 100644 --- a/chromium/build/config/sanitizers/sanitizers.gni +++ b/chromium/build/config/sanitizers/sanitizers.gni @@ -96,7 +96,7 @@ declare_args() { # Value for -fsanitize-coverage flag. Setting this causes # use_sanitizer_coverage to be enabled. - # Default value when unset and use_afl=true or use_libfuzzer=true: + # Default value when unset and use_fuzzing_engine=true: # trace-pc-guard # Default value when unset and use_sanitizer_coverage=true: # trace-pc-guard,indirect-calls @@ -134,13 +134,16 @@ if (current_toolchain != default_toolchain) { use_sanitizer_coverage = false } +# Whether we are doing a fuzzer build. Normally this should be checked instead +# of checking "use_libfuzzer || use_afl" because often developers forget to +# check for "use_afl". +use_fuzzing_engine = use_libfuzzer || use_afl + # Args that are in turn dependent on other args must be in a separate # declare_args block. User overrides are only applied at the end of a # declare_args block. declare_args() { - # Enable -fsanitize-coverage. - use_sanitizer_coverage = - use_libfuzzer || use_afl || sanitizer_coverage_flags != "" + use_sanitizer_coverage = use_fuzzing_engine || sanitizer_coverage_flags != "" # Detect overflow/underflow for global objects. # @@ -148,7 +151,7 @@ declare_args() { asan_globals = !is_mac } -if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { +if (use_fuzzing_engine && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "trace-pc-guard" } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "trace-pc-guard,indirect-calls" @@ -161,11 +164,6 @@ using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan || is_ubsan_null || is_ubsan_vptr || is_ubsan_security || use_sanitizer_coverage || use_cfi_diag -# Whether we are doing a fuzzer build. Normally this should be checked instead -# of checking "use_libfuzzer || use_afl" because often developers forget to -# check for "use_afl". -use_fuzzing_engine = use_libfuzzer || use_afl - assert(!using_sanitizer || is_clang, "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") diff --git a/chromium/build/config/sysroot.gni b/chromium/build/config/sysroot.gni index f26a55f5d07..daab5f87b12 100644 --- a/chromium/build/config/sysroot.gni +++ b/chromium/build/config/sysroot.gni @@ -25,21 +25,9 @@ if (current_os == target_os && current_cpu == target_cpu && sysroot = target_sysroot } else if (is_android) { import("//build/config/android/config.gni") - if (current_cpu == "x86") { - sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" - } else if (current_cpu == "arm") { - sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" - } else if (current_cpu == "mipsel") { - sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" - } else if (current_cpu == "x64") { - sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir" - } else if (current_cpu == "arm64") { - sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir" - } else if (current_cpu == "mips64el") { - sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" - } else { - assert(false, "No android sysroot for cpu: $target_cpu") - } + + # Android uses unified headers, and thus a single compile time sysroot + sysroot = "$android_ndk_root/sysroot" } else if (is_linux && use_sysroot) { # By default build against a sysroot image downloaded from Cloud Storage # during gclient runhooks. diff --git a/chromium/build/fuchsia/exe_runner.py b/chromium/build/fuchsia/exe_runner.py index 3ac47ca8dcd..7fde4dbd39e 100755 --- a/chromium/build/fuchsia/exe_runner.py +++ b/chromium/build/fuchsia/exe_runner.py @@ -24,6 +24,8 @@ def main(): '<bootfs_path>=<local_path>') parser.add_argument('--no-autorun', action='store_true', help='Disable generating an autorun file') + parser.add_argument('--forward-ssh-port', action='store', + help='Forward specified host port to SSH.') args, child_args = parser.parse_known_args() runtime_deps = ReadRuntimeDeps(args.runtime_deps_path, args.output_directory) @@ -50,7 +52,8 @@ def main(): if not bootfs: return 2 - return RunFuchsia(bootfs, args.device, args.kernel, args.dry_run, None) + return RunFuchsia(bootfs, args.device, args.kernel, args.dry_run, + forward_ssh_port=args.forward_ssh_port) if __name__ == '__main__': diff --git a/chromium/build/fuchsia/runner_common.py b/chromium/build/fuchsia/runner_common.py index 3ee19f5b270..6494a7e0166 100755 --- a/chromium/build/fuchsia/runner_common.py +++ b/chromium/build/fuchsia/runner_common.py @@ -24,8 +24,6 @@ import uuid DIR_SOURCE_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk') -QEMU_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', - 'qemu-' + platform.machine()) # The guest will get 192.168.3.9 from DHCP, while the host will be # accessible as 192.168.3.2 . @@ -135,11 +133,9 @@ def _ExpandDirectories(file_mapping, mapper): return expanded -def _GetSymbolsMapping(dry_run, file_mapping, output_directory): - """For each stripped executable or dynamic library in |file_mapping|, looks - for an unstripped version in [exe|lib].unstripped under |output_directory|. - Returns a map from target filenames to un-stripped binary, if available, or - to the run-time binary otherwise.""" +def _GetSymbolsMapping(dry_run, file_mapping): + """Generates symbols mapping from |file_mapping| by filtering out all files + that are not ELF binaries.""" symbols_mapping = {} for target, source in file_mapping.iteritems(): with open(source, 'rb') as f: @@ -147,23 +143,12 @@ def _GetSymbolsMapping(dry_run, file_mapping, output_directory): if file_tag != '\x7fELF': continue - # TODO(wez): Rather than bake-in assumptions about the naming of unstripped - # binaries, once we have ELF Build-Id values in the stack printout we should - # just scan the two directories to populate an Id->path mapping. - binary_name = os.path.basename(source) - exe_unstripped_path = os.path.join( - output_directory, 'exe.unstripped', binary_name) - lib_unstripped_path = os.path.join( - output_directory, 'lib.unstripped', binary_name) - if os.path.exists(exe_unstripped_path): - symbols_mapping[target] = exe_unstripped_path - elif os.path.exists(lib_unstripped_path): - symbols_mapping[target] = lib_unstripped_path - else: - symbols_mapping[target] = source + symbols_mapping[os.path.basename(target)] = source + symbols_mapping[target] = source - if dry_run: - print 'Symbols:', binary_name, '->', symbols_mapping[target] + if dry_run: + for target, path in symbols_mapping.iteritems(): + print 'Symbols:', target, '->', path return symbols_mapping @@ -302,13 +287,11 @@ def WriteAutorun(bin_name, child_args, summary_output, shutdown_machine, autorun_file.write('export CHROME_HEADLESS=1\n') if wait_for_network: - # Quietly block until `ping google.com` succeeds. - autorun_file.write("""echo "Waiting for network connectivity..." - until ping -c 1 google.com >/dev/null 2>/dev/null - do - : - done - """) + # Quietly block until `ping -c 0 google.com` succeeds. With -c 0 ping + # resolves the domain name, but doesn't send any pings. + autorun_file.write("echo Waiting for network connectivity...\n" + + "until ping -c 0 google.com >/dev/null 2>&1\n" + + "do sleep 1; done\n") if summary_output: # Unfortunately, devmgr races with this autorun script. This delays long @@ -330,20 +313,19 @@ def WriteAutorun(bin_name, child_args, summary_output, shutdown_machine, for arg in child_args: autorun_file.write(' "%s"' % arg); autorun_file.write('\n') - autorun_file.write('echo \"%s\"\n' % ALL_DONE_MESSAGE) if shutdown_machine: - autorun_file.write('echo Sleeping and shutting down...\n') + autorun_file.write('echo Shutting down...\n') + + # Sleep 1 second to let test outputs get flushed to the console. + autorun_file.write('msleep 1000\n') - # A delay is required to give the guest OS or remote device a chance to - # flush its output before it terminates. if use_device: - autorun_file.write('msleep 8000\n') autorun_file.write('dm reboot\n') else: - autorun_file.write('msleep 3000\n') autorun_file.write('dm poweroff\n') + autorun_file.write('echo \"%s\"\n' % ALL_DONE_MESSAGE) autorun_file.flush() os.chmod(autorun_file.name, 0750) @@ -404,8 +386,7 @@ def _BuildBootfsManifest(image_creation_data): lambda x: _MakeTargetImageName(DIR_SOURCE_ROOT, icd.output_directory, x)) # Determine the locations of unstripped versions of each binary, if any. - symbols_mapping = _GetSymbolsMapping( - icd.dry_run, file_mapping, icd.output_directory) + symbols_mapping = _GetSymbolsMapping(icd.dry_run, file_mapping) return file_mapping, symbols_mapping @@ -496,8 +477,8 @@ def _SymbolizeEntries(entries): return results -def _LookupDebugBinary(entry, file_mapping): - """Looks up the binary listed in |entry| in the |file_mapping|, and returns +def _LookupDebugBinary(entry, symbols_mapping): + """Looks up the binary listed in |entry| in the |symbols_mapping|, and returns the corresponding host-side binary's filename, or None.""" binary = entry['binary'] if not binary: @@ -518,24 +499,25 @@ def _LookupDebugBinary(entry, file_mapping): binary = binary[len(system_prefix):] # Allow any other paths to pass-through; sometimes neither prefix is present. - if binary in file_mapping: - return file_mapping[binary] + if binary in symbols_mapping: + return symbols_mapping[binary] # |binary| may be truncated by the crashlogger, so if there is a unique - # match for the truncated name in |file_mapping|, use that instead. - matches = filter(lambda x: x.startswith(binary), file_mapping.keys()) + # match for the truncated name in |symbols_mapping|, use that instead. + matches = filter(lambda x: x.startswith(binary), symbols_mapping.keys()) if len(matches) == 1: - return file_mapping[matches[0]] + return symbols_mapping[matches[0]] return None -def _SymbolizeBacktrace(backtrace, file_mapping): +def _SymbolizeBacktrace(backtrace, symbols_mapping): # Group |backtrace| entries according to the associated binary, and locate # the path to the debug symbols for that binary, if any. batches = {} + for entry in backtrace: - debug_binary = _LookupDebugBinary(entry, file_mapping) + debug_binary = _LookupDebugBinary(entry, symbols_mapping) if debug_binary: entry['debug_binary'] = debug_binary batches.setdefault(debug_binary, []).append(entry) @@ -566,9 +548,9 @@ def _HandleOutputFromProcess(process, symbols_mapping): # Back-trace line matcher/parser assumes that 'pc' is always present, and # expects that 'sp' and ('binary','pc_offset') may also be provided. backtrace_entry = re.compile( - r'pc 0(?:x[0-9a-f]+)? ' + - r'(?:sp 0x[0-9a-f]+ )?' + - r'(?:\((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') + r'pc 0(?:x[0-9a-f]+)?' + + r'(?: sp 0x[0-9a-f]+)?' + + r'(?: \((?P<binary>\S+),(?P<pc_offset>0x[0-9a-f]+)\))?$') # A buffer of backtrace entries awaiting symbolization, stored as dicts: # raw: The original back-trace line that followed the prefix. @@ -631,7 +613,7 @@ def _HandleOutputFromProcess(process, symbols_mapping): def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, - test_launcher_summary_output): + test_launcher_summary_output=None, forward_ssh_port=None): if not kernel_path: # TODO(wez): Parameterize this on the |target_cpu| from GN. kernel_path = os.path.join(_TargetCpuToSdkBinPath(bootfs_data.target_cpu), @@ -644,6 +626,16 @@ def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, kernel_args.append('zircon.autorun.system=/boot/bin/sh+/system/cr_autorun') if use_device: + if test_launcher_summary_output: + sys.stderr.write("--test-launcher-summary-output when running " + + "on a device.\n") + return 1 + + if forward_ssh_port: + sys.stderr.write("--forward-ssh-port is not supported when running " + + "on a device.\n") + return 1 + # Deploy the boot image to the device. bootserver_path = os.path.join(SDK_ROOT, 'tools', 'bootserver') bootserver_command = [bootserver_path, '-1', kernel_path, @@ -656,7 +648,7 @@ def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, stdout=subprocess.PIPE, stdin=open(os.devnull)) else: qemu_path = os.path.join( - QEMU_ROOT,'bin', + SDK_ROOT, 'qemu', 'bin', 'qemu-system-' + _TargetCpuToArch(bootfs_data.target_cpu)) qemu_command = [qemu_path, '-m', '2048', @@ -665,11 +657,6 @@ def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, '-initrd', bootfs_data.bootfs, '-smp', '4', - # Configure virtual network. It is used in the tests to connect to - # testserver running on the host. - '-netdev', 'user,id=net0,net=%s,dhcpstart=%s,host=%s' % - (GUEST_NET, GUEST_IP_ADDRESS, HOST_IP_ADDRESS), - # Use stdio for the guest OS only; don't attach the QEMU interactive # monitor. '-serial', 'stdio', @@ -687,19 +674,30 @@ def RunFuchsia(bootfs_data, use_device, kernel_path, dry_run, qemu_command.extend([ '-machine','virt', '-cpu', 'cortex-a53', - '-device', 'virtio-net-pci,netdev=net0,mac=' + GUEST_MAC_ADDRESS, ]) + netdev_type = 'virtio-net-pci' if platform.machine() == 'aarch64': qemu_command.append('-enable-kvm') else: qemu_command.extend([ '-machine', 'q35', '-cpu', 'host,migratable=no', - '-device', 'e1000,netdev=net0,mac=' + GUEST_MAC_ADDRESS, ]) + netdev_type = 'e1000' if platform.machine() == 'x86_64': qemu_command.append('-enable-kvm') + # Configure virtual network. It is used in the tests to connect to + # testserver running on the host. + netdev_config = 'user,id=net0,net=%s,dhcpstart=%s,host=%s' % \ + (GUEST_NET, GUEST_IP_ADDRESS, HOST_IP_ADDRESS) + if forward_ssh_port: + netdev_config += ",hostfwd=tcp::%s-:22" % forward_ssh_port + qemu_command.extend([ + '-netdev', netdev_config, + '-device', '%s,netdev=net0,mac=%s' % (netdev_type, GUEST_MAC_ADDRESS), + ]) + if test_launcher_summary_output: # Make and mount a 100M minfs formatted image that is used to copy the # results json to, for extraction from the target. diff --git a/chromium/build/fuchsia/runner_v2/boot_image.py b/chromium/build/fuchsia/runner_v2/boot_image.py new file mode 100644 index 00000000000..6cab62bd527 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/boot_image.py @@ -0,0 +1,96 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Functions used to provision Fuchsia boot images.""" + +import common +import os +import subprocess +import tempfile + +_SSH_CONFIG_TEMPLATE = """ +Host * + CheckHostIP no + StrictHostKeyChecking no + ForwardAgent no + ForwardX11 no + GSSAPIDelegateCredentials no + UserKnownHostsFile {known_hosts} + User fuchsia + IdentitiesOnly yes + IdentityFile {identity} + ServerAliveInterval 1 + ServerAliveCountMax 1""" + + +def _GetKernelPath(target_arch): + return os.path.join(_TargetCpuToSdkBinPath(target_arch), 'zircon.bin') + + +def _TargetCpuToSdkBinPath(target_arch): + """Returns the path to the kernel & bootfs .bin files for |target_cpu|.""" + return os.path.join(common.SDK_ROOT, 'target', target_arch) + + +def _ProvisionSSH(output_dir): + """Provisions the key files used by the SSH daemon, and generates a + configuration file used by clients for connecting to SSH. + + Returns a tuple with: + #0: the client configuration file + #1: a list of file path pairs: (<path in image>, <path on build filesystem>). + """ + + host_key_path = output_dir + '/ssh_key' + host_pubkey_path = host_key_path + '.pub' + id_key_path = output_dir + '/id_ed25519' + id_pubkey_path = id_key_path + '.pub' + known_hosts_path = output_dir + '/known_hosts' + ssh_config_path = output_dir + '/ssh_config' + + if not os.path.isfile(host_key_path): + subprocess.check_call(['ssh-keygen', '-t', 'ed25519', '-h', '-f', + host_key_path, '-P', '', '-N', ''], + stdout=open(os.devnull)) + if not os.path.isfile(id_key_path): + subprocess.check_call(['ssh-keygen', '-t', 'ed25519', '-f', id_key_path, + '-P', '', '-N', ''], stdout=open(os.devnull)) + + with open(ssh_config_path, "w") as ssh_config: + ssh_config.write( + _SSH_CONFIG_TEMPLATE.format(identity=id_key_path, + known_hosts=known_hosts_path)) + + return ( + ssh_config_path, + (('data/ssh/ssh_host_ed25519_key', host_key_path), + ('data/ssh/ssh_host_ed25519_key.pub', host_pubkey_path), + ('data/ssh/authorized_keys', id_pubkey_path)) + ) + + +def CreateBootFS(output_dir, target_arch): + """Creates a bootfs image provisoned with the credentials necessary + for SSH remote access. + + Returns a tuple with the path to SSH config and the path to the boot + image.""" + + boot_image = os.path.join( + _TargetCpuToSdkBinPath(target_arch), 'bootdata.bin') + ssh_manifest = tempfile.NamedTemporaryFile(delete=False) + ssh_config, ssh_data = _ProvisionSSH(output_dir) + for key, val in ssh_data: + ssh_manifest.write("%s=%s\n" % (key, val)) + ssh_manifest.close() + mkbootfs_path = os.path.join(common.SDK_ROOT, 'tools', 'mkbootfs') + bootfs_name = output_dir + '/image.bootfs' + args = [mkbootfs_path, '-o', bootfs_name, + '--target=boot', boot_image, + '--target=system', ssh_manifest.name] + + subprocess.check_call(args) + os.remove(ssh_manifest.name) + + return ssh_config, bootfs_name diff --git a/chromium/build/fuchsia/runner_v2/common.py b/chromium/build/fuchsia/runner_v2/common.py new file mode 100644 index 00000000000..c2a489ad0c4 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/common.py @@ -0,0 +1,10 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os + +DIR_SOURCE_ROOT = os.path.abspath( + os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)) +SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk') + diff --git a/chromium/build/fuchsia/runner_v2/qemu_target.py b/chromium/build/fuchsia/runner_v2/qemu_target.py new file mode 100644 index 00000000000..d5ffb449bd3 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/qemu_target.py @@ -0,0 +1,127 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Implements commands for running and interacting with Fuchsia on QEMU.""" + +import boot_image +import common +import target +import os +import platform +import socket +import subprocess +import time + + +# Virtual networking configuration data for QEMU. +GUEST_NET = '192.168.3.0/24' +GUEST_IP_ADDRESS = '192.168.3.9' +HOST_IP_ADDRESS = '192.168.3.2' +GUEST_MAC_ADDRESS = '52:54:00:63:5e:7b' + + +def _GetAvailableTcpPort(): + """Finds a (probably) open port by opening and closing a listen socket.""" + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.bind(("", 0)) + port = sock.getsockname()[1] + sock.close() + return port + + +class QemuTarget(target.Target): + def __init__(self, output_dir, target_cpu, verbose=True): + """output_dir: The directory which will contain the files that are + generated to support the QEMU deployment. + target_cpu: The emulated target CPU architecture. Can be 'x64' or 'arm64'. + verbose: If true, emits extra non-error logging data for diagnostics.""" + super(QemuTarget, self).__init__(output_dir, target_cpu, verbose) + self._qemu_process = None + + def __enter__(self): + return self + + # Used by the context manager to ensure that QEMU is killed when the Python + # process exits. + def __exit__(self, exc_type, exc_val, exc_tb): + if self.IsStarted(): + self.Shutdown() + + def Start(self): + self._ssh_config_path, boot_image_path = boot_image.CreateBootFS( + self._output_dir, self._GetTargetSdkArch()) + qemu_path = os.path.join( + common.SDK_ROOT, 'qemu', 'bin', + 'qemu-system-' + self._GetTargetSdkArch()) + kernel_args = ['devmgr.epoch=%d' % time.time()] + + qemu_command = [qemu_path, + '-m', '2048', + '-nographic', + '-kernel', boot_image._GetKernelPath(self._GetTargetSdkArch()), + '-initrd', boot_image_path, + '-smp', '4', + + # Use stdio for the guest OS only; don't attach the QEMU interactive + # monitor. + '-serial', 'stdio', + '-monitor', 'none', + + # TERM=dumb tells the guest OS to not emit ANSI commands that trigger + # noisy ANSI spew from the user's terminal emulator. + '-append', 'TERM=dumb ' + ' '.join(kernel_args) + ] + + # Configure the machine & CPU to emulate, based on the target architecture. + # Enable lightweight virtualization (KVM) if the host and guest OS run on + # the same architecture. + if self._target_cpu == 'arm64': + qemu_command.extend([ + '-machine','virt', + '-cpu', 'cortex-a53', + ]) + netdev_type = 'virtio-net-pci' + if platform.machine() == 'aarch64': + qemu_command.append('-enable-kvm') + else: + qemu_command.extend([ + '-machine', 'q35', + '-cpu', 'host,migratable=no', + ]) + netdev_type = 'e1000' + if platform.machine() == 'x86_64': + qemu_command.append('-enable-kvm') + + # Configure virtual network. It is used in the tests to connect to + # testserver running on the host. + netdev_config = 'user,id=net0,net=%s,dhcpstart=%s,host=%s' % \ + (GUEST_NET, GUEST_IP_ADDRESS, HOST_IP_ADDRESS) + + self._host_ssh_port = _GetAvailableTcpPort() + netdev_config += ",hostfwd=tcp::%s-:22" % self._host_ssh_port + qemu_command.extend([ + '-netdev', netdev_config, + '-device', '%s,netdev=net0,mac=%s' % (netdev_type, GUEST_MAC_ADDRESS), + ]) + + # We pass a separate stdin stream to qemu. Sharing stdin across processes + # leads to flakiness due to the OS prematurely killing the stream and the + # Python script panicking and aborting. + # The precise root cause is still nebulous, but this fix works. + # See crbug.com/741194. + self._qemu_process = subprocess.Popen( + qemu_command, stdout=subprocess.PIPE, stdin=open(os.devnull)) + + self._Attach(); + + def Shutdown(self): + self._qemu_process.kill() + + def _GetEndpoint(self): + return ('127.0.0.1', self._host_ssh_port) + + def _GetSshConfigPath(self): + return self._ssh_config_path + + diff --git a/chromium/build/fuchsia/runner_v2/qemu_target_test.py b/chromium/build/fuchsia/runner_v2/qemu_target_test.py new file mode 100755 index 00000000000..ab287684246 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/qemu_target_test.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import qemu_target +import shutil +import tempfile +import time +import unittest + +TEST_PAYLOAD = "Let's get this payload across the finish line!" + +tmpdir = tempfile.mkdtemp() + +# Register the target with the context manager so that it always gets +# torn down on process exit. Otherwise there might be lingering QEMU instances +# if Python crashes or is interrupted. +with qemu_target.QemuTarget(tmpdir, 'x64') as target: + class TestQemuTarget(unittest.TestCase): + @classmethod + def setUpClass(cls): + target.Start() + + @classmethod + def tearDownClass(cls): + target.Shutdown() + shutil.rmtree(tmpdir) + + def testCopyBidirectional(self): + tmp_path = tmpdir + "/payload" + with open(tmp_path, "w") as tmpfile: + tmpfile.write(TEST_PAYLOAD) + target.CopyTo(tmp_path, '/tmp/payload') + + tmp_path_roundtrip = tmp_path + ".roundtrip" + target.CopyFrom('/tmp/payload', tmp_path_roundtrip) + with open(tmp_path_roundtrip) as roundtrip: + self.assertEqual(TEST_PAYLOAD, roundtrip.read()) + + def testRunCommand(self): + self.assertEqual(0, target.RunCommand(['true'])) + + # This is a known bug: https://fuchsia.atlassian.net/browse/NET-349 + self.assertEqual(1, target.RunCommand(['false'])) + + def testRunCommandPiped(self): + proc = target.RunCommandPiped(['cat']) + proc.stdin.write(TEST_PAYLOAD) + proc.stdin.flush() + proc.stdin.close() + self.assertEqual(TEST_PAYLOAD, proc.stdout.readline()) + proc.kill() + + + if __name__ == '__main__': + unittest.main() diff --git a/chromium/build/fuchsia/runner_v2/remote_cmd.py b/chromium/build/fuchsia/runner_v2/remote_cmd.py new file mode 100644 index 00000000000..8d7ad3a9e56 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/remote_cmd.py @@ -0,0 +1,85 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Helper functions for remotely executing and copying files over a SSH +connection.""" + +import os +import subprocess + +_SSH = ['ssh'] +_SCP = ['scp'] + +COPY_TO_TARGET = 0 +COPY_FROM_TARGET = 1 + + +def RunSsh(config_path, host, port, command, silent): + """Executes an SSH command on the remote host and blocks until completion. + + config_path: Full path to SSH configuration. + host: The hostname or IP address of the remote host. + port: The port to connect to. + command: A list of strings containing the command and its arguments. + silent: If true, suppresses all output from 'ssh'. + + Returns the exit code from the remote command.""" + + ssh_command = _SSH + ['-F', config_path, + host, + '-p', str(port)] + command + if silent: + devnull = open(os.devnull, 'w') + return subprocess.call(ssh_command, stderr=devnull, stdout=devnull) + else: + return subprocess.call(ssh_command) + + +def RunPipedSsh(config_path, host, port, command): + """Executes an SSH command on the remote host and returns a process object + with access to the command's stdio streams. Does not block. + + config_path: Full path to SSH configuration. + host: The hostname or IP address of the remote host. + port: The port to connect to. + command: A list of strings containing the command and its arguments. + silent: If true, suppresses all output from 'ssh'. + + Returns a Popen object for the command.""" + + ssh_command = _SSH + ['-F', config_path, + host, + '-p', str(port)] + command + return subprocess.Popen(ssh_command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=subprocess.PIPE) + + +def RunScp(config_path, host, port, source, dest, direction): + """Copies a file to or from a remote host using SCP and blocks until + completion. + + config_path: Full path to SSH configuration. + host: The hostname or IP address of the remote host. + port: The port to connect to. + source: The path of the file to be copied. + dest: The path that |source| will be copied to. + direction: Indicates whether the file should be copied to + or from the remote side. + Valid values are COPY_TO_TARGET or COPY_FROM_TARGET. + + Function will raise an assertion if a failure occurred.""" + + if direction == COPY_TO_TARGET: + dest = "%s:%s" % (host, dest) + else: + source = "%s:%s" % (host, source) + + scp_command = _SCP + ['-F', config_path, + '-P', str(port), + source, + dest] + devnull = open('/dev/null', 'w') + subprocess.check_call(scp_command, stdout=devnull) diff --git a/chromium/build/fuchsia/runner_v2/target.py b/chromium/build/fuchsia/runner_v2/target.py new file mode 100644 index 00000000000..05ee996db64 --- /dev/null +++ b/chromium/build/fuchsia/runner_v2/target.py @@ -0,0 +1,121 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import remote_cmd +import subprocess +import sys +import tempfile +import time + +_SHUTDOWN_CMD = ['dm', 'poweroff'] +_ATTACH_MAX_RETRIES = 10 +_ATTACH_RETRY_INTERVAL = 1 + + +class Target(object): + """Abstract base class representing a Fuchsia deployment target.""" + + def __init__(self, output_dir, target_cpu, verbose): + self._target_cpu = target_cpu + self._output_dir = output_dir + self._started = False + self._dry_run = False + self._vlogger = sys.stdout if verbose else open(os.devnull, 'w') + + def Start(self): + """Handles the instantiation and connection process for the Fuchsia + target instance.""" + pass + + def IsStarted(self): + """Returns true if the Fuchsia target instance is ready to accept + commands.""" + return self._started + + def RunCommandPiped(self, command): + """Starts a remote command and immediately returns a Popen object for the + command. The caller may interact with the streams, inspect the status code, + wait on command termination, etc. + + command: A list of strings representing the command and arguments. + + Returns: a Popen object. + + Note: method does not block.""" + + self._AssertStarted() + host, port = self._GetEndpoint() + return remote_cmd.RunPipedSsh(self._GetSshConfigPath(), host, port, command) + + def RunCommand(self, command, silent=False): + """Executes a remote command and waits for it to finish executing. + + Returns the exit code of the command.""" + + self._AssertStarted() + host, port = self._GetEndpoint() + return remote_cmd.RunSsh(self._GetSshConfigPath(), host, port, command, + silent) + + def CopyTo(self, source, dest): + """Copies a file from the local filesystem to the target filesystem. + + source: The path of the file being copied. + dest: The path on the remote filesystem which will be copied to.""" + + self._AssertStarted() + host, port = self._GetEndpoint() + command = remote_cmd.RunScp(self._GetSshConfigPath(), host, port, + source, dest, remote_cmd.COPY_TO_TARGET) + + def CopyFrom(self, source, dest): + """Copies a file from the target filesystem to the local filesystem. + + source: The path of the file being copied. + dest: The path on the local filesystem which will be copied to.""" + self._AssertStarted() + host, port = self._GetEndpoint() + return remote_cmd.RunScp(self._GetSshConfigPath(), host, port, + source, dest, remote_cmd.COPY_FROM_TARGET) + + def Shutdown(self): + self.RunCommand(_SHUTDOWN_CMD) + self._started = False + + def _GetEndpoint(self): + """Returns a (host, port) tuple for the SSH connection to the target.""" + raise NotImplementedError + + def _GetTargetSdkArch(self): + """Returns the Fuchsia SDK architecture name for the target CPU.""" + if self._target_cpu == 'arm64': + return 'aarch64' + elif self._target_cpu == 'x64': + return 'x86_64' + raise Exception('Unknown target_cpu:' + self._target_cpu) + + def _AssertStarted(self): + assert self.IsStarted() + + def _Attach(self): + self._vlogger.write('Trying to connect over SSH...') + self._vlogger.flush() + for _ in xrange(_ATTACH_MAX_RETRIES): + host, port = self._GetEndpoint() + if remote_cmd.RunSsh(self._ssh_config_path, host, port, ['echo'], + True) == 0: + self._vlogger.write(' connected!\n') + self._vlogger.flush() + self._started = True + return + self._vlogger.write('.') + self._vlogger.flush() + time.sleep(_ATTACH_RETRY_INTERVAL) + sys.stderr.write(' timeout limit reached.\n') + raise Exception('Couldn\'t connect to QEMU using SSH.') + + def _GetSshConfigPath(self, path): + raise NotImplementedError + diff --git a/chromium/build/fuchsia/test_runner.py b/chromium/build/fuchsia/test_runner.py index 5e4dbdeeedb..d69f039822b 100755 --- a/chromium/build/fuchsia/test_runner.py +++ b/chromium/build/fuchsia/test_runner.py @@ -209,7 +209,8 @@ def main(): return 2 return RunFuchsia(bootfs, args.device, args.kernel, args.dry_run, - args.test_launcher_summary_output) + test_launcher_summary_output= + args.test_launcher_summary_output) finally: # Stop the spawner to make sure it doesn't leave testserver running, in # case some tests failed. diff --git a/chromium/build/fuchsia/update_sdk.py b/chromium/build/fuchsia/update_sdk.py index 76c1c891b58..8d707997fc3 100755 --- a/chromium/build/fuchsia/update_sdk.py +++ b/chromium/build/fuchsia/update_sdk.py @@ -46,14 +46,19 @@ def main(): if os.path.isdir(output_dir): shutil.rmtree(output_dir) - bucket = 'gs://fuchsia/sdk/linux-amd64/' - with tempfile.NamedTemporaryFile() as f: + fd, tmp = tempfile.mkstemp() + os.close(fd) + + try: + bucket = 'gs://fuchsia/sdk/linux-amd64/' cmd = [os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'gsutil.py'), - 'cp', bucket + sdk_hash, f.name] + 'cp', bucket + sdk_hash, tmp] subprocess.check_call(cmd) - f.seek(0) - EnsureDirExists(output_dir) - tarfile.open(mode='r:gz', fileobj=f).extractall(path=output_dir) + with open(tmp, 'rb') as f: + EnsureDirExists(output_dir) + tarfile.open(mode='r:gz', fileobj=f).extractall(path=output_dir) + finally: + os.remove(tmp) with open(hash_filename, 'w') as f: f.write(sdk_hash) diff --git a/chromium/build/gypi_to_gn.py b/chromium/build/gypi_to_gn.py index 08007088a89..2a3a72ac0f9 100644 --- a/chromium/build/gypi_to_gn.py +++ b/chromium/build/gypi_to_gn.py @@ -117,6 +117,7 @@ def LoadPythonDictionary(path): elements_to_strip = [ 'conditions', 'target_conditions', + 'target_defaults', 'targets', 'includes', 'actions', diff --git a/chromium/build/install-build-deps.sh b/chromium/build/install-build-deps.sh index a2f630f3991..172aa9cc05c 100755 --- a/chromium/build/install-build-deps.sh +++ b/chromium/build/install-build-deps.sh @@ -168,11 +168,9 @@ dev_list="\ libcap-dev libcups2-dev libcurl4-gnutls-dev - libdconf-dev libdrm-dev libelf-dev libffi-dev - libgconf2-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev @@ -235,7 +233,6 @@ lib_list="\ libcairo2 libcap2 libcups2 - libdconf1 libexpat1 libffi6 libfontconfig1 @@ -420,9 +417,7 @@ nacl_list="\ libasound2:i386 libcap2:i386 libelf-dev:i386 - libdconf1:i386 libfontconfig1:i386 - libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386 libgtk2.0-0:i386 @@ -447,10 +442,12 @@ nacl_list="\ ${naclports_list} " -if package_exists libssl1.0.0; then - nacl_list="${nacl_list} libssl1.0.0:i386" -else +if package_exists libssl1.1; then + nacl_list="${nacl_list} libssl1.1:i386" +elif package_exists libssl1.0.2; then nacl_list="${nacl_list} libssl1.0.2:i386" +else + nacl_list="${nacl_list} libssl1.0.0:i386" fi # Find the proper version of packages that depend on mesa. Only one -lts variant @@ -478,10 +475,10 @@ dev_list="${dev_list} libgbm-dev${mesa_variant} nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" # Some package names have changed over time -if package_exists libpng12-0; then - lib_list="${lib_list} libpng12-0" -else +if package_exists libpng16-16; then lib_list="${lib_list} libpng16-16" +else + lib_list="${lib_list} libpng12-0" fi if package_exists libnspr4-dbg; then dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" @@ -507,10 +504,10 @@ if package_exists libbrlapi0.6; then else dev_list="${dev_list} libbrlapi0.5" fi -if package_exists apache2-bin; then - dev_list="${dev_list} apache2-bin" -else +if package_exists apache2.2-bin; then dev_list="${dev_list} apache2.2-bin" +else + dev_list="${dev_list} apache2-bin" fi if package_exists xfonts-mathml; then dev_list="${dev_list} xfonts-mathml" diff --git a/chromium/build/linux/BUILD.gn b/chromium/build/linux/BUILD.gn index 1573bb053b4..54314c76878 100644 --- a/chromium/build/linux/BUILD.gn +++ b/chromium/build/linux/BUILD.gn @@ -10,25 +10,7 @@ if (use_gio) { pkg_config("gio_config") { packages = [ "gio-2.0" ] - # glib >=2.40 deprecate g_settings_list_schemas in favor of - # g_settings_schema_source_list_schemas. This function is not available on - # earlier versions that we still need to support (specifically, 2.32), so - # disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define. - # TODO(mgiuca): Remove this suppression when we drop support for Ubuntu - # 13.10 (saucy) and earlier. Update the code to use - # g_settings_schema_source_list_schemas instead. - defines = [ - "USE_GIO", - "GLIB_DISABLE_DEPRECATION_WARNINGS", - ] - - # TODO(brettw) Theoretically I think ignore_libs should be set so that we - # don't link directly to GIO and use the loader generated below. But the - # gio target in GYP doesn't make any sense to me and appears to link - # directly to GIO in addition to making a loader. This this uncommented, - # the link in component build fails, so I think this is closer to the - # GYP build. - #ignore_libs = true # Loader generated below. + defines = [ "USE_GIO" ] } } diff --git a/chromium/build/linux/chrome.map b/chromium/build/linux/chrome.map index 28ca6d47225..914f37b45df 100644 --- a/chromium/build/linux/chrome.map +++ b/chromium/build/linux/chrome.map @@ -48,10 +48,6 @@ global: pvalloc; realloc; __realloc_hook; - __start_google_malloc; - __start_malloc_hook; - __stop_google_malloc; - __stop_malloc_hook; valloc; # Various flavors of operator new and operator delete. diff --git a/chromium/build/linux/libgio/BUILD.gn b/chromium/build/linux/libgio/BUILD.gn deleted file mode 100644 index 3deb63dd6ca..00000000000 --- a/chromium/build/linux/libgio/BUILD.gn +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//tools/generate_library_loader/generate_library_loader.gni") - -# This generates a target named "libgio". -generate_library_loader("libgio") { - name = "LibGioLoader" - output_h = "libgio.h" - output_cc = "libgio_loader.cc" - header = "<gio/gio.h>" - config = "//build/linux:gio_config" - - functions = [ - "glib_check_version", - "g_type_init", - "g_settings_new", - "g_settings_get_child", - "g_settings_get_string", - "g_settings_get_boolean", - "g_settings_get_int", - "g_settings_get_strv", - "g_settings_list_schemas", - ] -} diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.amd64 b/chromium/build/linux/sysroot_scripts/packagelist.stretch.amd64 index 537faa69009..aac388b959b 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.amd64 +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.amd64 @@ -16,19 +16,20 @@ http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2_1.14.8-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2-dev_1.14.8-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-gobject2_1.14.8-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-script-interpreter2_1.14.8-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/c/colord/libcolord2_1.3.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2_2.2.1-8_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2-dev_2.2.1-8_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_amd64.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_amd64.deb +http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_amd64.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf-dev_0.168-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/f/flac/libflac8_1.3.2-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.7+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_2.11.0-6.7+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.6.3-3.2_amd64.deb @@ -47,11 +48,9 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libtsan0_6.3.0-18_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libubsan0_6.3.0-18_amd64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-3_1.3.10-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-dev_1.3.10-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.31-2_amd64.deb @@ -62,6 +61,9 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_amd64 http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_amd64.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.15-1+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.15-1+deb9u1_amd64.deb @@ -73,9 +75,12 @@ http://ftp.us.debian.org/debian/pool/main/k/krb5/libkdb5-8_1.15-1+deb9u1_amd64.d http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.15-1+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.15-1+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.15-1+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.8-6_amd64.deb http://ftp.us.debian.org/debian/pool/main/libb/libbsd/libbsd0_0.8.3-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap2_2.25-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap-dev_2.25-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-3+b1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libd/libdatrie/libdatrie1_0.2.10-4+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.74-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.74-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-dev_2.4.74-1_amd64.deb @@ -90,15 +95,26 @@ http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring-dev_3.12.0-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.26-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-dev_1.26-2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libi/libice/libice6_1.0.9-2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidl/libidl-2-0_0.8.14-4_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp1_1.7.4-3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp-dev_1.7.4-3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libn/libnss-db/libnss-db_2.2.3pre1-6+b1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.2-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libp/libp11/libp11-2_0.4.3-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libp/libpciaccess/libpciaccess0_0.13.4-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng16-16_1.6.28-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng-dev_1.6.28-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libp/libpthread-stubs/libpthread-stubs0-dev_0.3-4_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libr/librest/librest-0.7-0_0.8.0-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.6-3+b3_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsm/libsm6_1.2.2-1+b3_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsndfile/libsndfile1_1.0.27-3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-6/libtasn1-6_4.10-1.1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libt/libthai/libthai0_0.1.26-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.6-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva1_1.7.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-dev_1.7.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-drm1_1.7.3-2_amd64.deb @@ -107,6 +123,8 @@ http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-glx1_1.7.3-2_amd64.de http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-tpi1_1.7.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-wayland1_1.7.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-x11-1_1.7.3-2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.5-4_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbisenc2_1.3.5-4_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.4-3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-dev_1.6.4-3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-xcb1_1.6.4-3_amd64.deb @@ -124,10 +142,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-render0-dev_1.12-1_ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0_1.12-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0-dev_1.12-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_amd64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_amd64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_amd64.deb @@ -140,8 +157,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_amd64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_amd64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_amd64.deb @@ -154,6 +171,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxt/libxt-dev_1.1.5-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst6_1.2.3-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst-dev_1.2.3-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxxf86vm/libxxf86vm1_1.1.4-1+b2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.8-4_amd64.deb +http://ftp.us.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa_13.0.6-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa-dev_13.0.6-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libgbm1_13.0.6-1+b2_amd64.deb @@ -163,8 +183,11 @@ http://ftp.us.debian.org/debian/pool/main/m/mesa/libgl1-mesa-glx_13.0.6-1+b2_amd http://ftp.us.debian.org/debian/pool/main/m/mesa/libglapi-mesa_13.0.6-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libwayland-egl1-mesa_13.0.6-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/mesa-common-dev_13.0.6-1+b2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libhogweed4_3.3-1+b2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libnettle6_3.3-1+b2_amd64.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4_4.12-6_amd64.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4-dev_4.12-6_amd64.deb +http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit-2-0_2.14.19-2+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit2_2.14.19-2+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/p/p11-kit/libp11-kit0_0.23.3-2_amd64.deb http://ftp.us.debian.org/debian/pool/main/p/pam/libpam0g_1.1.8-3.6_amd64.deb @@ -190,8 +213,15 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_amd64.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/t/tcp-wrappers/libwrap0_7.6.q-26_amd64.deb +http://ftp.us.debian.org/debian/pool/main/u/unbound/libunbound2_1.6.0-3+deb9u1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libblkid1_2.29.2-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libmount1_2.29.2-1_amd64.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libuuid1_2.29.2-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-client0_1.12.0-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-cursor0_1.12.0-1_amd64.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-dev_1.12.0-1_amd64.deb @@ -209,6 +239,8 @@ http://ftp.us.debian.org/debian/pool/main/x/x11proto-render/x11proto-render-dev_ http://ftp.us.debian.org/debian/pool/main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xext/x11proto-xext-dev_7.3.0-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb +http://ftp.us.debian.org/debian/pool/main/x/xft/libxft2_2.3.2-1+b2_amd64.deb +http://ftp.us.debian.org/debian/pool/main/x/xz-utils/liblzma5_5.2.2-1.2+b1_amd64.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.8.dfsg-5_amd64.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-5_amd64.deb http://security.debian.org/pool/updates/main/b/bluez/libbluetooth3_5.43-2+deb9u1_amd64.deb @@ -226,9 +258,15 @@ http://security.debian.org/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.5. http://security.debian.org/pool/updates/main/g/gnutls28/libgnutlsxx28_3.5.8-5+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6-2+deb9u2_amd64.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_amd64.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_amd64.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_amd64.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_amd64.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_amd64.deb +http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_amd64.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/n/nss/libnss3-dev_3.26.2-1.1+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.0f-3+deb9u1_amd64.deb http://security.debian.org/pool/updates/main/o/openssl/libssl-dev_1.1.0f-3+deb9u1_amd64.deb +http://security.debian.org/pool/updates/main/t/tiff/libtiff5_4.0.8-2+deb9u1_amd64.deb diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm b/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm index 3de9a8efa4d..2a9c6ebe93c 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm @@ -16,19 +16,20 @@ http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2_1.14.8-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2-dev_1.14.8-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-gobject2_1.14.8-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-script-interpreter2_1.14.8-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/c/colord/libcolord2_1.3.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2_2.2.1-8_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2-dev_2.2.1-8_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_armhf.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_armhf.deb +http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_armhf.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf-dev_0.168-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/f/flac/libflac8_1.3.2-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.7+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_2.11.0-6.7+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.6.3-3.2_armhf.deb @@ -41,11 +42,9 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libgomp1_6.3.0-18_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libubsan0_6.3.0-18_armhf.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-3_1.3.10-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-dev_1.3.10-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.31-2_armhf.deb @@ -56,6 +55,9 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_armhf http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_armhf.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.15-1+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.15-1+deb9u1_armhf.deb @@ -67,9 +69,12 @@ http://ftp.us.debian.org/debian/pool/main/k/krb5/libkdb5-8_1.15-1+deb9u1_armhf.d http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.15-1+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.15-1+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.15-1+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.8-6_armhf.deb http://ftp.us.debian.org/debian/pool/main/libb/libbsd/libbsd0_0.8.3-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap2_2.25-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap-dev_2.25-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-3+b1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libd/libdatrie/libdatrie1_0.2.10-4+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.74-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.74-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-dev_2.4.74-1_armhf.deb @@ -87,15 +92,26 @@ http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring-dev_3.12.0-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.26-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-dev_1.26-2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libi/libice/libice6_1.0.9-2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidl/libidl-2-0_0.8.14-4_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp1_1.7.4-3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp-dev_1.7.4-3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libn/libnss-db/libnss-db_2.2.3pre1-6+b1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.2-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libp/libp11/libp11-2_0.4.3-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libp/libpciaccess/libpciaccess0_0.13.4-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng16-16_1.6.28-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng-dev_1.6.28-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libp/libpthread-stubs/libpthread-stubs0-dev_0.3-4_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libr/librest/librest-0.7-0_0.8.0-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.6-3+b3_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsm/libsm6_1.2.2-1+b3_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsndfile/libsndfile1_1.0.27-3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-6/libtasn1-6_4.10-1.1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libt/libthai/libthai0_0.1.26-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.6-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva1_1.7.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-dev_1.7.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-drm1_1.7.3-2_armhf.deb @@ -104,6 +120,8 @@ http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-glx1_1.7.3-2_armhf.de http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-tpi1_1.7.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-wayland1_1.7.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-x11-1_1.7.3-2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.5-4_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbisenc2_1.3.5-4_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.4-3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-dev_1.6.4-3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-xcb1_1.6.4-3_armhf.deb @@ -121,10 +139,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-render0-dev_1.12-1_ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0_1.12-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0-dev_1.12-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_armhf.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_armhf.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_armhf.deb @@ -137,8 +154,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_armhf.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_armhf.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_armhf.deb @@ -151,6 +168,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxt/libxt-dev_1.1.5-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst6_1.2.3-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst-dev_1.2.3-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/libx/libxxf86vm/libxxf86vm1_1.1.4-1+b2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.8-4_armhf.deb +http://ftp.us.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa_13.0.6-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa-dev_13.0.6-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libgbm1_13.0.6-1+b2_armhf.deb @@ -160,8 +180,11 @@ http://ftp.us.debian.org/debian/pool/main/m/mesa/libgl1-mesa-glx_13.0.6-1+b2_arm http://ftp.us.debian.org/debian/pool/main/m/mesa/libglapi-mesa_13.0.6-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libwayland-egl1-mesa_13.0.6-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/mesa-common-dev_13.0.6-1+b2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libhogweed4_3.3-1+b2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libnettle6_3.3-1+b2_armhf.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4_4.12-6_armhf.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4-dev_4.12-6_armhf.deb +http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit-2-0_2.14.19-2+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit2_2.14.19-2+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/p/p11-kit/libp11-kit0_0.23.3-2_armhf.deb http://ftp.us.debian.org/debian/pool/main/p/pam/libpam0g_1.1.8-3.6_armhf.deb @@ -187,8 +210,15 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_armhf.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/t/tcp-wrappers/libwrap0_7.6.q-26_armhf.deb +http://ftp.us.debian.org/debian/pool/main/u/unbound/libunbound2_1.6.0-3+deb9u1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libblkid1_2.29.2-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libmount1_2.29.2-1_armhf.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libuuid1_2.29.2-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-client0_1.12.0-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-cursor0_1.12.0-1_armhf.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-dev_1.12.0-1_armhf.deb @@ -206,6 +236,8 @@ http://ftp.us.debian.org/debian/pool/main/x/x11proto-render/x11proto-render-dev_ http://ftp.us.debian.org/debian/pool/main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xext/x11proto-xext-dev_7.3.0-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb +http://ftp.us.debian.org/debian/pool/main/x/xft/libxft2_2.3.2-1+b2_armhf.deb +http://ftp.us.debian.org/debian/pool/main/x/xz-utils/liblzma5_5.2.2-1.2+b1_armhf.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.8.dfsg-5_armhf.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-5_armhf.deb http://security.debian.org/pool/updates/main/b/bluez/libbluetooth3_5.43-2+deb9u1_armhf.deb @@ -223,9 +255,15 @@ http://security.debian.org/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.5. http://security.debian.org/pool/updates/main/g/gnutls28/libgnutlsxx28_3.5.8-5+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6-2+deb9u2_armhf.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_armhf.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_armhf.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_armhf.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_armhf.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_armhf.deb +http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_armhf.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/n/nss/libnss3-dev_3.26.2-1.1+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.0f-3+deb9u1_armhf.deb http://security.debian.org/pool/updates/main/o/openssl/libssl-dev_1.1.0f-3+deb9u1_armhf.deb +http://security.debian.org/pool/updates/main/t/tiff/libtiff5_4.0.8-2+deb9u1_armhf.deb diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm64 b/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm64 index d3985f67da1..51bd50b5f9c 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm64 +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.arm64 @@ -23,10 +23,8 @@ http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_arm64.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_arm64.deb http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_arm64.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_arm64.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_arm64.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_arm64.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_arm64.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_arm64.deb @@ -45,9 +43,6 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libitm1_6.3.0-18_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libubsan0_6.3.0-18_arm64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_arm64.deb http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_arm64.deb @@ -62,7 +57,7 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_arm64 http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6_arm64.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_arm64.deb http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_arm64.deb @@ -148,8 +143,6 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_arm64. http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_arm64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_arm64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_arm64.deb @@ -162,8 +155,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_arm64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_arm64.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_arm64.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_arm64.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_arm64.deb @@ -218,7 +211,7 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_arm64.deb -http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5_arm64.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_arm64.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_arm64.deb @@ -265,6 +258,8 @@ http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6- http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_arm64.deb http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_arm64.deb http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_arm64.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_arm64.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_arm64.deb http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_arm64.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_arm64.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_arm64.deb diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.i386 b/chromium/build/linux/sysroot_scripts/packagelist.stretch.i386 index 28a2423d23f..95afc5a2b3a 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.i386 +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.i386 @@ -16,19 +16,20 @@ http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2_1.14.8-1_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2-dev_1.14.8-1_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-gobject2_1.14.8-1_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-script-interpreter2_1.14.8-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/c/colord/libcolord2_1.3.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2_2.2.1-8_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2-dev_2.2.1-8_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_i386.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_i386.deb +http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_i386.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_i386.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_i386.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_i386.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_i386.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_i386.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_i386.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_i386.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf-dev_0.168-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/f/flac/libflac8_1.3.2-1_i386.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.7+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_2.11.0-6.7+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.6.3-3.2_i386.deb @@ -45,11 +46,9 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libquadmath0_6.3.0-18_i386.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_i386.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_i386.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libubsan0_6.3.0-18_i386.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_i386.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_i386.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_i386.deb +http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_i386.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-3_1.3.10-1_i386.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-dev_1.3.10-1_i386.deb http://ftp.us.debian.org/debian/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.31-2_i386.deb @@ -60,6 +59,9 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_i386. http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_i386.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_i386.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_i386.deb +http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_i386.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_i386.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.15-1+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.15-1+deb9u1_i386.deb @@ -71,9 +73,12 @@ http://ftp.us.debian.org/debian/pool/main/k/krb5/libkdb5-8_1.15-1+deb9u1_i386.de http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.15-1+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.15-1+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.15-1+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.8-6_i386.deb http://ftp.us.debian.org/debian/pool/main/libb/libbsd/libbsd0_0.8.3-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap2_2.25-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap-dev_2.25-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-3+b1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libd/libdatrie/libdatrie1_0.2.10-4+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.74-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.74-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-dev_2.4.74-1_i386.deb @@ -88,15 +93,26 @@ http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring-dev_3.12.0-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.26-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-dev_1.26-2_i386.deb +http://ftp.us.debian.org/debian/pool/main/libi/libice/libice6_1.0.9-2_i386.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidl/libidl-2-0_0.8.14-4_i386.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp1_1.7.4-3_i386.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp-dev_1.7.4-3_i386.deb http://ftp.us.debian.org/debian/pool/main/libn/libnss-db/libnss-db_2.2.3pre1-6+b1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.2-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libp/libp11/libp11-2_0.4.3-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libp/libpciaccess/libpciaccess0_0.13.4-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng16-16_1.6.28-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng-dev_1.6.28-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libp/libpthread-stubs/libpthread-stubs0-dev_0.3-4_i386.deb +http://ftp.us.debian.org/debian/pool/main/libr/librest/librest-0.7-0_0.8.0-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.6-3+b3_i386.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsm/libsm6_1.2.2-1+b3_i386.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsndfile/libsndfile1_1.0.27-3_i386.deb http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-6/libtasn1-6_4.10-1.1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libt/libthai/libthai0_0.1.26-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.6-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva1_1.7.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-dev_1.7.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-drm1_1.7.3-2_i386.deb @@ -105,6 +121,8 @@ http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-glx1_1.7.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-tpi1_1.7.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-wayland1_1.7.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-x11-1_1.7.3-2_i386.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.5-4_i386.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbisenc2_1.3.5-4_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.4-3_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-dev_1.6.4-3_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-xcb1_1.6.4-3_i386.deb @@ -122,10 +140,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-render0-dev_1.12-1_ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0_1.12-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0-dev_1.12-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_i386.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_i386.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_i386.deb @@ -138,8 +155,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_i386.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_i386.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_i386.deb @@ -152,6 +169,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxt/libxt-dev_1.1.5-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst6_1.2.3-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst-dev_1.2.3-1_i386.deb http://ftp.us.debian.org/debian/pool/main/libx/libxxf86vm/libxxf86vm1_1.1.4-1+b2_i386.deb +http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.8-4_i386.deb +http://ftp.us.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_i386.deb +http://ftp.us.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa_13.0.6-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa-dev_13.0.6-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libgbm1_13.0.6-1+b2_i386.deb @@ -161,8 +181,11 @@ http://ftp.us.debian.org/debian/pool/main/m/mesa/libgl1-mesa-glx_13.0.6-1+b2_i38 http://ftp.us.debian.org/debian/pool/main/m/mesa/libglapi-mesa_13.0.6-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libwayland-egl1-mesa_13.0.6-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/mesa-common-dev_13.0.6-1+b2_i386.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libhogweed4_3.3-1+b2_i386.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libnettle6_3.3-1+b2_i386.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4_4.12-6_i386.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4-dev_4.12-6_i386.deb +http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit-2-0_2.14.19-2+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit2_2.14.19-2+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/p/p11-kit/libp11-kit0_0.23.3-2_i386.deb http://ftp.us.debian.org/debian/pool/main/p/pam/libpam0g_1.1.8-3.6_i386.deb @@ -188,8 +211,15 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_i386.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/t/tcp-wrappers/libwrap0_7.6.q-26_i386.deb +http://ftp.us.debian.org/debian/pool/main/u/unbound/libunbound2_1.6.0-3+deb9u1_i386.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libblkid1_2.29.2-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libmount1_2.29.2-1_i386.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libuuid1_2.29.2-1_i386.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-client0_1.12.0-1_i386.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-cursor0_1.12.0-1_i386.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-dev_1.12.0-1_i386.deb @@ -207,6 +237,8 @@ http://ftp.us.debian.org/debian/pool/main/x/x11proto-render/x11proto-render-dev_ http://ftp.us.debian.org/debian/pool/main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xext/x11proto-xext-dev_7.3.0-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb +http://ftp.us.debian.org/debian/pool/main/x/xft/libxft2_2.3.2-1+b2_i386.deb +http://ftp.us.debian.org/debian/pool/main/x/xz-utils/liblzma5_5.2.2-1.2+b1_i386.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.8.dfsg-5_i386.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-5_i386.deb http://security.debian.org/pool/updates/main/b/bluez/libbluetooth3_5.43-2+deb9u1_i386.deb @@ -224,9 +256,15 @@ http://security.debian.org/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.5. http://security.debian.org/pool/updates/main/g/gnutls28/libgnutlsxx28_3.5.8-5+deb9u1_i386.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6-2+deb9u2_i386.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_i386.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_i386.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_i386.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_i386.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_i386.deb +http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_i386.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_i386.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_i386.deb http://security.debian.org/pool/updates/main/n/nss/libnss3-dev_3.26.2-1.1+deb9u1_i386.deb http://security.debian.org/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u1_i386.deb http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.0f-3+deb9u1_i386.deb http://security.debian.org/pool/updates/main/o/openssl/libssl-dev_1.1.0f-3+deb9u1_i386.deb +http://security.debian.org/pool/updates/main/t/tiff/libtiff5_4.0.8-2+deb9u1_i386.deb diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.mips64el b/chromium/build/linux/sysroot_scripts/packagelist.stretch.mips64el index 7390896af5c..594ac066e16 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.mips64el +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.mips64el @@ -16,19 +16,20 @@ http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2_1.14.8-1_mips64el.de http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2-dev_1.14.8-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-gobject2_1.14.8-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-script-interpreter2_1.14.8-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/c/colord/libcolord2_1.3.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2_2.2.1-8_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2-dev_2.2.1-8_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_mips64el.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf-dev_0.168-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/f/flac/libflac8_1.3.2-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.7+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_2.11.0-6.7+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.6.3-3.2_mips64el.deb @@ -39,11 +40,9 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libgcc-6-dev_6.3.0-18_mips64el http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libgomp1_6.3.0-18_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-3_1.3.10-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-dev_1.3.10-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.31-2_mips64el.deb @@ -54,6 +53,9 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_mips6 http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_mips64el.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.15-1+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.15-1+deb9u1_mips64el.deb @@ -65,9 +67,12 @@ http://ftp.us.debian.org/debian/pool/main/k/krb5/libkdb5-8_1.15-1+deb9u1_mips64e http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.15-1+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.15-1+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.15-1+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.8-6_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libb/libbsd/libbsd0_0.8.3-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap2_2.25-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap-dev_2.25-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-3+b1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libd/libdatrie/libdatrie1_0.2.10-4+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.74-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.74-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-dev_2.4.74-1_mips64el.deb @@ -81,15 +86,26 @@ http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring-dev_3.12.0-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.26-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-dev_1.26-2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libi/libice/libice6_1.0.9-2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidl/libidl-2-0_0.8.14-4_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp1_1.7.4-3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp-dev_1.7.4-3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libn/libnss-db/libnss-db_2.2.3pre1-6+b1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.2-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libp/libp11/libp11-2_0.4.3-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libp/libpciaccess/libpciaccess0_0.13.4-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng16-16_1.6.28-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng-dev_1.6.28-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libp/libpthread-stubs/libpthread-stubs0-dev_0.3-4_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libr/librest/librest-0.7-0_0.8.0-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.6-3+b3_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsm/libsm6_1.2.2-1+b3_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsndfile/libsndfile1_1.0.27-3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-6/libtasn1-6_4.10-1.1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libt/libthai/libthai0_0.1.26-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.6-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva1_1.7.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-dev_1.7.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-drm1_1.7.3-2_mips64el.deb @@ -98,6 +114,8 @@ http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-glx1_1.7.3-2_mips64el http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-tpi1_1.7.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-wayland1_1.7.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-x11-1_1.7.3-2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.5-4_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbisenc2_1.3.5-4_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.4-3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-dev_1.6.4-3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-xcb1_1.6.4-3_mips64el.deb @@ -115,10 +133,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-render0-dev_1.12-1_ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0_1.12-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0-dev_1.12-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_mips64el.deb @@ -131,8 +148,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_mips64el.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_mips64el.deb @@ -145,6 +162,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxt/libxt-dev_1.1.5-1_mips64el. http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst6_1.2.3-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst-dev_1.2.3-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/libx/libxxf86vm/libxxf86vm1_1.1.4-1+b2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.8-4_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa_13.0.6-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa-dev_13.0.6-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libgbm1_13.0.6-1+b2_mips64el.deb @@ -154,8 +174,11 @@ http://ftp.us.debian.org/debian/pool/main/m/mesa/libgl1-mesa-glx_13.0.6-1+b2_mip http://ftp.us.debian.org/debian/pool/main/m/mesa/libglapi-mesa_13.0.6-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libwayland-egl1-mesa_13.0.6-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/mesa-common-dev_13.0.6-1+b2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libhogweed4_3.3-1+b2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libnettle6_3.3-1+b2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4_4.12-6_mips64el.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4-dev_4.12-6_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit-2-0_2.14.19-2+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit2_2.14.19-2+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/p/p11-kit/libp11-kit0_0.23.3-2_mips64el.deb http://ftp.us.debian.org/debian/pool/main/p/pam/libpam0g_1.1.8-3.6_mips64el.deb @@ -181,8 +204,15 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/t/tcp-wrappers/libwrap0_7.6.q-26_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/u/unbound/libunbound2_1.6.0-3+deb9u1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libblkid1_2.29.2-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libmount1_2.29.2-1_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libuuid1_2.29.2-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-client0_1.12.0-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-cursor0_1.12.0-1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-dev_1.12.0-1_mips64el.deb @@ -200,6 +230,8 @@ http://ftp.us.debian.org/debian/pool/main/x/x11proto-render/x11proto-render-dev_ http://ftp.us.debian.org/debian/pool/main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xext/x11proto-xext-dev_7.3.0-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb +http://ftp.us.debian.org/debian/pool/main/x/xft/libxft2_2.3.2-1+b2_mips64el.deb +http://ftp.us.debian.org/debian/pool/main/x/xz-utils/liblzma5_5.2.2-1.2+b1_mips64el.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.8.dfsg-5_mips64el.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-5_mips64el.deb http://security.debian.org/pool/updates/main/b/bluez/libbluetooth3_5.43-2+deb9u1_mips64el.deb @@ -217,9 +249,15 @@ http://security.debian.org/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.5. http://security.debian.org/pool/updates/main/g/gnutls28/libgnutlsxx28_3.5.8-5+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6-2+deb9u2_mips64el.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_mips64el.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_mips64el.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_mips64el.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_mips64el.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_mips64el.deb +http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_mips64el.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/n/nss/libnss3-dev_3.26.2-1.1+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.0f-3+deb9u1_mips64el.deb http://security.debian.org/pool/updates/main/o/openssl/libssl-dev_1.1.0f-3+deb9u1_mips64el.deb +http://security.debian.org/pool/updates/main/t/tiff/libtiff5_4.0.8-2+deb9u1_mips64el.deb diff --git a/chromium/build/linux/sysroot_scripts/packagelist.stretch.mipsel b/chromium/build/linux/sysroot_scripts/packagelist.stretch.mipsel index 8fd9d5b4eb1..a825f57b173 100644 --- a/chromium/build/linux/sysroot_scripts/packagelist.stretch.mipsel +++ b/chromium/build/linux/sysroot_scripts/packagelist.stretch.mipsel @@ -16,19 +16,20 @@ http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2_1.14.8-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo2-dev_1.14.8-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-gobject2_1.14.8-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cairo/libcairo-script-interpreter2_1.14.8-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/c/colord/libcolord2_1.3.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2_2.2.1-8_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcups2-dev_2.2.1-8_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2_2.2.1-8_mipsel.deb http://ftp.us.debian.org/debian/pool/main/c/cups/libcupsimage2-dev_2.2.1-8_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/d/db5.3/libdb5.3_5.3.28-12+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/d/dbus-glib/libdbus-glib-1-2_0.108-2_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.22-0+deb9u1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.22-0+deb9u1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf1_0.26.0-2+b1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/d/d-conf/libdconf-dev_0.26.0-2+b1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-3_1.10.24-0+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/d/dbus/libdbus-1-dev_1.10.24-0+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/comerr-dev_2.1-1.43.4-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.43.4-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf1_0.168-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/e/elfutils/libelf-dev_0.168-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/f/flac/libflac8_1.3.2-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.7+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1-dev_2.11.0-6.7+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.6.3-3.2_mipsel.deb @@ -39,11 +40,9 @@ http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libgcc-6-dev_6.3.0-18_mipsel.d http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libgomp1_6.3.0-18_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/gcc-6/libstdc++-6-dev_6.3.0-18_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-4_3.2.6-4+b1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf-2-4_3.2.6-4+b1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/g/gconf/libgconf2-dev_3.2.6-4+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.50.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/glib2.0/libglib2.0-dev_2.50.3-2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/g/gmp/libgmp10_6.1.2+dfsg-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-3_1.3.10-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/graphite2/libgraphite2-dev_1.3.10-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.31-2_mipsel.deb @@ -54,6 +53,9 @@ http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz0b_1.4.2-1_mipse http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-dev_1.4.2-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-gobject0_1.4.2-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/h/harfbuzz/libharfbuzz-icu0_1.4.2-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/j/jbigkit/libjbig0_2.1-3.1+b2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/j/json-glib/libjson-glib-1.0-0_1.2.6-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.5.9-9_mipsel.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.15-1+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.15-1+deb9u1_mipsel.deb @@ -65,9 +67,12 @@ http://ftp.us.debian.org/debian/pool/main/k/krb5/libkdb5-8_1.15-1+deb9u1_mipsel. http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.15-1+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.15-1+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.15-1+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.8-6_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libb/libbsd/libbsd0_0.8.3-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap2_2.25-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libc/libcap2/libcap-dev_2.25-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libc/libcap-ng/libcap-ng0_0.7.7-3+b1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libd/libdatrie/libdatrie1_0.2.10-4+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm2_2.4.74-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.74-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libd/libdrm/libdrm-dev_2.4.74-1_mipsel.deb @@ -81,15 +86,26 @@ http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring http://ftp.us.debian.org/debian/pool/main/libg/libgnome-keyring/libgnome-keyring-dev_3.12.0-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.26-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error-dev_1.26-2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libi/libice/libice6_1.0.9-2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidl/libidl-2-0_0.8.14-4_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp1_1.7.4-3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp-dev_1.7.4-3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libn/libnss-db/libnss-db_2.2.3pre1-6+b1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libo/libogg/libogg0_1.3.2-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libp/libp11/libp11-2_0.4.3-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libp/libpciaccess/libpciaccess0_0.13.4-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng16-16_1.6.28-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libp/libpng1.6/libpng-dev_1.6.28-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libp/libpthread-stubs/libpthread-stubs0-dev_0.3-4_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libr/librest/librest-0.7-0_0.8.0-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.6-3+b3_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsm/libsm6_1.2.2-1+b3_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libs/libsndfile/libsndfile1_1.0.27-3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libt/libtasn1-6/libtasn1-6_4.10-1.1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libt/libthai/libthai0_0.1.26-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libt/libtool/libltdl7_2.4.6-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva1_1.7.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-dev_1.7.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-drm1_1.7.3-2_mipsel.deb @@ -98,6 +114,8 @@ http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-glx1_1.7.3-2_mipsel.d http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-tpi1_1.7.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-wayland1_1.7.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libv/libva/libva-x11-1_1.7.3-2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.3.5-4_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libv/libvorbis/libvorbisenc2_1.3.5-4_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.4-3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-dev_1.6.4-3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libx11/libx11-xcb1_1.6.4-3_mipsel.deb @@ -115,10 +133,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-render0-dev_1.12-1_ http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0_1.12-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-shm0-dev_1.12-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-sync1_1.12-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxcb/libxcb-xfixes0_1.12-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite1_0.4.4-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxcomposite/libxcomposite-dev_0.4.4-2_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor1_1.1.14-1+b4_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxcursor/libxcursor-dev_1.1.14-1+b4_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage1_1.1.4-2+b3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdamage/libxdamage-dev_1.1.4-2+b3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxdmcp/libxdmcp6_1.1.2-3_mipsel.deb @@ -131,8 +148,8 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi6_1.7.9-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxi/libxi-dev_1.7.9-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama1_1.1.3-1+b3_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.1.3-1+b3_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-1_mipsel.deb -http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon0_0.7.1-2~deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.7.1-2~deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr2_1.5.1-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrandr/libxrandr-dev_1.5.1-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxrender/libxrender1_0.9.10-1_mipsel.deb @@ -145,6 +162,9 @@ http://ftp.us.debian.org/debian/pool/main/libx/libxt/libxt-dev_1.1.5-1_mipsel.de http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst6_1.2.3-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxtst/libxtst-dev_1.2.3-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/libx/libxxf86vm/libxxf86vm1_1.1.4-1+b2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.8-4_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa_13.0.6-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libegl1-mesa-dev_13.0.6-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libgbm1_13.0.6-1+b2_mipsel.deb @@ -154,8 +174,11 @@ http://ftp.us.debian.org/debian/pool/main/m/mesa/libgl1-mesa-glx_13.0.6-1+b2_mip http://ftp.us.debian.org/debian/pool/main/m/mesa/libglapi-mesa_13.0.6-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/libwayland-egl1-mesa_13.0.6-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/m/mesa/mesa-common-dev_13.0.6-1+b2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libhogweed4_3.3-1+b2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/n/nettle/libnettle6_3.3-1+b2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4_4.12-6_mipsel.deb http://ftp.us.debian.org/debian/pool/main/n/nspr/libnspr4-dev_4.12-6_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit-2-0_2.14.19-2+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/o/orbit2/liborbit2_2.14.19-2+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/p/p11-kit/libp11-kit0_0.23.3-2_mipsel.deb http://ftp.us.debian.org/debian/pool/main/p/pam/libpam0g_1.1.8-3.6_mipsel.deb @@ -181,8 +204,15 @@ http://ftp.us.debian.org/debian/pool/main/p/pulseaudio/libpulse-mainloop-glib0_1 http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd2_0.8.6-4+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/libspeechd-dev_0.8.6-4+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.8.6-4+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_3.16.2-5+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/s/systemd/libsystemd0_232-25+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev1_232-25+deb9u1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/s/systemd/libudev-dev_232-25+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/t/tcp-wrappers/libwrap0_7.6.q-26_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/u/unbound/libunbound2_1.6.0-3+deb9u1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libblkid1_2.29.2-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libmount1_2.29.2-1_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/u/util-linux/libuuid1_2.29.2-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-client0_1.12.0-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-cursor0_1.12.0-1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/w/wayland/libwayland-dev_1.12.0-1_mipsel.deb @@ -200,6 +230,8 @@ http://ftp.us.debian.org/debian/pool/main/x/x11proto-render/x11proto-render-dev_ http://ftp.us.debian.org/debian/pool/main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xext/x11proto-xext-dev_7.3.0-1_all.deb http://ftp.us.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb +http://ftp.us.debian.org/debian/pool/main/x/xft/libxft2_2.3.2-1+b2_mipsel.deb +http://ftp.us.debian.org/debian/pool/main/x/xz-utils/liblzma5_5.2.2-1.2+b1_mipsel.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.8.dfsg-5_mipsel.deb http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-5_mipsel.deb http://security.debian.org/pool/updates/main/b/bluez/libbluetooth3_5.43-2+deb9u1_mipsel.deb @@ -217,9 +249,15 @@ http://security.debian.org/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.5. http://security.debian.org/pool/updates/main/g/gnutls28/libgnutlsxx28_3.5.8-5+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20_1.7.6-2+deb9u2_mipsel.deb http://security.debian.org/pool/updates/main/libg/libgcrypt20/libgcrypt20-dev_1.7.6-2+deb9u2_mipsel.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup2.4-1_2.56.0-2+deb9u1_mipsel.deb +http://security.debian.org/pool/updates/main/libs/libsoup2.4/libsoup-gnome2.4-1_2.56.0-2+deb9u1_mipsel.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor1_1.1.14-1+deb9u1_mipsel.deb +http://security.debian.org/pool/updates/main/libx/libxcursor/libxcursor-dev_1.1.14-1+deb9u1_mipsel.deb +http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/l/linux/linux-libc-dev_4.9.30-2+deb9u5_mipsel.deb http://security.debian.org/pool/updates/main/n/nss/libnss3_3.26.2-1.1+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/n/nss/libnss3-dev_3.26.2-1.1+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2l-2+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/o/openssl/libssl1.1_1.1.0f-3+deb9u1_mipsel.deb http://security.debian.org/pool/updates/main/o/openssl/libssl-dev_1.1.0f-3+deb9u1_mipsel.deb +http://security.debian.org/pool/updates/main/t/tiff/libtiff5_4.0.8-2+deb9u1_mipsel.deb diff --git a/chromium/build/linux/sysroot_scripts/sysroot-creator-stretch.sh b/chromium/build/linux/sysroot_scripts/sysroot-creator-stretch.sh index a0e50aba540..077abd54ea4 100755 --- a/chromium/build/linux/sysroot_scripts/sysroot-creator-stretch.sh +++ b/chromium/build/linux/sysroot_scripts/sysroot-creator-stretch.sh @@ -72,8 +72,6 @@ DEBIAN_PACKAGES="\ libdbus-1-3 libdbus-1-dev libdbus-glib-1-2 - libdconf-dev - libdconf1 libdrm-amdgpu1 libdrm-dev libdrm-nouveau2 @@ -98,9 +96,6 @@ DEBIAN_PACKAGES="\ libgbm1 libgcc-6-dev libgcc1 - libgconf-2-4 - libgconf2-4 - libgconf2-dev libgcrypt20 libgcrypt20-dev libgdk-pixbuf2.0-0 diff --git a/chromium/build/linux/unbundle/fontconfig.gn b/chromium/build/linux/unbundle/fontconfig.gn new file mode 100644 index 00000000000..c1e229854be --- /dev/null +++ b/chromium/build/linux/unbundle/fontconfig.gn @@ -0,0 +1,13 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_linux) + +config("fontconfig_config") { + libs = [ "fontconfig" ] +} + +group("fontconfig") { + public_configs = [ ":fontconfig_config" ] +} diff --git a/chromium/build/linux/unbundle/freetype.gn b/chromium/build/linux/unbundle/freetype.gn index 0d80fd7f9cf..cafa9db6b7f 100644 --- a/chromium/build/linux/unbundle/freetype.gn +++ b/chromium/build/linux/unbundle/freetype.gn @@ -2,124 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/linux/pkg_config.gni") -import("//build/shim_headers.gni") - -pkg_config("freetype_config") { - packages = [ "freetype2" ] -} - -shim_headers("freetype_shim") { - root_path = "src/include" - headers = [ - # This list can easily be updated using the command below: - # find third_party/freetype/src/include \ - # -iname '*.h' -printf '"%p",\n' | \ - # sed -e 's|third_party/freetype/src/include/||' | sort -u - "freetype/config/ftconfig.h", - "freetype/config/ftheader.h", - "freetype/config/ftmodule.h", - "freetype/config/ftoption.h", - "freetype/config/ftstdlib.h", - "freetype/freetype.h", - "freetype/ftadvanc.h", - "freetype/ftautoh.h", - "freetype/ftbbox.h", - "freetype/ftbdf.h", - "freetype/ftbitmap.h", - "freetype/ftbzip2.h", - "freetype/ftcache.h", - "freetype/ftcffdrv.h", - "freetype/ftchapters.h", - "freetype/ftcid.h", - "freetype/fterrdef.h", - "freetype/fterrors.h", - "freetype/ftfntfmt.h", - "freetype/ftgasp.h", - "freetype/ftglyph.h", - "freetype/ftgxval.h", - "freetype/ftgzip.h", - "freetype/ftimage.h", - "freetype/ftincrem.h", - "freetype/ftlcdfil.h", - "freetype/ftlist.h", - "freetype/ftlzw.h", - "freetype/ftmac.h", - "freetype/ftmm.h", - "freetype/ftmodapi.h", - "freetype/ftmoderr.h", - "freetype/ftotval.h", - "freetype/ftoutln.h", - "freetype/ftpcfdrv.h", - "freetype/ftpfr.h", - "freetype/ftrender.h", - "freetype/ftsizes.h", - "freetype/ftsnames.h", - "freetype/ftstroke.h", - "freetype/ftsynth.h", - "freetype/ftsystem.h", - "freetype/fttrigon.h", - "freetype/ftttdrv.h", - "freetype/fttypes.h", - "freetype/ftwinfnt.h", - "freetype/internal/autohint.h", - "freetype/internal/ftcalc.h", - "freetype/internal/ftdebug.h", - "freetype/internal/ftdriver.h", - "freetype/internal/ftgloadr.h", - "freetype/internal/fthash.h", - "freetype/internal/ftmemory.h", - "freetype/internal/ftobjs.h", - "freetype/internal/ftpic.h", - "freetype/internal/ftrfork.h", - "freetype/internal/ftserv.h", - "freetype/internal/ftstream.h", - "freetype/internal/fttrace.h", - "freetype/internal/ftvalid.h", - "freetype/internal/internal.h", - "freetype/internal/psaux.h", - "freetype/internal/pshints.h", - "freetype/internal/services/svbdf.h", - "freetype/internal/services/svcid.h", - "freetype/internal/services/svfntfmt.h", - "freetype/internal/services/svgldict.h", - "freetype/internal/services/svgxval.h", - "freetype/internal/services/svkern.h", - "freetype/internal/services/svmetric.h", - "freetype/internal/services/svmm.h", - "freetype/internal/services/svotval.h", - "freetype/internal/services/svpfr.h", - "freetype/internal/services/svpostnm.h", - "freetype/internal/services/svprop.h", - "freetype/internal/services/svpscmap.h", - "freetype/internal/services/svpsinfo.h", - "freetype/internal/services/svsfnt.h", - "freetype/internal/services/svttcmap.h", - "freetype/internal/services/svtteng.h", - "freetype/internal/services/svttglyf.h", - "freetype/internal/services/svwinfnt.h", - "freetype/internal/sfnt.h", - "freetype/internal/t1types.h", - "freetype/internal/tttypes.h", - "freetype/t1tables.h", - "freetype/ttnameid.h", - "freetype/tttables.h", - "freetype/tttags.h", - "freetype/ttunpat.h", - "ft2build.h", - ] -} - -source_set("freetype") { - deps = [ - ":freetype_shim", - ] - public_configs = [ ":freetype_config" ] -} - -source_set("bootstrap_freetype_for_harfbuzz") { - deps = [ - ":freetype_shim", - ] - public_configs = [ ":freetype_config" ] +declare_args() { + # Blink needs a recent and properly build-configured FreeType version to + # support OpenType variations, color emoji and avoid security bugs. By default + # we ship and link such a version as part of Chrome. For distributions that + # prefer to keep linking to the version the system, FreeType must be newer + # than version 2.7.1 and have color bitmap support compiled in. WARNING: + # System FreeType configurations other than as described WILL INTRODUCE TEXT + # RENDERING AND SECURITY REGRESSIONS. + use_system_freetype = true } diff --git a/chromium/build/linux/unbundle/harfbuzz-ng.gn b/chromium/build/linux/unbundle/harfbuzz-ng.gn index 5c422db1034..b4ba17a9b83 100644 --- a/chromium/build/linux/unbundle/harfbuzz-ng.gn +++ b/chromium/build/linux/unbundle/harfbuzz-ng.gn @@ -1,42 +1,13 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. +# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/linux/pkg_config.gni") -import("//build/shim_headers.gni") - -pkg_config("system_harfbuzz") { - packages = [ - "harfbuzz", - "harfbuzz-icu", - ] -} - -shim_headers("harfbuzz_shim") { - root_path = "src" - headers = [ "hb.h" ] -} - -group("harfbuzz-ng") { - public_deps = [ - ":harfbuzz-ng-ft", - ":harfbuzz-ng-without-freetype", - ] -} - -source_set("harfbuzz-ng-ft") { - deps = [ - ":harfbuzz_shim", - ] - public_configs = [ ":system_harfbuzz" ] -} - -source_set("harfbuzz-ng-without-freetype") { - deps = [ - ":harfbuzz_shim", - ] - public_configs = [ ":system_harfbuzz" ] -} - -config("pangoft2_link_hack") { +declare_args() { + # Blink uses a cutting-edge version of Harfbuzz (version listed in + # third_party/harfbuzz-ng/README.chromium); most Linux distros do not contain + # a new enough version of the code to work correctly. However, ChromeOS + # chroots (i.e. real ChromeOS builds for devices) do contain a new enough + # version of the library, and so this variable exists so that ChromeOS can + # build against the system lib and keep binary sizes smaller. + use_system_harfbuzz = true } diff --git a/chromium/build/linux/unbundle/replace_gn_files.py b/chromium/build/linux/unbundle/replace_gn_files.py index c5f592d324a..76b79c46e50 100755 --- a/chromium/build/linux/unbundle/replace_gn_files.py +++ b/chromium/build/linux/unbundle/replace_gn_files.py @@ -19,8 +19,9 @@ import sys REPLACEMENTS = { 'ffmpeg': 'third_party/ffmpeg/BUILD.gn', 'flac': 'third_party/flac/BUILD.gn', - 'freetype': 'third_party/freetype/BUILD.gn', - 'harfbuzz-ng': 'third_party/harfbuzz-ng/BUILD.gn', + 'fontconfig': 'third_party/fontconfig/BUILD.gn', + 'freetype': 'build/config/freetype/freetype.gni', + 'harfbuzz-ng': 'third_party/harfbuzz-ng/harfbuzz.gni', 'icu': 'third_party/icu/BUILD.gn', 'libdrm': 'third_party/libdrm/BUILD.gn', 'libevent': 'base/third_party/libevent/BUILD.gn', diff --git a/chromium/build/mac_toolchain.py b/chromium/build/mac_toolchain.py index 1bd4fd743f9..78871afa6df 100755 --- a/chromium/build/mac_toolchain.py +++ b/chromium/build/mac_toolchain.py @@ -37,7 +37,7 @@ MAC_TOOLCHAIN_VERSION = '%s-%s' % (MAC_TOOLCHAIN_VERSION, # 16 is the major version number for macOS 10.12. MAC_MINIMUM_OS_VERSION = 16 -IOS_TOOLCHAIN_VERSION = '9B55' +IOS_TOOLCHAIN_VERSION = '9C40b' IOS_TOOLCHAIN_SUB_REVISION = 1 IOS_TOOLCHAIN_VERSION = '%s-%s' % (IOS_TOOLCHAIN_VERSION, IOS_TOOLCHAIN_SUB_REVISION) diff --git a/chromium/build/sanitizers/lsan_suppressions.cc b/chromium/build/sanitizers/lsan_suppressions.cc index 21dd01f5106..d54f4e0bb5b 100644 --- a/chromium/build/sanitizers/lsan_suppressions.cc +++ b/chromium/build/sanitizers/lsan_suppressions.cc @@ -87,12 +87,16 @@ char kLSanDefaultSuppressions[] = // http://crbug.com/356306 "leak:service_manager::SetProcessTitleFromCommandLine\n" - // http://crbug.com/601435 - "leak:mojo/edk/js/handle.h\n" - // https://crbug.com/755670 "leak:third_party/yasm/\n" + // v8 leaks caused by weak ref not call + "leak:blink::DOMWrapperWorld::Create\n" + "leak:blink::ScriptState::Create\n" + + // https://crbug.com/795148 + "leak:third_party/fontconfig/\n" + // PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS. // End of suppressions. diff --git a/chromium/build/sanitizers/tsan_suppressions.cc b/chromium/build/sanitizers/tsan_suppressions.cc index be1830a25b8..3580dbbc93b 100644 --- a/chromium/build/sanitizers/tsan_suppressions.cc +++ b/chromium/build/sanitizers/tsan_suppressions.cc @@ -15,9 +15,11 @@ // See http://dev.chromium.org/developers/testing/threadsanitizer-tsan-v2 // for the instructions on writing suppressions. char kTSanDefaultSuppressions[] = - // False positives in libflashplayer.so and libglib.so. Since we don't - // instrument them, we cannot reason about the synchronization in them. + // False positives in libflashplayer.so, libgio.so and libglib.so. + // Since we don't instrument them, we cannot reason about the + // synchronization in them. "race:libflashplayer.so\n" + "race:libgio*.so\n" "race:libglib*.so\n" // Intentional race in ToolsSanityTest.DataRace in base_unittests. @@ -251,6 +253,12 @@ char kTSanDefaultSuppressions[] = "race:base::i18n::IsRTL\n" "race:base::i18n::SetICUDefaultLocale\n" + // http://crbug.com/795110 + "race:third_party/fontconfig/*\n" + + // http://crbug.com/797998 + "race:content::SandboxIPCHandler::HandleLocaltime\n" + // "race:third_party/harfbuzz-ng/src/*\n" diff --git a/chromium/build/secondary/third_party/android_platform/development/scripts/BUILD.gn b/chromium/build/secondary/third_party/android_platform/development/scripts/BUILD.gn index 2ac12d793d9..6de67e87e21 100644 --- a/chromium/build/secondary/third_party/android_platform/development/scripts/BUILD.gn +++ b/chromium/build/secondary/third_party/android_platform/development/scripts/BUILD.gn @@ -14,8 +14,7 @@ group("stack_py") { data = sources data += [ - "${android_tool_prefix}addr2line", - "${android_tool_prefix}objdump", - "${android_tool_prefix}c++filt", + "//third_party/android_platform/development/scripts/stack", + "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer", ] } diff --git a/chromium/build/secondary/third_party/android_platform/development/scripts/stack.pydeps b/chromium/build/secondary/third_party/android_platform/development/scripts/stack.pydeps index 2f46729e768..82d4f074170 100644 --- a/chromium/build/secondary/third_party/android_platform/development/scripts/stack.pydeps +++ b/chromium/build/secondary/third_party/android_platform/development/scripts/stack.pydeps @@ -1,9 +1,10 @@ # Generated by running: -# build/print_python_deps.py --root third_party/android_platform/development/scripts --output build/secondary/third_party/android_platform/development/scripts/stack.pydeps third_party/android_platform/development/scripts/stack +# build/print_python_deps.py --root third_party/android_platform/development/scripts --output build/secondary/third_party/android_platform/development/scripts/stack.pydeps third_party/android_platform/development/scripts/stack.py ../../../../build/android/pylib/__init__.py ../../../../build/android/pylib/constants/__init__.py ../../../../build/android/pylib/symbols/__init__.py ../../../../build/android/pylib/symbols/elf_symbolizer.py +../../../../tools/python/llvm_symbolizer.py ../../../catapult/devil/devil/__init__.py ../../../catapult/devil/devil/android/__init__.py ../../../catapult/devil/devil/android/constants/__init__.py @@ -13,7 +14,7 @@ ../../../catapult/devil/devil/android/sdk/version_codes.py ../../../catapult/devil/devil/constants/__init__.py ../../../catapult/devil/devil/constants/exit_codes.py -stack +stack.py stack_core.py stack_libs.py symbol.py diff --git a/chromium/build/toolchain/concurrent_links.gni b/chromium/build/toolchain/concurrent_links.gni index c6badbf68f1..6962c46bb3d 100644 --- a/chromium/build/toolchain/concurrent_links.gni +++ b/chromium/build/toolchain/concurrent_links.gni @@ -25,7 +25,7 @@ if (concurrent_links == -1) { "--mem_per_link_gb=10", "--reserve_mem_gb=10", ] - } else if (use_sanitizer_coverage) { + } else if (use_sanitizer_coverage || use_fuzzing_engine) { # Sanitizer coverage instrumentation increases linker memory consumption # significantly. _args = [ "--mem_per_link_gb=16" ] diff --git a/chromium/build/toolchain/fuchsia/BUILD.gn b/chromium/build/toolchain/fuchsia/BUILD.gn index 6614a31b837..a0a84f399ee 100644 --- a/chromium/build/toolchain/fuchsia/BUILD.gn +++ b/chromium/build/toolchain/fuchsia/BUILD.gn @@ -13,7 +13,10 @@ template("fuchsia_clang_toolchain") { assert(defined(invoker.toolchain_args), "toolchain_args must be defined for fuchsia_clang_toolchain()") - strip = rebase_path("//third_party/eu-strip/bin/eu-strip", root_build_dir) + # TODO(fuchsia): eu-strip defaults to removing all symbols, preventing back- + # traces from being symbolized. Reinstate this for production builds, or + # perhaps configure it to only strip debug symbols (crbug.com/792521). + #strip = rebase_path("//third_party/eu-strip/bin/eu-strip", root_build_dir) toolchain_args = invoker.toolchain_args toolchain_args.current_os = "fuchsia" diff --git a/chromium/build/toolchain/gcc_toolchain.gni b/chromium/build/toolchain/gcc_toolchain.gni index 74b2529709a..be2d29e0e50 100644 --- a/chromium/build/toolchain/gcc_toolchain.gni +++ b/chromium/build/toolchain/gcc_toolchain.gni @@ -402,7 +402,11 @@ template("gcc_toolchain") { rebase_path("//build/toolchain/gcc_solink_wrapper.py", root_build_dir) command = "$python_path \"$solink_wrapper\" --readelf=\"$readelf\" --nm=\"$nm\" $strip_switch--sofile=\"$unstripped_sofile\" --tocfile=\"$tocfile\"$map_switch --output=\"$sofile\"$whitelist_flag -- $link_command" - rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" + if (target_cpu == "mipsel" && is_component_build && is_android) { + rspfile_content = "-Wl,--start-group -Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix -Wl,--end-group" + } else { + rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" + } description = "SOLINK $sofile" diff --git a/chromium/build/toolchain/mac/BUILD.gn b/chromium/build/toolchain/mac/BUILD.gn index fc113d6a32c..f66bca0ea2c 100644 --- a/chromium/build/toolchain/mac/BUILD.gn +++ b/chromium/build/toolchain/mac/BUILD.gn @@ -126,22 +126,11 @@ template("mac_toolchain") { ld = _cxx if (use_clang_static_analyzer) { - # Static analysis isn't supported under GOMA. See crbug.com/687245 - # for progress on this issue. - assert(!use_goma, "'use_clang_static_analyzer' cannot be used with GOMA.") - - # Call "ccc-analyzer" or "c++-analyzer" instead of directly calling Clang. - # |wrapper_tool| sets the environment variables which are read by the - # analyzer tools. analyzer_wrapper = rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py", - root_build_dir) - cc = analyzer_wrapper + " --clang-cc-path=${cc} --analyzer=" + - rebase_path("//third_party/scan-build/src/libexec/ccc-analyzer", - root_build_dir) - cxx = analyzer_wrapper + " --clang-cxx-path=${cxx} --analyzer=" + - rebase_path("//third_party/scan-build/src/libexec/c++-analyzer", - root_build_dir) + root_build_dir) + " --mode=clang" + cc = analyzer_wrapper + " ${cc}" + cxx = analyzer_wrapper + " ${cxx}" ld = cxx } diff --git a/chromium/build/toolchain/toolchain.gni b/chromium/build/toolchain/toolchain.gni index ebb98fe416a..949aa09f4be 100644 --- a/chromium/build/toolchain/toolchain.gni +++ b/chromium/build/toolchain/toolchain.gni @@ -48,7 +48,12 @@ hermetic_xcode_path = declare_args() { if (is_clang) { # Clang compiler version. Clang files are placed at version-dependent paths. - clang_version = "6.0.0" + if (llvm_force_head_revision) { + clang_version = "7.0.0" + } else { + # TODO(hans): Trunk was updated; remove after the next roll. + clang_version = "6.0.0" + } } } diff --git a/chromium/build/toolchain/win/BUILD.gn b/chromium/build/toolchain/win/BUILD.gn index 22054716fb1..df1a50fcffb 100644 --- a/chromium/build/toolchain/win/BUILD.gn +++ b/chromium/build/toolchain/win/BUILD.gn @@ -163,37 +163,35 @@ template("msvc_toolchain") { } tool("cc") { - rspfile = "{{output}}.rsp" precompiled_header_type = "msvc" pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" # Label names may have spaces in them so the pdbname must be quoted. The # source and output don't need to be quoted because GN knows they're a # full file name and will quote automatically when necessary. - command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" depsformat = "msvc" description = "CC {{output}}" outputs = [ "$object_subdir/{{source_name_part}}.obj", ] - rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" + + command = "$env_wrapper$cl /nologo /showIncludes ${clflags} $sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" } tool("cxx") { - rspfile = "{{output}}.rsp" precompiled_header_type = "msvc" # The PDB name needs to be different between C and C++ compiled files. pdbname = "{{target_out_dir}}/{{label_name}}_cc.pdb" # See comment in CC tool about quoting. - command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" depsformat = "msvc" description = "CXX {{output}}" outputs = [ "$object_subdir/{{source_name_part}}.obj", ] - rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" + + command = "$env_wrapper$cl /nologo /showIncludes ${clflags} $sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" } tool("rc") { diff --git a/chromium/build/toolchain/win/midl.gni b/chromium/build/toolchain/win/midl.gni index c89cd5628ab..9ff29c676bd 100644 --- a/chromium/build/toolchain/win/midl.gni +++ b/chromium/build/toolchain/win/midl.gni @@ -14,6 +14,10 @@ import("//build/config/win/visual_studio_version.gni") # sources # List of .idl file to process. # +# header_file (optional) +# File name of generated header file. Defaults to the basename of the +# source idl file with a .h extension. +# # out_dir (optional) # Directory to write the generated files to. Defaults to target_gen_dir. # @@ -41,7 +45,12 @@ template("midl") { dynamic_guid = "none" } - header_file = "{{source_name_part}}.h" + if (defined(invoker.header_file)) { + header_file = invoker.header_file + } else { + header_file = "{{source_name_part}}.h" + } + dlldata_file = "{{source_name_part}}.dlldata.c" interface_identifier_file = "{{source_name_part}}_i.c" proxy_file = "{{source_name_part}}_p.c" diff --git a/chromium/build/util/LASTCHANGE b/chromium/build/util/LASTCHANGE index 49bef8a47a8..fab4362c3d9 100644 --- a/chromium/build/util/LASTCHANGE +++ b/chromium/build/util/LASTCHANGE @@ -1 +1 @@ -LASTCHANGE=b96cd628721966f90d3a0a978e88fdbfb92aaff3- +LASTCHANGE=31566ac6591be7f470f68e5aefda035c36058ddc- diff --git a/chromium/build/util/lib/common/chrome_test_server_spawner.py b/chromium/build/util/lib/common/chrome_test_server_spawner.py index d23db0e43e7..3cbcde170c2 100644 --- a/chromium/build/util/lib/common/chrome_test_server_spawner.py +++ b/chromium/build/util/lib/common/chrome_test_server_spawner.py @@ -115,9 +115,11 @@ class TestServerThread(threading.Thread): self.test_server_process = None self.is_ready = False self.host_port = self.arguments['port'] + self.host_ocsp_port = 0 assert isinstance(self.host_port, int) # The forwarder device port now is dynamically allocated. self.forwarder_device_port = 0 + self.forwarder_ocsp_device_port = 0 # Anonymous pipe in order to get port info from test server. self.pipe_in = None self.pipe_out = None @@ -152,18 +154,29 @@ class TestServerThread(threading.Thread): if not data_length: logging.error('Failed to get length of server data.') return False - port_json = os.read(self.pipe_in, data_length) - if not port_json: + server_data_json = os.read(self.pipe_in, data_length) + if not server_data_json: logging.error('Failed to get server data.') return False - logging.info('Got port json data: %s', port_json) - port_json = json.loads(port_json) + logging.info('Got port json data: %s', server_data_json) - if not port_json.has_key('port') or not isinstance(port_json['port'], int): + parsed_server_data = None + try: + parsed_server_data = json.loads(server_data_json) + except ValueError: + pass + + if not isinstance(parsed_server_data, dict): + logging.error('Failed to parse server_data: %s' % server_data_json) + return False + + if not isinstance(parsed_server_data.get('port'), int): logging.error('Failed to get port information from the server data.') return False - self.host_port = port_json['port'] + self.host_port = parsed_server_data['port'] + self.host_ocsp_port = parsed_server_data.get('ocsp_port', 0) + return self.port_forwarder.WaitPortNotAvailable(self.host_port) def _GenerateCommandLineArguments(self): @@ -240,15 +253,23 @@ class TestServerThread(threading.Thread): self.is_ready = self._WaitToStartAndGetPortFromTestServer() else: self.is_ready = self.port_forwarder.WaitPortNotAvailable(self.host_port) + if self.is_ready: - self.port_forwarder.Map([(0, self.host_port)]) + port_map = [(0, self.host_port)] + if self.host_ocsp_port: + port_map.append([(0, self.host_ocsp_port)]) + self.port_forwarder.Map(port_map) + + self.forwarder_device_port = \ + self.port_forwarder.GetDevicePortForHostPort(self.host_port) + if self.host_ocsp_port: + self.forwarder_ocsp_device_port = \ + self.port_forwarder.GetDevicePortForHostPort(self.host_ocsp_port) # Check whether the forwarder is ready on the device. - self.is_ready = False - device_port = self.port_forwarder.GetDevicePortForHostPort(self.host_port) - if device_port and self.port_forwarder.WaitDevicePortReady(device_port): - self.is_ready = True - self.forwarder_device_port = device_port + self.is_ready = self.forwarder_device_port and \ + self.port_forwarder.WaitDevicePortReady(self.forwarder_device_port) + # Wake up the request handler thread. self.ready_event.set() # Keep thread running until Stop() gets called. @@ -332,9 +353,11 @@ class SpawningServerRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): new_server.start() ready_event.wait() if new_server.is_ready: - self._SendResponse(200, 'OK', {}, json.dumps( - {'port': new_server.forwarder_device_port, - 'message': 'started'})) + response = {'port': new_server.forwarder_device_port, + 'message': 'started'}; + if new_server.forwarder_ocsp_device_port: + response['ocsp_port'] = new_server.forwarder_ocsp_device_port + self._SendResponse(200, 'OK', {}, json.dumps(response)) logging.info('Test server is running on port %d forwarded to %d.' % (new_server.forwarder_device_port, new_server.host_port)) port = new_server.forwarder_device_port diff --git a/chromium/build/util/lib/common/unittest_util.py b/chromium/build/util/lib/common/unittest_util.py index 010252b28eb..9683ab717a8 100644 --- a/chromium/build/util/lib/common/unittest_util.py +++ b/chromium/build/util/lib/common/unittest_util.py @@ -5,6 +5,7 @@ """Utilities for dealing with the python unittest module.""" import fnmatch +import re import sys import unittest @@ -136,13 +137,18 @@ def FilterTestNames(all_tests, gtest_filter): if len(pattern_groups) > 1: negative_patterns = pattern_groups[1].split(':') + neg_pats = None + if negative_patterns: + neg_pats = re.compile('|'.join(fnmatch.translate(p) for p in + negative_patterns)) + tests = [] test_set = set() for pattern in positive_patterns: pattern_tests = [ test for test in all_tests if (fnmatch.fnmatch(test, pattern) - and not any(fnmatch.fnmatch(test, p) for p in negative_patterns) + and not (neg_pats and neg_pats.match(test)) and test not in test_set)] tests.extend(pattern_tests) test_set.update(pattern_tests) diff --git a/chromium/build/vs_toolchain.py b/chromium/build/vs_toolchain.py index 7a258ed1dac..0a54e113f30 100755 --- a/chromium/build/vs_toolchain.py +++ b/chromium/build/vs_toolchain.py @@ -140,7 +140,6 @@ def DetectVisualStudioPath(): # build/toolchain/win/setup_toolchain.py as well. version_as_year = GetVisualStudioVersion() year_to_version = { - '2015': '14.0', '2017': '15.0', } if version_as_year not in year_to_version: @@ -160,15 +159,6 @@ def DetectVisualStudioPath(): r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community'): if path and os.path.exists(path): return path - else: - keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, - r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version] - for key in keys: - path = _RegistryGetValue(key, 'InstallDir') - if not path: - continue - path = os.path.normpath(os.path.join(path, '..', '..')) - return path raise Exception(('Visual Studio Version %s (from GYP_MSVS_VERSION)' ' not found.') % (version_as_year)) @@ -204,11 +194,11 @@ def _CopyUCRTRuntime(target_dir, source_dir, target_cpu, dll_pattern, suffix): target = os.path.join(target_dir, dll) source = os.path.join(source_dir, dll) _CopyRuntimeImpl(target, source) - # Copy the UCRT files needed by VS 2015 from the Windows SDK. This location - # includes the api-ms-win-crt-*.dll files that are not found in the Windows - # directory. These files are needed for component builds. - # If WINDOWSSDKDIR is not set use the default SDK path. This will be the case - # when DEPOT_TOOLS_WIN_TOOLCHAIN=0 and vcvarsall.bat has not been run. + # Copy the UCRT files from the Windows SDK. This location includes the + # api-ms-win-crt-*.dll files that are not found in the Windows directory. + # These files are needed for component builds. If WINDOWSSDKDIR is not set + # use the default SDK path. This will be the case when + # DEPOT_TOOLS_WIN_TOOLCHAIN=0 and vcvarsall.bat has not been run. win_sdk_dir = os.path.normpath( os.environ.get('WINDOWSSDKDIR', 'C:\\Program Files (x86)\\Windows Kits\\10')) @@ -253,11 +243,7 @@ def _CopyPGORuntime(target_dir, target_cpu): env_version = GetVisualStudioVersion() # These dependencies will be in a different location depending on the version # of the toolchain. - if env_version == '2015': - pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'), - 'VC', 'bin') - pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64') - elif env_version == '2017': + if env_version == '2017': pgo_runtime_root = FindVCToolsRoot() assert pgo_runtime_root # There's no version of pgosweep.exe in HostX64/x86, so we use the copy @@ -353,12 +339,10 @@ def _GetDesiredVsToolchainHashes(): """Load a list of SHA1s corresponding to the toolchains that we want installed to build with.""" env_version = GetVisualStudioVersion() - if env_version == '2015': - # Update 3 final with 10.0.15063.468 SDK and no vctip.exe. - return ['f53e4598951162bad6330f7a167486c7ae5db1e5'] if env_version == '2017': - # VS 2017 Update 3.2 with 10.0.15063.468 SDK and patched setenv.cmd. - return ['a9e1098bba66d2acccc377d5ee81265910f29272'] + # VS 2017 Update 3.2 with 10.0.15063.468 SDK, patched setenv.cmd, and + # 10.0.16299.15 debuggers. + return ['1180cb75833ea365097e279efb2d5d7a42dee4b0'] raise Exception('Unsupported VS version %s' % env_version) diff --git a/chromium/build/win/merge_pgc_files.py b/chromium/build/win/merge_pgc_files.py index fd2718e3b97..804c4ea5e4c 100755 --- a/chromium/build/win/merge_pgc_files.py +++ b/chromium/build/win/merge_pgc_files.py @@ -56,9 +56,8 @@ def find_pgomgr(chrome_checkout_dir): # Always use the x64 version of pgomgr (the x86 one doesn't work on the bot's # environment). - if toolchain_data['version'] == '2015': - pgomgr_dir = os.path.join(toolchain_data['path'], 'VC', 'bin', 'amd64') - elif toolchain_data['version'] == '2017': + pgomgr_dir = None + if toolchain_data['version'] == '2017': vc_tools_root = vs_toolchain.FindVCToolsRoot() pgomgr_dir = os.path.join(vc_tools_root, 'HostX64', 'x64') diff --git a/chromium/build/win/message_compiler.py b/chromium/build/win/message_compiler.py index 775088d9217..7c1902e45c5 100644 --- a/chromium/build/win/message_compiler.py +++ b/chromium/build/win/message_compiler.py @@ -55,11 +55,12 @@ def main(): env_pairs = open(env_file).read()[:-2].split('\0') env_dict = dict([item.split('=', 1) for item in env_pairs]) - if input_file.endswith('.man'): + extension = os.path.splitext(input_file)[1] + if extension in ['.man', '.mc']: # For .man files, mc's output changed significantly from Version 10.0.15063 # to Version 10.0.16299. We should always have the output of the current # default SDK checked in and compare to that. Early out if a different SDK - # is active. + # is active. This also happens with .mc files. # TODO(thakis): Check in new baselines and compare to 16299 instead once # we use the 2017 Fall Creator's Update by default. mc_help = subprocess.check_output(['mc.exe', '/?'], env=env_dict, |