Skip to content

Commit

Permalink
Revert "Add support for baseline profiles in trichrome bundle and chr…
Browse files Browse the repository at this point in the history
…ome apk"

This reverts commit 448adfa.

Reason for revert: breaks gn gen when incremental_install = true

Original change's description:
> Add support for baseline profiles in trichrome bundle and chrome apk
>
> A different profile downstream will be used for what we actually ship,
> the upstream profile is there to ensure the rules are tested by CQ.
>
> Binary-Size: Profiles take space unfortunately.
> Bug: 1378676
> Change-Id: I854f1ebbabdf15c3b5f943083e8481a7f8be7747
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4294696
> Reviewed-by: Peter Wen <wnwen@chromium.org>
> Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
> Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1118307}

Bug: 1378676
Change-Id: Ib850fe9cdfe6061b7266b22e1325257c19eed3c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4346535
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Peter Wen <wnwen@chromium.org>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118330}
  • Loading branch information
m0hamed authored and Chromium LUCI CQ committed Mar 16, 2023
1 parent 2ff6cd7 commit c406a96
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 10,013 deletions.
1 change: 0 additions & 1 deletion PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,6 @@ class BanRule:
'build/android/gyp/allot_native_libraries.pydeps',
'build/android/gyp/apkbuilder.pydeps',
'build/android/gyp/assert_static_initializers.pydeps',
'build/android/gyp/binary_baseline_profile.pydeps',
'build/android/gyp/bytecode_processor.pydeps',
'build/android/gyp/bytecode_rewriter.pydeps',
'build/android/gyp/check_flag_expectations.pydeps',
Expand Down
8 changes: 4 additions & 4 deletions build/android/gyp/apkbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
def _ParseArgs(args):
parser = argparse.ArgumentParser()
build_utils.AddDepfileOption(parser)
parser.add_argument('--assets',
action='append',
help='GYP-list of files to add as assets in the form '
'"srcPath:zipPath", where ":zipPath" is optional.')
parser.add_argument(
'--assets',
help='GYP-list of files to add as assets in the form '
'"srcPath:zipPath", where ":zipPath" is optional.')
parser.add_argument(
'--java-resources', help='GYP-list of java_resources JARs to include.')
parser.add_argument('--write-asset-list',
Expand Down
56 changes: 0 additions & 56 deletions build/android/gyp/binary_baseline_profile.py

This file was deleted.

6 changes: 0 additions & 6 deletions build/android/gyp/binary_baseline_profile.pydeps

This file was deleted.

4 changes: 0 additions & 4 deletions build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ if (is_android || is_chromeos) {
# resources.arsc.
enable_unused_resource_stripping = true

# Controls whether |baseline_profile_path| is respected. Useful to disable
# baseline profiles on some bots.
enable_baseline_profiles = true

# The target to use as the system WebView implementation.
if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
system_webview_apk_target = "//android_webview:system_webview_64_apk"
Expand Down
43 changes: 0 additions & 43 deletions build/config/android/internal_rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2632,43 +2632,6 @@ if (enable_java_templates) {
}
}

template("create_binary_profile") {
_profgen_path = "$android_sdk_root/cmdline-tools/latest/bin/profgen"
_rebased_build_config = rebase_path(invoker.build_config, root_build_dir)
action_with_pydeps(target_name) {
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
forward_variables_from(invoker, [ "deps" ])
script = "//build/android/gyp/binary_baseline_profile.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
invoker.binary_baseline_profile_path,
invoker.binary_baseline_profile_metadata_path,
]
inputs = [
invoker.build_config,
invoker.proguard_mapping_path,
invoker.hrf_profile_path,
_profgen_path,
]
args = [
"--profgen",
rebase_path(_profgen_path, root_build_dir),
"--output-profile",
rebase_path(invoker.binary_baseline_profile_path, root_build_dir),
"--output-metadata",
rebase_path(invoker.binary_baseline_profile_metadata_path,
root_build_dir),
"--dex=@FileArg($_rebased_build_config:final_dex:path)",
"--proguard-mapping",
rebase_path(invoker.proguard_mapping_path, root_build_dir),
"--hrf-path",
rebase_path(invoker.hrf_profile_path, root_build_dir),
"--depfile",
rebase_path(depfile, root_build_dir),
]
}
}

