Skip to content

Commit

Permalink
Reland "[Bundles] Add Upstream 64-bit Trichrome Chrome Bundles."
Browse files Browse the repository at this point in the history
This reverts commit a4352cd.

Reason for revert: Fixed the problem.

Original change's description:
> Revert "[Bundles] Add Upstream 64-bit Trichrome Chrome Bundles."
> 
> This reverts commit b4a06a4.
> 
> Reason for revert: Clank Official Build Failure - 75.0.3761.0 crbug.com/951364
> 
> Original change's description:
> > [Bundles] Add Upstream 64-bit Trichrome Chrome Bundles.
> > 
> > This CL adds the following targets for 64-bit biulds:
> >   trichrome_64_32_chrome_bundle
> >   trichrome_64_chrome_bundle
> > 
> > These complemnent existing Monochrome targets.
> > 
> > Also rename template monochrome_public_bundle_tmpl to
> > monochrome_or_trichrome_public_bundle_tmpl.
> > 
> > Change-Id: I1773085c82e2dbf068c9bfbd1ca03a7175fee1c8
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553913
> > Reviewed-by: Christopher Grant <cjgrant@chromium.org>
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
> > Commit-Queue: Samuel Huang <huangs@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#648671}
> 
> TBR=huangs@chromium.org,cjgrant@chromium.org,agrieve@chromium.org,tiborg@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: Ifce48fc21989590f7bdcdc5c1337653cf1d9a7cc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1561272
> Reviewed-by: Xi Han <hanxi@chromium.org>
> Commit-Queue: Xi Han <hanxi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#649513}

TBR=huangs@chromium.org,hanxi@chromium.org,cjgrant@chromium.org,agrieve@chromium.org,tiborg@chromium.org

Change-Id: I6a2e907f879bcc68283731672c9679197a9eb4f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1564331
Reviewed-by: Samuel Huang <huangs@chromium.org>
Reviewed-by: Christopher Grant <cjgrant@chromium.org>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650026}
  • Loading branch information
samuelhuang authored and Commit Bot committed Apr 11, 2019
1 parent e80bb85 commit ba5bbcc
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 26 deletions.
4 changes: 2 additions & 2 deletions build/util/android_chrome_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
"""
ARCH64_APK_VARIANTS = {
'64_32': {
'PACKAGES': frozenset(['MONOCHROME']),
'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']),
'MODIFIER': 10
},
'64': {
'PACKAGES': frozenset(['MONOCHROME']),
'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']),
'MODIFIER': 20
}
}
Expand Down
8 changes: 8 additions & 0 deletions build/util/android_chrome_version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ def testGenerateVersionCodesAndroidArchArm64Variants(self):
self.EXAMPLE_VERSION_VALUES, arch='arm64', is_next_build=False)
arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE']
arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE']
arch_trichrome_64_32_version_code = output['TRICHROME_64_32_VERSION_CODE']
arch_trichrome_64_version_code = output['TRICHROME_64_VERSION_CODE']

self.assertEqual(arch_monochrome_64_32_version_code, '372000042')
self.assertEqual(arch_monochrome_64_version_code, '372000052')
self.assertEqual(arch_trichrome_64_32_version_code, '372000043')
self.assertEqual(arch_trichrome_64_version_code, '372000053')

def testGenerateVersionCodesAndroidArchX64(self):
"""Assert it handles different architectures correctly.
Expand All @@ -200,9 +204,13 @@ def testGenerateVersionCodesAndroidArchX64Variants(self):
self.EXAMPLE_VERSION_VALUES, arch='x64', is_next_build=False)
arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE']
arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE']
arch_trichrome_64_32_version_code = output['TRICHROME_64_32_VERSION_CODE']
arch_trichrome_64_version_code = output['TRICHROME_64_VERSION_CODE']

self.assertEqual(arch_monochrome_64_32_version_code, '372000072')
self.assertEqual(arch_monochrome_64_version_code, '372000082')
self.assertEqual(arch_trichrome_64_32_version_code, '372000073')
self.assertEqual(arch_trichrome_64_version_code, '372000083')

