Conversation
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. |
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, |
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.
This script does not seem necessary anymore, as the framework copying is already done (require further investigation).
Plus: Fixing iOS build errors due to cache issues.
|
Superseded by #654. |
Kotlin 2.0.20 causes an issue on Phoenix iOS: ACINQ/phoenix#628 (comment).
Kotlin 2.0.20 causes an issue on Phoenix iOS: ACINQ/phoenix#628 (comment).

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:
SKIEdoes not support kotlin 2.0.20 yetWe have to use Kotlin 2.0.10 instead, although
lightning-kmpcan keep using 2.0.20 without issues.kotlinx.serialisationv1.7.2 is not compatibleThis is a side effect of SKIE.
kotlinx.serialisationv1.7.2 requires Kotlin 2.0.20 (because they use the newkotlin.uuid.Uuidobject). In the meantime, we must usekotlinx.serialisationv1.7.1.iOS: Framework script removed
In the build phases of
phoenix-ios-frameworkwe have a script that manually copied thephoenix-sharedframework (and DSYM) generated by gradle inphoenix-shared/buildinto the XcodeDerivedDatafolder for thephoenix-iosapplication.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/stdlibAlthough 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.