Use prebuilt static-MUSL skip binary target on Android hosts - #725
Open
hpr wants to merge 2 commits into
Open
Conversation
os(Android) is distinct from os(Linux) in Swift compilation conditions, so on Android hosts (e.g. Termux/bionic) the manifest fell through to the else branch and built skipstone + SwiftSyntax from source. That host build is enormous memory-wise and the static MUSL binary runs fine on bionic, so use the binary target there too.
|
Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @hpr on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file |
This was referenced Aug 18, 2026
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Package.swiftselects the skip transpiler like this:#if os(macOS)→ prebuilt macOS binary target#elseif os(Linux)→ prebuilt static-MUSLskip-linux.zipbinary target#else→ build skipstone (+ SwiftSyntax) from sourceSwift's compilation conditions treat Android as
os(Android), notos(Linux), so on Android hosts (e.g. Termux/bionic) the manifest falls through to the#elsebranch and builds skipstone + SwiftSyntax 602 from source. That host build spikes 5–8 GB RSS in single swift-frontend processes, which OOM-kills typical Android devices.Fix
Change the condition to
#elseif os(Linux) || os(Android). The published static-MUSLskipbinary itself runs fine on bionic (verified on-device, aarch64 Termux:skip versionworks via the binary target).Companion PR
The published
skip-linux.zipartifactbundle currently declares only*-unknown-linux-gnuin itsinfo.jsonsupportedTriples, so SwiftPM on an Android host still rejects the binary target ("Tool 'skip' is not supported on the target platform"). That list is generated bybuild_linux_plugin.shat release time; skiptools/skipstone#266 adds the Android host triples (*-unknown-linux-android,*-unknown-linux-android24) so future releases work out of the box. (I verified the end-to-end flow by repacking the 1.9.5skip-linux.zipwith the Android triples added;swift buildthen picks the binary target and skipstone/SwiftSyntax leave the dependency graph entirely.)Testing
This is a host-platform manifest condition, so there is no meaningful unit test for it (the repo's tests exercise the skip tool itself). Verified manually on-device (aarch64 Android/Termux, Swift 6.3.2 Android toolchain): with the condition fix + a triples-extended artifactbundle,
swift builduses the prebuilt binary and no host SwiftSyntax build occurs.