def testGenerateVersionCodesAndroidArchOrderArm(self):
"""Assert it handles different architectures correctly.
Expand Down
18 changes: 12 additions & 6 deletions build/util/version.gni
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ if (target_os == "mac") {
if (target_cpu == "arm64" || target_cpu == "x64") {
_version_dictionary_template +=
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" " +
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" " +
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" " +
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" "
}

_script_arguments += [
Expand Down Expand Up @@ -96,16 +98,18 @@ if (target_os == "mac") {
} else if (target_os == "android") {
forward_variables_from(_result,
[
"chrome_version_code",
"chrome_modern_version_code",
"chrome_version_code",
"monochrome_64_32_version_code",
"monochrome_64_version_code",
"monochrome_version_code",
"trichrome_version_code",
"notouch_chrome_version_code",
"webview_stable_version_code",
"trichrome_64_32_version_code",
"trichrome_64_version_code",
"trichrome_version_code",
"webview_beta_version_code",
"webview_dev_version_code",
"monochrome_64_32_version_code",
"monochrome_64_version_code",
"webview_stable_version_code",
])

chrome_version_name = chrome_version_full
Expand All @@ -126,6 +130,8 @@ if (target_os == "mac") {
lines_to_write += [
"Monochrome_64_32=$monochrome_64_32_version_code",
"Monochrome_64=$monochrome_64_version_code",
"TrichromeChrome_64_32=$trichrome_64_32_version_code",
"TrichromeChrome_64=$trichrome_64_version_code",
]
}

Expand Down
16 changes: 14 additions & 2 deletions build/util/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def testBuildOutputAndroidArchVariantsArm64(self):
new_template = (
self._EXAMPLE_ANDROID_TEMPLATE +
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" ")
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" "
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" ")
args_with_template = _ReplaceArgs(self._EXAMPLE_ANDROID_ARGS,
['-t', new_template])
new_args = _ReplaceArgs(args_with_template, ['-a', 'arm64'])
Expand All @@ -131,13 +133,19 @@ def testBuildOutputAndroidArchVariantsArm64(self):
r'\bmonochrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\bmonochrome_64_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_version_code = "\d+"\s')

def testBuildOutputAndroidArchVariantsX64(self):
"""Assert 64-bit-specific version codes"""
new_template = (
self._EXAMPLE_ANDROID_TEMPLATE +
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" ")
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" "
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" ")
args_with_template = _ReplaceArgs(self._EXAMPLE_ANDROID_ARGS,
['-t', new_template])
new_args = _ReplaceArgs(args_with_template, ['-a', 'x64'])
Expand All @@ -148,6 +156,10 @@ def testBuildOutputAndroidArchVariantsX64(self):
r'\bmonochrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\bmonochrome_64_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_version_code = "\d+"\s')

def testBuildOutputAndroidChromeArchInput(self):
"""Assert it raises an exception when using an invalid architecture input"""
Expand Down
56 changes: 42 additions & 14 deletions chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ if (is_official_build) {
}
}

template("monochrome_public_bundle_tmpl") {
template("monochrome_or_trichrome_public_bundle_tmpl") {
_base_module_target_name = "${invoker.target_name}__base_bundle_module"
_is_trichrome =
defined(invoker.use_trichrome_library) && invoker.use_trichrome_library
Expand All @@ -2059,15 +2059,25 @@ template("monochrome_public_bundle_tmpl") {
}

if (_is_trichrome) {
_version_code = trichrome_version_code
} else if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = monochrome_64_32_version_code
if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = trichrome_64_32_version_code
} else {
_version_code = trichrome_64_version_code
}
} else {
_version_code = monochrome_64_version_code
_version_code = trichrome_version_code
}
} else {
_version_code = monochrome_version_code
if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = monochrome_64_32_version_code
} else {
_version_code = monochrome_64_version_code
}
} else {
_version_code = monochrome_version_code
}
}
_version_name = chrome_version_name

Expand Down Expand Up @@ -2175,7 +2185,7 @@ template("monochrome_public_bundle_tmpl") {
}
}

monochrome_public_bundle_tmpl("monochrome_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_public_bundle") {
bundle_suffix = ""
}

Expand All @@ -2189,27 +2199,45 @@ if (is_official_build) {
}
}

monochrome_or_trichrome_public_bundle_tmpl("trichrome_chrome_bundle") {
bundle_suffix = ""
use_trichrome_library = true
}

if (android_64bit_target_cpu) {
monochrome_public_bundle_tmpl("monochrome_64_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_64_public_bundle") {
bundle_suffix = "64"
is_64_bit_browser = true
if (build_apk_secondary_abi) {
include_32_bit_webview = false
}
}

monochrome_public_bundle_tmpl("monochrome_64_32_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_64_32_public_bundle") {
bundle_suffix = "6432"
is_64_bit_browser = true
if (build_apk_secondary_abi) {
include_32_bit_webview = true
}
}
}

monochrome_public_bundle_tmpl("trichrome_chrome_bundle") {
bundle_suffix = ""
use_trichrome_library = true
monochrome_or_trichrome_public_bundle_tmpl("trichrome_64_chrome_bundle") {
bundle_suffix = "64"
is_64_bit_browser = true
use_trichrome_library = true
if (build_apk_secondary_abi) {
include_32_bit_webview = false
}
}

monochrome_or_trichrome_public_bundle_tmpl("trichrome_64_32_chrome_bundle") {
bundle_suffix = "6432"
is_64_bit_browser = true
use_trichrome_library = true
if (build_apk_secondary_abi) {
include_32_bit_webview = true
}
}
}

generate_jni("chrome_jni_headers") {
Expand Down
11 changes: 9 additions & 2 deletions chrome/android/chrome_public_apk_tmpl.gni
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ template("monochrome_public_common_apk_or_module_tmpl") {
# depend on their respective versions of the shared library APK even
# though they're functionally the same.
native_lib_placeholders = [ "libdummy.so" ]
if (android_64bit_target_cpu && build_apk_secondary_abi) {
if (android_64bit_target_cpu && build_apk_secondary_abi &&
(!defined(invoker.is_64_bit_browser) || !invoker.is_64_bit_browser ||
invoker.include_32_bit_webview)) {
secondary_native_lib_placeholders = [ "libdummy.so" ]
}
_pak_prefix = "trichrome_chrome"
Expand All @@ -397,7 +399,12 @@ template("monochrome_public_common_apk_or_module_tmpl") {
# Configrations to make android load shared library from APK.
uncompress_shared_libraries = true

forward_variables_from(invoker, "*", [ "include_32_bit_webview" ])
forward_variables_from(invoker,
"*",
[
"include_32_bit_webview",
"is_64_bit_browser",
])

# Android N+ better supports multiple locales (https://crbug.com/780847).
support_zh_hk = false
Expand Down

0 comments on commit ba5bbcc

Please sign in to comment.