# Creates a signed and aligned .apk.
#
# Variables
Expand Down Expand Up @@ -2742,9 +2705,6 @@ if (enable_java_templates) {
_args += [ "--java-resources=@FileArg($_rebased_build_config:java_resources_jars)" ]
}
}
if (defined(invoker.extra_assets)) {
_args += [ "--assets=${invoker.extra_assets}" ]
}
if (!_is_robolectric_apk) {
_apksigner = "$android_sdk_build_tools/lib/apksigner.jar"
_zipalign = "$android_sdk_build_tools/zipalign"
Expand Down Expand Up @@ -4338,9 +4298,6 @@ template("create_android_app_bundle_module") {
if (defined(invoker.uncompress_dex) && invoker.uncompress_dex) {
_args += [ "--uncompress-dex" ]
}
if (defined(invoker.extra_assets)) {
_args += [ "--assets=${invoker.extra_assets}" ]
}

# Use either provided dex path or build config path based on type of module.
if (defined(invoker.dex_path)) {
Expand Down
74 changes: 1 addition & 73 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -3206,32 +3206,6 @@ if (enable_java_templates && is_android) {
}

_final_dex_target_dep = ":$_final_dex_target_name"

_use_baseline_profile =
_proguard_enabled && defined(invoker.baseline_profile_path) &&
enable_baseline_profiles
if (_use_baseline_profile) {
_binary_profile_target = "${_template_name}__binary_baseline_profile"
_binary_baseline_profile_path =
"$target_out_dir/$_template_name.baseline.prof"
_binary_baseline_profile_metadata_path =
_binary_baseline_profile_path + "m"
create_binary_profile(_binary_profile_target) {
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
binary_baseline_profile_path = _binary_baseline_profile_path
binary_baseline_profile_metadata_path =
_binary_baseline_profile_metadata_path
proguard_mapping_path = _proguard_mapping_path
build_config = _build_config
hrf_profile_path = invoker.baseline_profile_path
deps = [
":$_build_config_target",
_final_dex_target_dep,
]
}
} else {
not_needed(invoker, [ "baseline_profile_path" ])
}
}

_all_native_libs_deps = _native_libs_deps + _secondary_abi_native_libs_deps
Expand Down Expand Up @@ -3343,15 +3317,6 @@ if (enable_java_templates && is_android) {
if (defined(_final_dex_path)) {
dex_path = _final_dex_path
deps += [ _final_dex_target_dep ]
if (_use_baseline_profile) {
extra_assets = [
rebase_path(_binary_baseline_profile_path, root_build_dir) +
":dexopt/baseline.prof",
rebase_path(_binary_baseline_profile_metadata_path,
root_build_dir) + ":dexopt/baseline.profm",
]
deps += [ ":$_binary_profile_target" ]
}
}

output_apk_path = _final_apk_path
Expand Down Expand Up @@ -3575,7 +3540,6 @@ if (enable_java_templates && is_android) {
"apk_under_test",
"app_as_shared_lib",
"assert_no_deps",
"baseline_profile_path",
"build_config_include_product_version_resource",
"bundles_supported",
"chromium_code",
Expand Down Expand Up @@ -5110,9 +5074,9 @@ if (enable_java_templates && is_android) {
_module_target = _module.module_target
_module_build_config = _module.build_config
_module_build_config_target = _module.build_config_target
_module_target_name = get_label_info(_module_target, "name")

if (!_proguard_enabled) {
_module_target_name = get_label_info(_module_target, "name")
_dex_target = "${_module_target_name}__final_dex"
_dex_path = "$target_out_dir/$_module_target_name/$_module_target_name.mergeddex.jar"
dex(_dex_target) {
Expand All @@ -5133,32 +5097,6 @@ if (enable_java_templates && is_android) {
}
_dex_target_for_module = ":$_dex_target"

_use_baseline_profile =
_proguard_enabled && defined(invoker.baseline_profile_path) &&
enable_baseline_profiles
if (_use_baseline_profile) {
_binary_profile_target =
"${_module_target_name}__binary_baseline_profile"
_binary_baseline_profile_path = "$target_out_dir/$_module_target_name/$_module_target_name.baseline.prof"
_binary_baseline_profile_metadata_path =
_binary_baseline_profile_path + "m"
create_binary_profile(_binary_profile_target) {
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
binary_baseline_profile_path = _binary_baseline_profile_path
binary_baseline_profile_metadata_path =
_binary_baseline_profile_metadata_path
proguard_mapping_path = _proguard_mapping_path
build_config = _module_build_config
hrf_profile_path = invoker.baseline_profile_path
deps = [
_dex_target_for_module,
_module_build_config_target,
]
}
} else {
not_needed(invoker, [ "baseline_profile_path" ])
}

# Generate one module .zip file per bundle module.
#
# Important: the bundle tool uses the module's zip filename as
Expand Down Expand Up @@ -5210,16 +5148,6 @@ if (enable_java_templates && is_android) {
_secondary_abi_native_libraries_config
deps += [ ":$_secondary_abi_native_libraries_config_target" ]
}

if (_use_baseline_profile) {
extra_assets = [
rebase_path(_binary_baseline_profile_path, root_build_dir) +
":dexopt/baseline.prof",
rebase_path(_binary_baseline_profile_metadata_path,
root_build_dir) + ":dexopt/baseline.profm",
]
deps += [ ":$_binary_profile_target" ]
}
}

_all_create_module_targets += [
Expand Down
4 changes: 0 additions & 4 deletions chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,6 @@ if (current_toolchain == default_toolchain) {
"add_view_trace_events",
"apk_name",
"bundle_target",
"baseline_profile_path",
"is_base_module",
"target_type",
"enable_lint",
Expand Down Expand Up @@ -2427,7 +2426,6 @@ if (current_toolchain == default_toolchain) {
target_type = "android_apk"
apk_name = "ChromePublic"
enable_multidex = is_java_debug
baseline_profile_path = "//chrome/android/baseline_profiles/profile.txt"
}

android_library("monochrome_java") {
Expand Down Expand Up @@ -3178,7 +3176,6 @@ if (current_toolchain == default_toolchain) {
forward_variables_from(invoker,
[
"add_view_trace_events",
"baseline_profile_path",
"enable_lint",
"include_32_bit_webview",
"include_64_bit_webview",
Expand Down Expand Up @@ -3275,7 +3272,6 @@ if (current_toolchain == default_toolchain) {
is_trichrome = true
static_library_provider = ":trichrome_library_apk"
add_view_trace_events = true
baseline_profile_path = "//chrome/android/baseline_profiles/profile.txt"
if (android_64bit_target_cpu) {
is_64_bit_browser = false
include_64_bit_webview = true
Expand Down
2 changes: 0 additions & 2 deletions chrome/android/baseline_profiles/OWNERS

This file was deleted.

20 changes: 0 additions & 20 deletions chrome/android/baseline_profiles/README.md

This file was deleted.

Loading

0 comments on commit c406a96

Please sign in to comment.