Update Kotlin to 1.8.20
Categories
(Fenix :: General, task)
Tracking
(firefox114 fixed)
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: RyanVM, Assigned: RyanVM)
References
Details
Attachments
(1 file)
Also picking up the latest Compose Compiler update for the needed version compatibility bump.
Changelogs:
Assignee | ||
Comment 1•2 years ago
•
|
||
Also bump ksp as it's tied to the Kotlin version. Changelogs for that:
Assignee | ||
Comment 2•2 years ago
|
||
I've got this mostly working, though there's one test failure that I'm having difficulty reasoning about:
https://firefox-ci-tc.services.mozilla.com/tasks/Gr9tp6_5Sq-Pu2k7WYkUBQ/runs/5/logs/public/logs/live.log
TEST: getParcelableArrayCompat with unexpected type returns empty array and does not throw exception
FAILURE
java.lang.ArrayStoreException: mozilla.components.support.utils.BundleTest$Companion$Unexpected
at mozilla.components.support.utils.BundleTest.getParcelableArrayCompat with unexpected type returns empty array and does not throw exception(BundleTest.kt:166)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:580)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:287)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:99)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
TEST: safeCastToArrayOfT with unexpected elements returns empty array and does not throw exception
FAILURE
java.lang.ArrayStoreException: mozilla.components.support.utils.BundleTest$Companion$Unexpected
at mozilla.components.support.utils.BundleTest.safeCastToArrayOfT with unexpected elements returns empty array and does not throw exception(BundleTest.kt:124)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:580)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:287)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:99)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Looking through the Kotlin 1.8.20 changelog, I see a few commits related to arrays in there. Looking at the code for BundleTest.kt, https://youtrack.jetbrains.com/issue/KT-55005 looks maybe-relevant?
Assignee | ||
Comment 3•2 years ago
|
||
Hi Jon and Mihai - any ideas what might be up with those BundleTest failures? AFAICT, that's all we're blocked on for taking this update. The WIP patch is here:
https://github.com/mozilla-mobile/firefox-android/compare/main...b1829228_kotlin
Comment 4•2 years ago
|
||
An additional check can be added in the safeCastToArrayOfT
method in order to avoid throwing the exception. Not sure what changed (did not find anything related in the release notes).
/**
* Cast a [Parcelable] [Array] to a <T implements [Parcelable]> [Array]
*/
inline fun <reified T : Parcelable> Array<Parcelable>.safeCastToArrayOfT(): Array<T> {
return Array(this.size) { index ->
if (this[index] is T) {
this[index] as? T
} else {
null
}
}.filterNotNull().toTypedArray()
}
Comment 5•2 years ago
|
||
Comment 6•2 years ago
|
||
Authored by https://github.com/rvandermeulen
https://github.com/mozilla-mobile/firefox-android/commit/4c17e1a9b90cd8d190e9e02e3dad2811e5b60183
[main] Bug 1829228 - Update Kotlin to 1.8.20 and Compose Compiler to 1.4.6
Assignee | ||
Updated•2 years ago
|
Description
•