Skip to content

Commit dec23f2

Browse files
committed
Test new Android overlay on the CI
1 parent c7333f8 commit dec23f2

14 files changed

+3658
-2
lines changed

.github/workflows/sdks.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
uses: actions/cache@v4
8888
with:
8989
path: ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}-*-sdk.tar.xz
90-
key: ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-sdk
90+
key: ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-overlay-sdk
9191
- name: Clone
9292
uses: actions/checkout@v4
9393
with:
@@ -106,6 +106,7 @@ jobs:
106106
SDK=`pwd`/$SDK_NAME
107107
108108
tar xf ~/$SWIFT_TAG-ubuntu22.04.tar.gz
109+
./$SWIFT_TAG-ubuntu22.04/usr/bin/swift --version
109110
git apply swift-android-ci.patch
110111
git apply -C1 swift-android.patch swift-android-both-ndks.patch
111112
if [[ ${{ matrix.version }} = 'release'* ]]; then
@@ -129,6 +130,12 @@ jobs:
129130
git apply -C0 swift-android-foundation-ndk26.patch
130131
if [ ${{ matrix.version }} = 'release-26d' ]; then
131132
git apply swift-android-stdlib-ndk26.patch
133+
elif [ ${{ matrix.version }} = 'trunk' ]; then
134+
git apply android-overlay/modulemap.patch android-overlay/overlay.patch 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
135+
wget -q https://download.swift.org/tmp/pull-request/74027/849/ubuntu2004/PR-ubuntu2004.tar.gz
136+
tar xf PR-ubuntu2004.tar.gz
137+
rm -rf $SWIFT_TAG-ubuntu22.04/usr/
138+
mv usr/ $SWIFT_TAG-ubuntu22.04/
132139
fi
133140
fi
134141
sed -i "s%/data/data/com.termux/files%$SDK%" $SDK/usr/lib/pkgconfig/sqlite3.pc
@@ -141,7 +148,7 @@ jobs:
141148
patchelf --set-rpath \$ORIGIN/../..:\$ORIGIN $SDK/usr/lib/swift/android/lib[FXs]*.so
142149
143150
tar cJf ~/${SDK_NAME/-release/-${{ matrix.version }}}.tar.xz $SDK_NAME
144-
rm -rf build/ $SDK_NAME
151+
rm -rf build/ $SDK_NAME llvm-project/
145152
- name: Upload SDK
146153
uses: actions/upload-artifact@v4
147154
with:
@@ -154,7 +161,14 @@ jobs:
154161
155162
if [ ! -d ${{ steps.version.outputs.tag }}-ubuntu22.04 ]; then
156163
tar xf ~/${{ steps.version.outputs.tag }}-ubuntu22.04.tar.gz
164+
if [ ${{ matrix.version }} = 'trunk' ]; then
165+
wget -q https://download.swift.org/tmp/pull-request/74027/849/ubuntu2004/PR-ubuntu2004.tar.gz
166+
tar xf PR-ubuntu2004.tar.gz
167+
rm -rf ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/
168+
mv usr/ ${{ steps.version.outputs.tag }}-ubuntu22.04/
169+
fi
157170
fi
171+
./${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift --version
158172
159173
tar xf ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}*-sdk.tar.xz
160174
- name: Get Swift Argument Parser package
@@ -164,6 +178,9 @@ jobs:
164178
path: swift-argument-parser
165179
- name: Build Swift Argument Parser package
166180
run: |
181+
if [ ${{ matrix.version }} = 'trunk' ]; then
182+
git apply sdk-config/android-overlay/swift-argument-parser.patch
183+
fi
167184
cd swift-argument-parser
168185
../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
169186
- name: Get Swift crypto package
@@ -190,6 +207,12 @@ jobs:
190207
git apply ../sdk-config/swift-nio-disable-ecn-tests.patch ../sdk-config/swift-nio-filesystem-both-ndks.patch
191208
if [ ${{ matrix.version }} = 'release-25c' ]; then
192209
git apply -R ../sdk-config/swift-nio-ndk26.patch
210+
elif [ ${{ matrix.version }} = 'trunk' ]; then
211+
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift package update
212+
cd .build/checkouts/swift-system/
213+
git apply ../../../../sdk-config/android-overlay/swift-system-checkout.patch
214+
cd ../../..
215+
git apply ../sdk-config/android-overlay/swift-nio.patch
193216
fi
194217
../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
195218
- name: Get Swift Numerics package
@@ -209,6 +232,9 @@ jobs:
209232
- name: Build Swift System package
210233
run: |
211234
cd swift-system
235+
if [ ${{ matrix.version }} = 'trunk' ]; then
236+
git apply ../sdk-config/android-overlay/swift-system.patch
237+
fi
212238
../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
213239
- name: Get Swift Collections package
214240
uses: actions/checkout@v4
@@ -233,6 +259,9 @@ jobs:
233259
- name: Build Swift NIO SSH package
234260
run: |
235261
cd sns
262+
if [ ${{ matrix.version }} = 'trunk' ]; then
263+
git apply ../sdk-config/android-overlay/swift-nio-ssh.patch
264+
fi
236265
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
237266
../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
238267
- name: Get Swift NIO SSL package
@@ -245,6 +274,8 @@ jobs:
245274
cd snl
246275
if [ ${{ matrix.version }} = 'release-25c' ]; then
247276
sed -i "s%#include <time%#include <signal.h>\n#include <time%" Sources/CNIOBoringSSL/include/CNIOBoringSSL_asn1.h
277+
elif [ ${{ matrix.version }} = 'trunk' ]; then
278+
git apply ../sdk-config/android-overlay/swift-nio-ssl.patch
248279
fi
249280
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
250281
- name: Get Yams package
@@ -254,6 +285,9 @@ jobs:
254285
path: yams
255286
- name: Build Yams package
256287
run: |
288+
if [ ${{ matrix.version }} = 'trunk' ]; then
289+
git apply sdk-config/android-overlay/yams.patch
290+
fi
257291
cd yams
258292
sed -i "s% fixturesDirectory + \"/SourceKitten#289% \"/data/local/tmp/pack%" Tests/YamsTests/PerformanceTests.swift
259293
../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
@@ -266,6 +300,9 @@ jobs:
266300
if: ${{ matrix.arch != 'armv7' }}
267301
run: |
268302
cd snh
303+
if [ ${{ matrix.version }} = 'trunk' ]; then
304+
git apply ../sdk-config/android-overlay/swift-nio-http2.patch
305+
fi
269306
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
270307
../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
271308
- name: Get Swift Algorithms package

0 commit comments

Comments
 (0)