Support linux-gnu host compilation for skip export; enable Linux CI matrix#31
Merged
Merged
Conversation
…atrix skip export runs a host-platform swift build in which the skipstone plugin performs its transpile/bridging analysis. On a Linux CI host that build compiles this package's non-Android branch, which currently assumes Darwin: - Logger: neither AndroidLogging nor OSLog exists on linux-gnu — add a compile-only shim in the final #else (never compiled on Android or Darwin). - URL.applicationSupportDirectory: missing from Linux Foundation — extend the existing Android guard to os(Linux). - AndroidBundle subclasses Bundle, which Linux corelibs cannot inherit from — scope the file to the platforms that use it (Android/Robolectric/Darwin). - AndroidLocalizedStringResource: scope the two AndroidBundle-typed convenience inits the same way. Enable the Linux element of the CI test matrix (ubuntu-24.04) in ci.yml, matching skip-bridge and the other frameworks that build/test on Linux. Export stays enabled, which is what these source changes make possible. No behavior change on Android or Darwin: every source edit only affects what the linux-gnu host pass compiles. macOS swift build verified green.
|
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) @WiesnerPeti 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 |
Member
|
For the Linux CI failure: ...you can probably just gate it with |
Contributor
Author
|
recheck |
SkipAndroidBridgeSamples is also compiled by the skip export host pass on the Linux CI runner. LocalizedStringResource exists in Darwin's and the Android SDK's Foundation but not in linux-gnu Foundation, so the host compile failed with 'cannot find type LocalizedStringResource in scope'. Keep the function present on every platform (so host bridging analysis still sees it) and swap only the LocalizedStringResource-dependent body on the non-Android Linux host, returning the literal key directly.
…ux-gnu With the Linux runner in the matrix, the non-Android/non-Robolectric branch now also runs on the linux-gnu host, where swift-corelibs-Foundation names the bundle class 'Bundle' rather than Darwin's 'NSBundle'. Accept either prefix off-Darwin so the test passes on Linux while keeping the strict NSBundle assertion on Darwin.
Member
|
Great contribution, thanks! |
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.
skip exportruns a host-platformswift buildin which the skipstone plugin performs its transpile/bridging analysis. On a Linux CI host that build compiles this package's non-Android branch, which currently assumes Darwin. This PR makes that linux-gnu host pass compile and activates the Linux element of the CI test matrix.Source changes
AndroidLoggingnorOSLogexists on linux-gnu — add a compile-only shim in the final#else(never compiled on Android or Darwin).URL.applicationSupportDirectory: missing from Linux Foundation — extend the existing Android guard toos(Linux).AndroidBundle: subclassesBundle, which Linux corelibs cannot inherit from — scope the file to the platforms that use it (Android/Robolectric/Darwin).AndroidLocalizedStringResource: scope the twoAndroidBundle-typed convenience inits the same way.CI change
Uncomment the
runs-online in.github/workflows/ci.ymlto addubuntu-24.04to the matrix, matchingskip-bridgeand the other frameworks that build/test on Linux. Export stays enabled — that's what the source changes above make possible.Safety
No behavior change on Android or Darwin: every source edit only affects what the linux-gnu host pass compiles. macOS
swift buildverified green.