Skip to content

[android] Build Android Embedded Swift stdlib - #582

Draft
finnvoor wants to merge 1 commit into
swiftlang:mainfrom
finnvoor:android-embedded-stdlib
Draft

[android] Build Android Embedded Swift stdlib#582
finnvoor wants to merge 1 commit into
swiftlang:mainfrom
finnvoor:android-embedded-stdlib

Conversation

@finnvoor

@finnvoor finnvoor commented Jul 22, 2026

Copy link
Copy Markdown

Adds an -embedded variant of the android sdk.

Depends on swiftlang/swift#90768 and swiftlang/swift#90886

cc @finagolfin

@finagolfin

Copy link
Copy Markdown
Member

Thanks, have you tried building this yourself and using the resulting SDK bundle?

@finagolfin

Copy link
Copy Markdown
Member

Never mind, see that you did.

@finagolfin

Copy link
Copy Markdown
Member

I wonder if we should register the embedded SDK as a separate SDK bundle, like I think wasm does. That way, there is no collision between the target triples.

Register a second Android SDK in the artifact bundle, matching the Wasm
layout. The regular SDK points at swift-sdk.json and the embedded SDK
points at embedded-swift-sdk.json in the same content tree, with an
Android embedded toolset that enables Embedded Swift, whole-module
optimization, lld, and Android linker flags.
@finnvoor

Copy link
Copy Markdown
Author

Makes sense, tried that and tested locally and the SDK layout works (finnvoor@9df7edc), but I ran into an Android-specific Swift Build issue: the Android platform plugin currently overrides SDK toolsets with overrideToolsetAbsolutePaths: [], so the embedded-toolset.json from the -embedded SDK is ignored. Passing the same toolset explicitly works, so the packaging is fine, but the SDK-bundled toolset is not applied for Android yet. So just running swift build --swift-sdk <sdk-id>_android-embedded --triple aarch64-unknown-linux-android23 doesn't apply the embedded toolset yet.

@finagolfin

Copy link
Copy Markdown
Member

Yeah, that is a known issue that I just discussed with the author of that internal build logic: I will try to re-enable toolsets for Android soon, then we'll see if this works with your new config. Meanwhile, keep this pull ready with whatever config you need, don't see any new toolset added here yet?

@finnvoor
finnvoor force-pushed the android-embedded-stdlib branch from a82173d to 9df7edc Compare July 22, 2026 20:33
@finnvoor

Copy link
Copy Markdown
Author

sounds good, PR updated with standalone embedded sdk. Everything should work once the toolset makes it through swift build.

@finnvoor finnvoor changed the title [android] Build and bundle the Embedded Swift stdlib [android] Build Android Embedded Swift stdlib Jul 23, 2026
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