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

Test new Android overlay on the CI #151

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}-*-sdk.tar.xz
key: ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-sdk
key: ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-overlay-sdk
- name: Clone
uses: actions/checkout@v4
with:
Expand All @@ -106,10 +106,11 @@ jobs:
SDK=`pwd`/$SDK_NAME
tar xf ~/$SWIFT_TAG-ubuntu22.04.tar.gz
./$SWIFT_TAG-ubuntu22.04/usr/bin/swift --version
git apply swift-android-ci.patch
git apply -C1 swift-android.patch swift-android-both-ndks.patch
if [[ ${{ matrix.version }} = 'release'* ]]; then
git apply swift-android-tsc.patch swift-android-stdlib-except-trunk.patch
git apply swift-android-stdlib-except-trunk.patch
STUPID_FILE_RENAMING=Tool
else
sed -i "s%r26%ndk/26%" swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
Expand All @@ -129,6 +130,8 @@ jobs:
git apply -C0 swift-android-foundation-ndk26.patch
if [ ${{ matrix.version }} = 'release-26d' ]; then
git apply swift-android-stdlib-ndk26.patch
elif [ ${{ matrix.version }} = 'trunk' ]; then
git apply android-overlay/foundation-fixes.patch android-overlay/import-android.patch android-overlay/swift-argument-parser.patch android-overlay/swift-system-tag.patch android-overlay/yams.patch
fi
fi
sed -i "s%/data/data/com.termux/files%$SDK%" $SDK/usr/lib/pkgconfig/sqlite3.pc
Expand All @@ -141,7 +144,7 @@ jobs:
patchelf --set-rpath \$ORIGIN/../..:\$ORIGIN $SDK/usr/lib/swift/android/lib[FXs]*.so
tar cJf ~/${SDK_NAME/-release/-${{ matrix.version }}}.tar.xz $SDK_NAME
rm -rf build/ $SDK_NAME
rm -rf build/ $SDK_NAME llvm-project/
- name: Upload SDK
uses: actions/upload-artifact@v4
with:
Expand All @@ -155,6 +158,12 @@ jobs:
if [ ! -d ${{ steps.version.outputs.tag }}-ubuntu22.04 ]; then
tar xf ~/${{ steps.version.outputs.tag }}-ubuntu22.04.tar.gz
fi
if [ ${{ matrix.version }} = 'trunk' ]; then
sed -i "s%canImport(Glibc%canImport(Android%" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
sed -i "s%import Glibc%import Android%" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
sed -i "s%TSCBasic, would be nice%TSCBasic, would be %" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
fi
./${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift --version
tar xf ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}*-sdk.tar.xz
- name: Get Swift Argument Parser package
Expand All @@ -164,6 +173,9 @@ jobs:
path: swift-argument-parser
- name: Build Swift Argument Parser package
run: |
if [ ${{ matrix.version }} = 'trunk' ]; then
git apply sdk-config/android-overlay/swift-argument-parser.patch
fi
cd swift-argument-parser
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Swift crypto package
Expand All @@ -190,6 +202,12 @@ jobs:
git apply ../sdk-config/swift-nio-disable-ecn-tests.patch ../sdk-config/swift-nio-filesystem-both-ndks.patch
if [ ${{ matrix.version }} = 'release-25c' ]; then
git apply -R ../sdk-config/swift-nio-ndk26.patch
elif [ ${{ matrix.version }} = 'trunk' ]; then
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift package update
cd .build/checkouts/swift-system/
git apply ../../../../sdk-config/android-overlay/swift-system-checkout.patch
cd ../../..
git apply ../sdk-config/android-overlay/swift-nio.patch
fi
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Swift Numerics package
Expand All @@ -209,6 +227,9 @@ jobs:
- name: Build Swift System package
run: |
cd swift-system
if [ ${{ matrix.version }} = 'trunk' ]; then
git apply ../sdk-config/android-overlay/swift-system.patch
fi
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Swift Collections package
uses: actions/checkout@v4
Expand All @@ -233,6 +254,9 @@ jobs:
- name: Build Swift NIO SSH package
run: |
cd sns
if [ ${{ matrix.version }} = 'trunk' ]; then
git apply ../sdk-config/android-overlay/swift-nio-ssh.patch
fi
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Swift NIO SSL package
Expand All @@ -245,6 +269,8 @@ jobs:
cd snl
if [ ${{ matrix.version }} = 'release-25c' ]; then
sed -i "s%#include <time%#include <signal.h>\n#include <time%" Sources/CNIOBoringSSL/include/CNIOBoringSSL_asn1.h
elif [ ${{ matrix.version }} = 'trunk' ]; then
git apply ../sdk-config/android-overlay/swift-nio-ssl.patch
fi
SWIFTCI_USE_LOCAL_DEPS=1 ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Yams package
Expand All @@ -254,6 +280,9 @@ jobs:
path: yams
- name: Build Yams package
run: |
if [ ${{ matrix.version }} = 'trunk' ]; then
git apply sdk-config/android-overlay/yams.patch
fi
cd yams
sed -i "s% fixturesDirectory + \"/SourceKitten#289% \"/data/local/tmp/pack%" Tests/YamsTests/PerformanceTests.swift
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
Expand All @@ -266,6 +295,9 @@ jobs:
if: ${{ matrix.arch != 'armv7' }}
run: |
cd snh
if [ ${{ matrix.version }} = 'trunk' ]; then
git apply ../sdk-config/android-overlay/swift-nio-http2.patch
fi
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
- name: Get Swift Algorithms package
Expand Down
Loading
Loading