Update to Kotlin 1.6 and use the new Memory Model#370
Conversation
|
I've added a new commit 1e28d9e that enables the new memory model. For context, see:
So this makes this PR even more impactful! The reason why we do this now is that the switch to ktor 2.x causes several issues in Phoenix (some freezing APIs are gone, and http calls are done in the background thread, causing unexpected object mutations hence crashes). Rather than fixing those issues in Phoenix it makes more sense to move to the new memory model now, which was anyway bound to happen. Also, with all the other changes coming up, we'll have to test the app thoroughly so it's a good time to do this. This change has been tested successfully on Android. On iOS most of the app works out of the box, and with @robbiehanson we think we can fix the remaining issues. |
Fixes build issue with the PhoenixCrypto module containing native logic used in the iosMain. See https://kotlinlang.org/docs/multiplatform-share-on-platforms.html#use-native-libraries-in-the-hierarchical-structure
…tore submissions with Bitcode embedded. So this should be removed.
…hoenixCrypto project. The linker complains with a warning about 13
Both libraries now use kotlin 1.6.21.
The old memory model based on freezing objects that moved between threads caused a lot of issues with Phoenix, especially on iOS. With the upgrade to kotlin 1.6, ktor 2.x and coroutines 1.6 it makes sense to also move to the new model which is much more workable than the old one. To do so we enable an experimental flag and use the adequate kotlinx coroutine library version. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md
|
Rebased and cleaned up, I think we're good to go! |
The old memory model based on freezing objects that moved between threads caused a lot of issues with Phoenix, especially on iOS. With the upgrade to kotlin 1.6, ktor 2.x and coroutines 1.6 it makes sense to also move to the new model which is much more workable than the old one. To do so we enable an experimental flag and use the adequate kotlinx coroutine library version. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md Co-authored-by: dpad85 <5765435+dpad85@users.noreply.github.com> Co-authored-by: Robbie Hanson <robbiehanson@deusty.com> Co-authored-by: sstone <fabrice.drouin@acinq.fr> (cherry picked from commit 30a82b2)
The old memory model based on freezing objects that moved between threads caused a lot of issues with Phoenix, especially on iOS. With the upgrade to kotlin 1.6, ktor 2.x and coroutines 1.6 it makes sense to also move to the new model which is much more workable than the old one.
To do so we enable an experimental flag and use the adequate kotlinx coroutine library version.
See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md