Commit 2eba819c authored by Sam Maier's avatar Sam Maier Committed by Chromium LUCI CQ

Erroring on JDK desugaring for monochrome+


Change-Id: I746c6af582fa88d74cf8c6cb4c6e6ecdbed62b95
Bug: 1159984
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595259Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839181}
parent 75537d54
......@@ -16,6 +16,7 @@ import zipfile
import dex
import dex_jdk_libs
from pylib.dex import dex_parser
from util import build_utils
from util import diff_utils
......@@ -343,6 +344,15 @@ def _OptimizeWithR8(options,
options.desugar_jdk_libs_configuration_jar,
options.desugared_library_keep_rule_output, jdk_dex_output,
options.warnings_as_errors)
if int(options.min_api) >= 24 and base_has_imported_lib:
with open(jdk_dex_output, 'rb') as f:
dexfile = dex_parser.DexFile(bytearray(f.read()))
for m in dexfile.IterMethodSignatureParts():
print('{}#{}'.format(m[0], m[2]))
assert False, (
'Desugared JDK libs are disabled on Monochrome and newer - see '
'crbug.com/1159984 for details, and see above list for desugared '
'classes and methods.')
if options.uses_split:
_SplitChildFeatures(options, feature_contexts, base_dex_context, tmp_dir,
......
......@@ -3,6 +3,9 @@
../../gn_helpers.py
../../print_python_deps.py
../convert_dex_profile.py
../pylib/__init__.py
../pylib/dex/__init__.py
../pylib/dex/dex_parser.py
dex.py
dex_jdk_libs.py
proguard.py
......
......@@ -22,7 +22,7 @@ Local Modifications:
* Refer to commit descriptions within "patches" directory.
* Plus: https://r8-review.googlesource.com/c/r8/+/56708
* Added "playground" directory for quick "how does this optimize" tests.
* Removed references to ConcurrentHashMap in desugar_jdk_libs.json.
* Removed references to ConcurrentHashMap and TimeZone#getTimeZone in desugar_jdk_libs.json.
Update Instructions:
# Download R8:
......@@ -63,7 +63,7 @@ java -cp third_party/r8/lib/r8.jar com.android.tools.r8.BackportedMethodList --m
Update instructions for desugar_jdk_libs.json:
* Find desugar.json as described above and copy to desugar_jdk_libs.json.
* Remove all mentions of ConcurrentHashMap (and remove any trailing commas if necessary).
* Remove all mentions of ConcurrentHashMap and TimeZone#getTimeZone and remove trailing commas.
How to file bugs against R8:
* Copy & paste the failing ninja command (starts with proguard.py), and add --dump-inputs.
......
......@@ -164,7 +164,6 @@
"java.util.Date#toInstant": "java.util.DesugarDate",
"java.util.GregorianCalendar#from": "java.util.DesugarGregorianCalendar",
"java.util.GregorianCalendar#toZonedDateTime": "java.util.DesugarGregorianCalendar",
"java.util.TimeZone#getTimeZone": "java.util.DesugarTimeZone",
"java.util.TimeZone#toZoneId": "java.util.DesugarTimeZone"
},
"custom_conversion": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment