Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put together SDK bundles on the CI #180

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Put together SDK bundles on the CI #180

merged 1 commit into from
Oct 15, 2024

Conversation

finagolfin
Copy link
Owner

I experimented a bit with getting executables linked with the static stdlib also.

@lhoward
Copy link

lhoward commented Oct 12, 2024

Dumb question – how will the SDK bundle (if it’s a Swift SDK?) know where the NDK is installed?

@finagolfin
Copy link
Owner Author

I'm bundling the NDK sysroot with this SDK bundle, so you will no longer have to download the NDK separately. 😃 That cross-compiles fine for me locally on linux, but I will run it through the CI here to make sure it works well before releasing.

@finagolfin finagolfin force-pushed the bundle branch 20 times, most recently from 1d0d2dc to fb8cdc2 Compare October 14, 2024 20:57
Employ the latest SwiftPM destination config format too when testing single-arch SDKs before
assembling the bundle.
- name: Get cached SDK bundle
id: cache-bundle
uses: actions/cache@v4
if: ${{ matrix.version != 'trunk' }}
Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm seeing strange errors when trying to build packages with the new trunk 6.1 SDK bundle, so I'm disabling using it on the CI until that's fixed.

cp sdk-config/swift-*-android-x86_64-*${ANDROID_API_LEVEL}-sdk/usr/lib/swift/android/lib*so pack
else
cp ~/.${{ startsWith(matrix.os, 'ubuntu') && 'config/' || '' }}swiftpm/swift-sdks/${{ steps.version.outputs.tag }}-android-${ANDROID_API_LEVEL}-*.artifactbundle/swift*sdk/android*sysroot/usr/lib/$(echo ${{ matrix.arch }} | sed "s/v7//")-linux-android*/${ANDROID_API_LEVEL}/lib*so pack
rm pack/lib{c,dl,log,m}.so
Copy link
Owner Author

@finagolfin finagolfin Oct 15, 2024

Choose a reason for hiding this comment

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

@marcprux, these are stub libraries provided by the NDK just for linking, so I remove them so the Swift SDK libraries don't use them by mistake instead when running on the emulator.

There is also a stub libz.so which collides with the Termux libz.so you recently added, so I put the latter in it's own termux-zlib/ directory in the SDK bundle below.

Since that is only needed when running the Foundation{Networking,XML} libraries, which I don't test on the CI, I don't bother with libz.so here, but you will have to also throw out that stub and use the Termux one if testing these extra Foundation libraries.

@finagolfin finagolfin merged commit ecd0eea into main Oct 15, 2024
18 checks passed
@finagolfin finagolfin deleted the bundle branch October 15, 2024 08:56
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