SKIE fails to build because of what seems to be an...
# touchlab-tools
j
SKIE fails to build because of what seems to be an issue in generated Swift code. Googling the error leads to an outdated Swift version that doesn't support
if let
yet, but I don't know how to set the SKIE Swift version (if that's even possible!)
Copy code
e: java.lang.IllegalStateException: The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc command returned non-zero exit code: 1.
output:
warning: ignoring '-enable-batch-mode' because '-whole-module-optimization' was also specified
/Users/jenkins/actions-runner/_work/shared-appie/shared-appie/shared/build/skie/binaries/releaseFramework/RELEASE/iosArm64/swift/generated/Skie/Skie.Skie_SuspendResult.swift:29:19: error: variable binding in a condition requires an initializer
    if let sealed {
                  ^
	at co.touchlab.skie.util.Command.handleExitCode(Command.kt:102)
	at co.touchlab.skie.util.Command.execute(Command.kt:85)
	at co.touchlab.skie.util.Command.execute$default(Command.kt:57)
	at co.touchlab.skie.phases.swift.CompileSwiftPhase.callSwiftCompiler(CompileSwiftPhase.kt:137)
The repository almost doesn't have any code, just the default KMP project's
Platform
class and a class
Greeting
with two synchronous functions returning a string and one suspendable that also returns a string (but after 5 seconds). Locally integrating (compiling, linking and such) it into an XCode project works fine. Using SKIE 0.6.1 + Kotlin 1.9.22. Only put SKIE inside
plugins{}
block, nothing else.
f
Hi! SKIE doesn’t support old Swift versions so the only way to resolve this issue is to compile the project with a newer Swift (Xcode) version. SKIE itself doesn’t explicitly choose which Xcode version it will use - it uses the same Xcode as the Kotlin compiler. In your case it uses this toolchain:
Copy code
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
So you can either update the Xcode. Or if you have multiple xcode versions installed you can configure the KMP plugin to use that version
j
Thanks @Filip Dolník! It felt like something like that. I've been searching the docs at https://skie.touchlab.co/Installation (and other pages) but can't find how to configure the XCode version (I'm not sure if we have multiple installed yet) Or should it be a general KMP setting?
Btw: maybe it would be nice if it would check what version of the XCode toolchain is being invoked and report an error (like Compose Compiler does with the Kotlin version) 📈
f
> I’ve been searching the docs at https://skie.touchlab.co/Installation (and other pages) but can’t find how to configure the XCode version (I’m not sure if we have multiple installed yet) Yeah, that’s because that’s controlled by the compiler and not SKIE. I’m not sure what is the proper way for configuring the Xcode. But I’d start by trying the
DEVELOPER_DIR
environment variable (for example: https://support.macincloud.com/support/solutions/articles/8000042681-how-to-utilize-a-di[…]xcode-version-for-build-process-on-macincloud-mac-servers > Btw: maybe it would be nice if it would check what version of the XCode toolchain is being invoked and report an error (like Compose Compiler does with the Kotlin version) 📈 We plan something like that, but it’s blocked by testing which Swift/Xcode versions are supported - our tests currently use only the most recent version. (So we need to first solve the tests and then we can add the explicit error)
👍 1
t
@Jacob Ras Try running
xcode-select -p
. It'll show you the toolchain that's currently selected. It should point to your installed Xcode. If it doesn't use
sudo xcode-select -s /Applications/Xcode.app
to point it there.
What version of Xcode do you have installed?
j
It turned out I found the only Mac Mini in our fleet of overpriced build machines that wasn't updated to 15 🥲 I verified we only used that one for Android until now, so I could safely update it to 15 (after updating the complete OS first, because Apple). Then it worked 🚀
😄 1