Hi :slightly_smiling_face: we’re running into a bu...
# touchlab-tools
b
Hi 🙂 we’re running into a build issue with
coroutinesInterop
enabled using the SKIE library. Error message:
Compilation failed: The /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc command returned non-zero exit code: 1.
This error only occurs when we set coroutinesInterop to true and happens specifically during the kotlin framework compilation, in the linking step. We’re new to SKIE and trying out coroutinesInterop, but haven’t been able to get it working yet. We initially stared with the enums feature and it works without issues. Versions: * SKIE Version: 0.9.3 * Kotlin Version: 2.0.20 * Xcode Version: 16.0 Gradle Setup:
Copy code
skie {
    features {
        group("co.touchlab.skie.types") {
            SealedInterop.Enabled(true)
            coroutinesInterop.set(true)
            SuspendInterop.Enabled(true)
            FunctionInterop.FileScopeConversion.Enabled(false)
        }
    }
}
We’ve also posted this on github (https://github.com/touchlab/SKIE/issues/118) but wanted to ask here in case anyone has tips or has run into similar issue. Any advice or workarounds would be greatly appreciated. Thanks!
t
Hi, could you run the task with
--info
and share more of the swiftc error? You should also be able to navigate to
build/skie/binaries/debugFramework/DEBUG/iosSimulatorArm64/debug/logs
and there should be
swiftc.log
file which should contain more details. Please share those so we can see what the error is
a
Kotlin 2.0.20 doesn't support Xcode 16. But 2.0.21 does
d
I work on the same project as @Benjamin Sejdic, here's some more context:
Copy code
error: Compilation failed: The /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc command returned non-zero exit code: 1.
output:
/Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift/generated/Watch/Watch.WatchManager.swift:17:19: error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
15 |     public func doInitWatch(watch: watch.Watch) async throws -> Swift.Void {
16 |         return try await SwiftCoroutineDispatcher.dispatch {
17 |             watch.__SkieSuspendWrappersKt.Skie_Suspend__231__initWatch(dispatchReceiver: self, watch: watch, suspendHandler: $0)
                   `- error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
18 |         }
19 |     }

 * Source files: 
 * Compiler version: 2.0.21
 * Output kind: FRAMEWORK
t
Thanks. If you try setting
FunctionInterop.FileScopeConversion.Enabled(false)
to
true
instead, does it compile?
d
That actually just increased the errors 😕
Copy code
$ diff /Users/david/Downloads/swiftc.log  /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/debug/logs/swiftc.log 
49a50,69
> /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name watch -import-underlying-module -F /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/cache/kotlin-framework -F /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/fake-objc-frameworks -verify-emitted-module-interface -emit-module -emit-module-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/headers/watch.swiftmodule -emit-objc-header -emit-objc-header-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/headers/watch-Swift.h -emit-object -parse-as-library -enable-batch-mode -Onone -incremental -output-file-map /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/config/OutputFileMap.json -g -module-cache-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/cache/swift-module-cache -swift-version 5 -j9 -sdk /Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -target arm64-apple-ios15.0  @/Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/config/watch.SwiftFileList
> 
> 
> /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift/generated/Watch/Watch.WatchManager.swift:17:19: error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
> 15 |     public func doInitWatch(watch: watch.Watch) async throws -> Swift.Void {
> 16 |         return try await SwiftCoroutineDispatcher.dispatch {
> 17 |             watch.__SkieSuspendWrappersKt.Skie_Suspend__231__initWatch(dispatchReceiver: self, watch: watch, suspendHandler: $0)
>    |                   `- error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
> 18 |         }
> 19 |     }
> /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name watch -import-underlying-module -F /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/cache/kotlin-framework -F /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/fake-objc-frameworks -verify-emitted-module-interface -emit-module -emit-module-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/headers/watch.swiftmodule -emit-objc-header -emit-objc-header-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/headers/watch-Swift.h -emit-object -parse-as-library -enable-batch-mode -Onone -incremental -output-file-map /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/config/OutputFileMap.json -g -module-cache-path /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/cache/swift-module-cache -swift-version 5 -j9 -sdk /Applications/Xcode-16.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -target arm64-apple-ios15.0  @/Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift-compiler/config/watch.SwiftFileList
> 
> 
> /Users/david/fest/mobilewatchapps/Android/watch/build/skie/binaries/debugFramework/DEBUG/iosArm64/swift/generated/Watch/Watch.WatchManager.swift:17:19: error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
> 15 |     public func doInitWatch(watch: watch.Watch) async throws -> Swift.Void {
> 16 |         return try await SwiftCoroutineDispatcher.dispatch {
> 17 |             watch.__SkieSuspendWrappersKt.Skie_Suspend__231__initWatch(dispatchReceiver: self, watch: watch, suspendHandler: $0)
>    |                   `- error: value of type 'Watch' has no member '__SkieSuspendWrappersKt'
> 18 |         }
> 19 |     }
t
Last thing, could you try removing the whole
features
block:
Copy code
features {
        group("co.touchlab.skie.types") {
            SealedInterop.Enabled(true)
            coroutinesInterop.set(true)
            SuspendInterop.Enabled(true)
            FunctionInterop.FileScopeConversion.Enabled(false)
        }
    }
That should run SKIE in the default mode
Also why are you using
co.touchlab.skie.types
package?
d
Probably just grabbed the wrong snippet, I'll try with just
group
t
try without configuring it first, that'll give us a baseline
d
Should I keep an empty
skie
?
Copy code
skie { }
t
Yeah that's fine
👍 1
Also
coroutinesInterop
should be outside of any
group
as it's for
features
block. We should probably add DSL annotations
👍 1
d
Ok, so now I got even more errors, but still kinda the same type, from
__SkieSuspendWrappersKt
swiftc.log
t
Is your framwork called Watch with a Watch class in it by any chance?
d
yeah, that would be the case
t
That's weird, SKIE should be printing a warning in the Gradle log about it and rename
Watch
to
Watch_
(it's a limitation of Swift)
Oh I see what's happening in your case
Your framework is
watch
and the class is
Watch
which is fine, but the parameter to
doInitWatch
is
watch
and therefore it conflicts
That's an interesting bug and should be straightforward to fix
d
ahh, yeah right
the argument collides with the framework name?
t
Yup
Because Swift prefers argument name when resolving and SKIE needs to access everything using the framework name
We'll need to add a check for any Swift we generate that when it has a parameter and if that parameter is called the same as the framework, we need to add a label and rename the parameter. So in this case it should generate
public func doInitWatch(watch watch_: watch.Watch)
d
yeah, sounds like a good idea!
t
In the meantime, you can disable suspend interop for that class that's failing (or rename either the framework to something like
WatchKit
or the parameter)
✅ 2
thank you frog 1