-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Kotlin 2.0.10 #628
base: master
Are you sure you want to change the base?
Conversation
Also upgraded: - ktor to 2.3.12 - kotlinx.serialisation to 1.7.2 (transitive) - kotlinx.coroutine to 1.9.0 (transitive) - kermit to 2.0.4 (transitive) - skie to 0.8.4 - sqldelight to 2.0.2
This is required for kotlin 2+.
This rule seems to cause a build issue with kotlin 2.0.
We are for now using Testnet3.
This script does not seem necessary anymore, as the framework copying is already done (require further investigation).
Unfortunately this breaks background payments on iOS: #324 On iOS, the notification-service-extension (which handles background payments) is limited to 24MB. Any allocation attempt that exceeds that hard limit causes a crash. The mimalloc algorithm may be theoretically faster, but it does so by over-allocating (in batches) which causes the app's maximum memory to balloon. In testing, it looks better than it was before. However, I can easily hit 22MB on a routine incoming payment. And a second payment will cause a crash. It's a little better if we set When I switch back to the standard memory allocator, we're using less than half the memory of mimalloc. Not only that, but the app is noticeably faster. The solution (for now) seems to be to disable caches on the native build. |
…ses issues on testnet builds
Plus: Fixing iOS build errors due to cache issues.
Kotlin 2.0.20 causes an issue on Phoenix iOS: ACINQ/phoenix#628 (comment).
Notes:
Also:
That error is due to the Removing that cache configuration triggers another error, |
This PR upgrades Kotlin as well as some other libraries to Kotlin 2.0.10. This upgrade is required due to side effects of iOS 18 and Xcode 16.
Issues found
iOS:
SKIE
does not support kotlin 2.0.20 yetWe have to use Kotlin 2.0.10 instead, although
lightning-kmp
can keep using 2.0.20 without issues.kotlinx.serialisation
v1.7.2 is not compatibleThis is a side effect of SKIE.
kotlinx.serialisation
v1.7.2 requires Kotlin 2.0.20 (because they use the newkotlin.uuid.Uuid
object). In the meantime, we must usekotlinx.serialisation
v1.7.1.iOS: Framework script removed
In the build phases of
phoenix-ios-framework
we have a script that manually copied thephoenix-shared
framework (and DSYM) generated by gradle inphoenix-shared/build
into the XcodeDerivedData
folder for thephoenix-ios
application.This script now fails with Kotlin 2.0 because the files are already copied during the build process. @robbiehanson It should be investigated further but it seems this script is not needed anymore, and thus must be removed.
iOS: Odd cache error
An odd build error occurs in
:phoenix-shared:linkDebugFrameworkIosArm64
:/Users/xxx/.gradle/caches/modules-2/files-2.1/app.cash.sqldelight/coroutines-extensions-iosarm64/2.0.2/51f8ddc76a4aa3d45402f46017e7b8405a5f6761/coroutines-extensions is cached (in /Users/xxx/.konan/kotlin-native-prebuilt-macos-x86_64-2.0.10/klib/cache/ios_arm64-gSTATIC-pl/app.cash.sqldelight:sqldelight-coroutines-extensions/unspecified/1v8rzgt0jt9l5.30bg0yuy4wun9/app.cash.sqldelight:sqldelight-coroutines-extensions-cache/bin/libapp.cash.sqldelight:sqldelight-coroutines-extensions-cache.a), but its dependency isn't: /Users/xxx/.konan/kotlin-native-prebuilt-macos-x86_64-2.0.10/klib/common/stdlib
Although it's mentioned in the log, it does not seem linked to the sqldelight coroutine extension. This error is "fixed" by removing the
kotlinOptions.freeCompilerArgs += "-Xallocator=std"
inphoenix-shared/build.gradle.kts
.A similar report can be found here.