Skip to content

Fix portable Swift runtime linking in UIKit klibs - #3274

Open
Vendula Švastalová (svastven) wants to merge 1 commit into
jb-mainfrom
svastven/ui-uikit-gradle-fix
Open

Fix portable Swift runtime linking in UIKit klibs#3274
Vendula Švastalová (svastven) wants to merge 1 commit into
jb-mainfrom
svastven/ui-uikit-gradle-fix

Conversation

@svastven

@svastven Vendula Švastalová (svastven) commented Jul 29, 2026

Copy link
Copy Markdown

Avoid publishing Xcode path in the UIKit swiftUtils KLib metadata.
The Swift runtime library names remain portable linker requirements in swiftUtils.def. And the active Xcode toolchain's Swift compatibility library directory is resolved lazily at final iOS link time.

Fixes CMP-10607 Resolve Swift compatibility libraries from the consumer’s active Xcode during iOS linking

Release Notes

N/A

@svastven
Vendula Švastalová (svastven) force-pushed the svastven/ui-uikit-gradle-fix branch 4 times, most recently from c797150 to ff2401b Compare August 1, 2026 11:39
.asText
.map { swiftcPath ->
File(swiftcPath.trim())
.parentFile

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like xcrun --sdk [SDK_NAME] --show-toolchain-path can already give us

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

and then we can just resolve to usr/lib/swift/$sdkName

}
}

private fun KotlinNativeTarget.configureSwiftCompatibilityLinking() {

@hub-bla Hubert Błaszczyk (hub-bla) Aug 28, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment that explain the purpose of it?

My understanding so far is that Kotlin/Native doesn't know about this folder when linking. Because of that we are forced to create this logic not only in cmp-core but also inside our compose plugin.

Ideally, Kotlin/Native could take care of this automatically, since it already resolves the path to the linker from the toolchain.

https://youtrack.jetbrains.com/issue/KT-69793 seems related. Maybe we can ask the Kotlin/Native team to add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants