Hi! We're running into build failures when enablin...
# touchlab-tools
p
Hi! We're running into build failures when enabling Swift 6 (
-swift-version 6
via
freeSwiftCompilerArgs
) with SKIE 0.10.9. The errors are in SKIE-generated Swift files: •
Skie.AsyncStreamDispatcherDelegate.swift:14
— "sending 'block' risks causing data races" (task-isolated value passed as a
sending
parameter) •
Skie.SwiftCoroutineDispatcher.swift:15
— "capture of 'cancellationHandler' with non-sendable type 'Skie_CancellationHandler' in a '@Sendable' closure" Both are strict concurrency violations in the generated coroutines interop code. We're using Kotlin 2.3.0, AGP 8.13.0, and Gradle 9.0.0. Is this a known issue? Are there any plans or a timeline for Swift 6 strict concurrency support in SKIE? Thank you!
fixedtape 1
f
When facing this issue; use @preconcurrency next to your import declaration
p
Hi @François, thanks for your response but we are not using any Swift code bundling in this KMP project. Where would I put @preconcurrency?
The problem occurs when compiling the KMP library
f
@preconcurrency import Shared
FYI, it's not only SKIE; it's the whole generated code from KMP; as it's ObjC code and not Swift
oh, you don"t need to add ``freeSwiftCompilerArgs`` on your shared module
p
How would you support swift 6 then if 5 is the default?
f
The generated code from KMP is ObjC code, there are not
strict concurrency
; so skie don"t need to also be
strict concurrency
it's on the consumer side, the app, to use a different version of Swift
p
But we are producing an artifact and uploading it to Artifactory
f
Swift 5 should be compatible with swift 6
p
hmm so you're saying that it's not necessary to compile for Swift 6?
f
yes, not necessary
p
Hmm, then I was misled by our iOS devs 😅 I will ask them...
But is it possible then to compile to Swift 6 when producing an artifact?
f
but
@preconcurrency
is sometimes required
p
Good to know.
f
do you want to distribute your library ?
p
Yes, we want to distribute it to SPM
f
Swit 5 is compatible with swift 6. but sometimes because of the strict concurrency, the consumer need to use
@preconcurrency
that's not really clean, I know
we need to wait for Swift-export
K 1
I think this is what you are looking for
p
I understand. Thanks a lot Franc, you saved me a lot of time 🙏 I will check out the discussion!
I guess I should invalidate my ticket then?
f
Yes I think so
❤️ 1