diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-11 11:32:04 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-18 13:40:17 +0000 |
commit | 31ccca0778db85c159634478b4ec7997f6704860 (patch) | |
tree | 3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/build/util | |
parent | 248b70b82a40964d5594eb04feca0fa36716185d (diff) | |
download | qtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz |
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/build/util')
-rw-r--r-- | chromium/build/util/LASTCHANGE | 2 | ||||
-rw-r--r-- | chromium/build/util/LASTCHANGE.committime | 2 | ||||
-rw-r--r-- | chromium/build/util/android_chrome_version.py | 159 | ||||
-rw-r--r-- | chromium/build/util/android_chrome_version_test.py | 33 | ||||
-rw-r--r-- | chromium/build/util/branding.gni | 5 | ||||
-rwxr-xr-x | chromium/build/util/generate_wrapper.py | 3 | ||||
-rw-r--r-- | chromium/build/util/version.gni | 24 |
7 files changed, 145 insertions, 83 deletions
diff --git a/chromium/build/util/LASTCHANGE b/chromium/build/util/LASTCHANGE index 40e6fc9d764..9a33132d012 100644 --- a/chromium/build/util/LASTCHANGE +++ b/chromium/build/util/LASTCHANGE @@ -1 +1 @@ -LASTCHANGE=a92c93df20fcf33ca6a37962134389f0b85ec9ab-refs/branch-heads/3945@{#1085} +LASTCHANGE=d5190fedde334f4c1c3e3851e62966304d236bae-refs/branch-heads/3987@{#983} diff --git a/chromium/build/util/LASTCHANGE.committime b/chromium/build/util/LASTCHANGE.committime index 614336b78b3..bc5cddd5756 100644 --- a/chromium/build/util/LASTCHANGE.committime +++ b/chromium/build/util/LASTCHANGE.committime @@ -1 +1 @@ -1580433036
\ No newline at end of file +1583284171
\ No newline at end of file diff --git a/chromium/build/util/android_chrome_version.py b/chromium/build/util/android_chrome_version.py index eb58b2f97e9..f462210007f 100644 --- a/chromium/build/util/android_chrome_version.py +++ b/chromium/build/util/android_chrome_version.py @@ -1,15 +1,15 @@ # Copyright 2019 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. -"""Different build variants of chrome for android have different version codes. -Reason: for targets that have the same package name (e.g. chrome, chome -modern, monochrome, trichrome), Play Store considers them the same app -and will push the supported app with the highest version code to devices. -(note Play Store does not support hosting two different apps with same -version code and package name) +"""Different build variants of Chrome for Android have different version codes. -Each key in this dict represents a unique version code that will be used for -one or more android chrome apks. +For targets that have the same package name (e.g. Chrome, Chrome Modern, +Monochrome, Trichrome), Play Store considers them the same app and will push the +supported app with the highest version code to devices. Note that Play Store +does not support hosting two different apps with same version code and package +name. + +Each version code generated by this script will be used by one or more APKs. Webview channels must have unique version codes for a couple reasons: a) Play Store does not support having the same version code for different @@ -21,23 +21,78 @@ b) Firebase project support (used by official builders) requires unique packages are whitelisted by Android as webview providers. WEBVIEW_STABLE, WEBVIEW_BETA, WEBVIEW_DEV are all used for standalone webview, -whereas the others are used for various chrome apks. +whereas the others are used for various chrome APKs. -Note that a final digit of '3' for webview is reserved for Trichrome Webview. +Note that a final digit of '3' for Webview is reserved for Trichrome Webview. The same versionCode is used for both Trichrome Chrome and Trichrome Webview. """ -ANDROID_CHROME_APK_VERSION_CODE_DIFFS = { + +# Package name version bits. +_PACKAGE_NAMES = { 'CHROME': 0, 'CHROME_MODERN': 1, 'MONOCHROME': 2, 'TRICHROME': 3, - 'NOTOUCH_CHROME': 4, 'WEBVIEW_STABLE': 0, 'WEBVIEW_BETA': 1, 'WEBVIEW_DEV': 2, } +"""List of version numbers to be created for each build configuration. +Tuple format: + + (version code name), (package name), (supported ABIs) + +Here, (supported ABIs) is referring to the combination of browser ABI and +webview library ABI present in a particular APK. For example, 64_32 implies a +64-bit browser with an extra 32-bit Webview library. See also +_ABIS_TO_BIT_MASK. +""" +_APKS = { + '32': [ + ('CHROME', 'CHROME', '32'), + ('CHROME_MODERN', 'CHROME_MODERN', '32'), + ('MONOCHROME', 'MONOCHROME', '32'), + ('TRICHROME', 'TRICHROME', '32'), + ('WEBVIEW_STABLE', 'WEBVIEW_STABLE', '32'), + ('WEBVIEW_BETA', 'WEBVIEW_BETA', '32'), + ('WEBVIEW_DEV', 'WEBVIEW_DEV', '32'), + ], + '64': [ + # Pure 64-bit Chrome variants have traditionally used the first + # available 64-bit architecture digit, which is now used for + # Monochrome/Trichrome's "32+64" variant. It could be changed to "64", + # but there's no reason to. + ('CHROME', 'CHROME', '32_64'), + ('CHROME_MODERN', 'CHROME_MODERN', '32_64'), + ('MONOCHROME', 'MONOCHROME', '32_64'), + ('MONOCHROME_32', 'MONOCHROME', '32'), + ('MONOCHROME_32_64', 'MONOCHROME', '32_64'), + ('MONOCHROME_64_32', 'MONOCHROME', '64_32'), + ('MONOCHROME_64', 'MONOCHROME', '64'), + ('TRICHROME', 'TRICHROME', '32_64'), + ('TRICHROME_32', 'TRICHROME', '32'), + ('TRICHROME_32_64', 'TRICHROME', '32_64'), + ('TRICHROME_64_32', 'TRICHROME', '64_32'), + ('TRICHROME_64', 'TRICHROME', '64'), + ('WEBVIEW_STABLE', 'WEBVIEW_STABLE', '32_64'), + ('WEBVIEW_BETA', 'WEBVIEW_BETA', '32_64'), + ('WEBVIEW_DEV', 'WEBVIEW_DEV', '32_64'), + ] +} -"""The architecture preference is encoded into the version_code for devices +# Splits input build config architecture to manufacturer and bitness. +_ARCH_TO_MFG_AND_BITNESS = { + 'arm': ('arm', '32'), + 'arm64': ('arm', '64'), + 'x86': ('intel', '32'), + 'x64': ('intel', '64'), + 'mipsel': ('mipsel', '32'), +} + +# Expose the available choices to other scripts. +ARCH_CHOICES = _ARCH_TO_MFG_AND_BITNESS.keys() +""" +The architecture preference is encoded into the version_code for devices that support multiple architectures. (exploiting play store logic that pushes apk with highest version code) @@ -77,50 +132,34 @@ things here: - The relative order of mips isn't important, but it needs to be a *distinct* value to the other architectures because all builds need unique version codes. """ -ARCH_VERSION_CODE_DIFF = { - 'arm': 0, - 'x86': 10, - 'mipsel': 20, - 'arm64': 30, - 'x64': 60 +_ABIS_TO_BIT_MASK = { + 'arm': { + '32': 0, + '32_64': 30, + '64_32': 40, + '64': 50, + }, + 'intel': { + '32': 10, + '32_64': 60, + '64_32': 70, + '64': 80, + }, + 'mipsel': { + '32': 20, + } } -ARCH_CHOICES = ARCH_VERSION_CODE_DIFF.keys() - """ "Next" builds get +5 last version code digit. We choose 5 because it won't conflict with values in ANDROID_CHROME_APK_VERSION_CODE_DIFFS """ -NEXT_BUILD_VERSION_CODE_DIFF = 5 - -"""For 64-bit architectures, some packages have multiple targets with version -codes that differ by the second-to-last digit (the architecture digit). This is -for various combinations of 32-bit vs 64-bit chrome and webview. The -default/traditional configuration is 32-bit chrome with 64-bit webview, but we -are adding: -+ 64-bit chrome with 32-bit webview -+ 64-bit combined Chrome and Webview (only one library) -+ (maybe someday 32-bit chrome with 32-bit webview) - -The naming scheme followed here is <chrome>_<webview>, -e.g. 64_32 is 64-bit chrome with 32-bit webview. -""" -ARCH64_APK_VARIANTS = { - '64_32': { - 'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']), - 'MODIFIER': 10 - }, - '64': { - 'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']), - 'MODIFIER': 20 - } -} +_NEXT_BUILD_VERSION_CODE_DIFF = 5 def GenerateVersionCodes(version_values, arch, is_next_build): - """Get dict of version codes for chrome-for-android-related targets + """Build dict of version codes for the specified build architecture. Eg: - e.g. { 'CHROME_VERSION_CODE': '378100010', 'MONOCHROME_VERSION_CODE': '378100013', @@ -142,26 +181,22 @@ def GenerateVersionCodes(version_values, arch, is_next_build): Thus, this method is responsible for the final two digits of versionCode. """ - base_version_code = '%s%03d00' % (version_values['BUILD'], - int(version_values['PATCH'])) - new_version_code = int(base_version_code) + base_version_code = int( + '%s%03d00' % (version_values['BUILD'], int(version_values['PATCH']))) - new_version_code += ARCH_VERSION_CODE_DIFF[arch] if is_next_build: - new_version_code += NEXT_BUILD_VERSION_CODE_DIFF + base_version_code += _NEXT_BUILD_VERSION_CODE_DIFF + + mfg, bitness = _ARCH_TO_MFG_AND_BITNESS[arch] version_codes = {} - for apk, diff in ANDROID_CHROME_APK_VERSION_CODE_DIFFS.iteritems(): - version_code_name = apk + '_VERSION_CODE' - version_code_val = new_version_code + diff - version_codes[version_code_name] = str(version_code_val) - if arch == 'arm64' or arch == 'x64': - for variant, config in ARCH64_APK_VARIANTS.iteritems(): - if apk in config['PACKAGES']: - variant_name = apk + '_' + variant + '_VERSION_CODE' - variant_val = version_code_val + config['MODIFIER'] - version_codes[variant_name] = str(variant_val) + for apk, package, abis in _APKS[bitness]: + abi_bits = _ABIS_TO_BIT_MASK[mfg][abis] + package_bits = _PACKAGE_NAMES[package] + version_code_name = apk + '_VERSION_CODE' + version_code_val = base_version_code + abi_bits + package_bits + version_codes[version_code_name] = str(version_code_val) return version_codes diff --git a/chromium/build/util/android_chrome_version_test.py b/chromium/build/util/android_chrome_version_test.py index 529ccd33aa1..570849715f7 100644 --- a/chromium/build/util/android_chrome_version_test.py +++ b/chromium/build/util/android_chrome_version_test.py @@ -54,15 +54,6 @@ class _VersionTest(unittest.TestCase): self.assertEqual(trichrome_version_code, '372000003') - def testGenerateVersionCodesAndroidNoTouch(self): - """Assert it gives correct values for standard/example inputs""" - output = GenerateVersionCodes( - self.EXAMPLE_VERSION_VALUES, arch='arm', is_next_build=False) - - notouch_chrome_version_code = output['NOTOUCH_CHROME_VERSION_CODE'] - - self.assertEqual(notouch_chrome_version_code, '372000004') - def testGenerateVersionCodesAndroidWebviewStable(self): """Assert it gives correct values for standard/example inputs""" output = GenerateVersionCodes( @@ -170,13 +161,25 @@ class _VersionTest(unittest.TestCase): """ output = GenerateVersionCodes( self.EXAMPLE_VERSION_VALUES, arch='arm64', is_next_build=False) + arch_monochrome_version_code = output['MONOCHROME_VERSION_CODE'] + arch_monochrome_32_version_code = output['MONOCHROME_32_VERSION_CODE'] + arch_monochrome_32_64_version_code = output['MONOCHROME_32_64_VERSION_CODE'] arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE'] arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE'] + arch_trichrome_version_code = output['TRICHROME_VERSION_CODE'] + arch_trichrome_32_version_code = output['TRICHROME_32_VERSION_CODE'] + arch_trichrome_32_64_version_code = output['TRICHROME_32_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_32_version_code, '372000002') + self.assertEqual(arch_monochrome_32_64_version_code, '372000032') + self.assertEqual(arch_monochrome_version_code, '372000032') self.assertEqual(arch_monochrome_64_32_version_code, '372000042') self.assertEqual(arch_monochrome_64_version_code, '372000052') + self.assertEqual(arch_trichrome_32_version_code, '372000003') + self.assertEqual(arch_trichrome_32_64_version_code, '372000033') + self.assertEqual(arch_trichrome_version_code, '372000033') self.assertEqual(arch_trichrome_64_32_version_code, '372000043') self.assertEqual(arch_trichrome_64_version_code, '372000053') @@ -202,13 +205,25 @@ class _VersionTest(unittest.TestCase): """ output = GenerateVersionCodes( self.EXAMPLE_VERSION_VALUES, arch='x64', is_next_build=False) + arch_monochrome_32_version_code = output['MONOCHROME_32_VERSION_CODE'] + arch_monochrome_32_64_version_code = output['MONOCHROME_32_64_VERSION_CODE'] + arch_monochrome_version_code = output['MONOCHROME_VERSION_CODE'] arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE'] arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE'] + arch_trichrome_32_version_code = output['TRICHROME_32_VERSION_CODE'] + arch_trichrome_32_64_version_code = output['TRICHROME_32_64_VERSION_CODE'] + arch_trichrome_version_code = output['TRICHROME_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_32_version_code, '372000012') + self.assertEqual(arch_monochrome_32_64_version_code, '372000062') + self.assertEqual(arch_monochrome_version_code, '372000062') self.assertEqual(arch_monochrome_64_32_version_code, '372000072') self.assertEqual(arch_monochrome_64_version_code, '372000082') + self.assertEqual(arch_trichrome_32_version_code, '372000013') + self.assertEqual(arch_trichrome_32_64_version_code, '372000063') + self.assertEqual(arch_trichrome_version_code, '372000063') self.assertEqual(arch_trichrome_64_32_version_code, '372000073') self.assertEqual(arch_trichrome_64_version_code, '372000083') diff --git a/chromium/build/util/branding.gni b/chromium/build/util/branding.gni index 2a229f1056e..aa758e6a0e4 100644 --- a/chromium/build/util/branding.gni +++ b/chromium/build/util/branding.gni @@ -23,16 +23,15 @@ _branding_dictionary_template = "installer_short_name = \"@PRODUCT_INSTALLER_SHORTNAME@\" " + "team_id = \"@MAC_TEAM_ID@\" " -_branding_file = "//chrome/app/theme/$branding_path_component/BRANDING" _result = exec_script("version.py", [ "-f", - rebase_path(_branding_file, root_build_dir), + rebase_path(branding_file_path, root_build_dir), "-t", _branding_dictionary_template, ], "scope", - [ _branding_file ]) + [ branding_file_path ]) chrome_product_full_name = _result.full_name chrome_product_short_name = _result.short_name diff --git a/chromium/build/util/generate_wrapper.py b/chromium/build/util/generate_wrapper.py index 5a7d1ee8a2f..82b13c3499a 100755 --- a/chromium/build/util/generate_wrapper.py +++ b/chromium/build/util/generate_wrapper.py @@ -57,8 +57,9 @@ PY_TEMPLATE = textwrap.dedent( def ExpandWrappedPath(arg): m = _WRAPPED_PATH_RE.match(arg) if m: - return os.path.join( + relpath = os.path.join( os.path.relpath(_SCRIPT_DIR), _PATH_TO_OUTPUT_DIR, m.group(1)) + return os.path.normpath(relpath) return arg diff --git a/chromium/build/util/version.gni b/chromium/build/util/version.gni index 81beb82481c..a4fff4d39f7 100644 --- a/chromium/build/util/version.gni +++ b/chromium/build/util/version.gni @@ -43,15 +43,18 @@ if (is_mac) { "chrome_modern_version_code = \"@CHROME_MODERN_VERSION_CODE@\" " + "monochrome_version_code = \"@MONOCHROME_VERSION_CODE@\" " + "trichrome_version_code = \"@TRICHROME_VERSION_CODE@\" " + - "notouch_chrome_version_code = \"@NOTOUCH_CHROME_VERSION_CODE@\" " + "webview_stable_version_code = \"@WEBVIEW_STABLE_VERSION_CODE@\" " + "webview_beta_version_code = \"@WEBVIEW_BETA_VERSION_CODE@\" " + "webview_dev_version_code = \"@WEBVIEW_DEV_VERSION_CODE@\" " if (target_cpu == "arm64" || target_cpu == "x64") { _version_dictionary_template += + "monochrome_32_version_code = \"@MONOCHROME_32_VERSION_CODE@\" " + + "monochrome_32_64_version_code = \"@MONOCHROME_32_64_VERSION_CODE@\" " + "monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" " + "monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" " + + "trichrome_32_version_code = \"@TRICHROME_32_VERSION_CODE@\" " + + "trichrome_32_64_version_code = \"@TRICHROME_32_64_VERSION_CODE@\" " + "trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" " + "trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" " } @@ -78,7 +81,10 @@ _script_arguments += [ _result = exec_script("version.py", _script_arguments, "scope", - [ chrome_version_file ]) + [ + chrome_version_file, + "android_chrome_version.py", + ]) # Full version. For example "45.0.12321.0" chrome_version_full = _result.full @@ -100,13 +106,16 @@ if (is_mac) { [ "chrome_modern_version_code", "chrome_version_code", + "monochrome_version_code", + "monochrome_32_version_code", + "monochrome_32_64_version_code", "monochrome_64_32_version_code", "monochrome_64_version_code", - "monochrome_version_code", - "notouch_chrome_version_code", + "trichrome_version_code", + "trichrome_32_version_code", + "trichrome_32_64_version_code", "trichrome_64_32_version_code", "trichrome_64_version_code", - "trichrome_version_code", "webview_beta_version_code", "webview_dev_version_code", "webview_stable_version_code", @@ -120,7 +129,6 @@ if (is_mac) { "ChromeModern: $chrome_modern_version_code", "Monochrome: $monochrome_version_code", "TrichromeChrome: $trichrome_version_code", - "MonochromeFP: $notouch_chrome_version_code", "AndroidWebviewStable: $webview_stable_version_code", "AndroidWebviewBeta: $webview_beta_version_code", "AndroidWebviewDev: $webview_dev_version_code", @@ -128,8 +136,12 @@ if (is_mac) { if (target_cpu == "arm64" || target_cpu == "x64") { lines_to_write += [ + "Monochrome32: $monochrome_32_version_code", + "Monochrome3264: $monochrome_32_64_version_code", "Monochrome6432: $monochrome_64_32_version_code", "Monochrome64: $monochrome_64_version_code", + "TrichromeChrome32: $trichrome_32_version_code", + "TrichromeChrome3264: $trichrome_32_64_version_code", "TrichromeChrome6432: $trichrome_64_32_version_code", "TrichromeChrome64: $trichrome_64_version_code", ] |