Skip to content

Commit b364c93

Browse files
committed
Try testing against emulator API level 23
1 parent f4aa58c commit b364c93

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/pull_request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
echo 'import FoundationNetworking' >> Sources/DemoProject/DemoProject.swift
157157
echo 'import Dispatch' >> Sources/DemoProject/DemoProject.swift
158158
echo 'import Android' >> Sources/DemoProject/DemoProject.swift
159+
159160
- name: Test Demo Project on Android
160161
uses: skiptools/swift-android-action@main
161162
if: ${{ matrix.runner != 'self-hosted' }}
@@ -165,6 +166,7 @@ jobs:
165166
package-path: ${{ runner.temp }}/DemoProject
166167
installed-sdk: ${{ steps.info.outputs.sdk-id }}
167168
installed-swift: ${{ steps.info.outputs.swift-root }}
169+
android-api-level: 23
168170

169171
- name: Checkout swift-algorithms
170172
if: ${{ matrix.runner != 'self-hosted' }}
@@ -179,6 +181,7 @@ jobs:
179181
package-path: swift-algorithms
180182
installed-sdk: ${{ steps.info.outputs.sdk-id }}
181183
installed-swift: ${{ steps.info.outputs.swift-root }}
184+
android-api-level: 23
182185

183186
- name: Checkout swift-system
184187
if: ${{ matrix.runner != 'self-hosted' }}
@@ -193,6 +196,7 @@ jobs:
193196
package-path: swift-system
194197
installed-sdk: ${{ steps.info.outputs.sdk-id }}
195198
installed-swift: ${{ steps.info.outputs.swift-root }}
199+
android-api-level: 23
196200

197201
- name: Checkout swift-collections
198202
if: ${{ matrix.runner != 'self-hosted' }}
@@ -207,4 +211,5 @@ jobs:
207211
package-path: swift-collections
208212
installed-sdk: ${{ steps.info.outputs.sdk-id }}
209213
installed-swift: ${{ steps.info.outputs.swift-root }}
214+
android-api-level: 23
210215

swift-ci/sdks/android/scripts/fetch-source.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,25 +162,21 @@ git checkout ${BORINGSSL_VERSION}
162162
popd >/dev/null 2>&1
163163
groupend
164164

165-
groupstart "Patchin Sources"
165+
groupstart "Patching Sources"
166166
# This `git grep` invocation in a trunk test fails in our Docker for some
167167
# reason, so just turn it into a plain `grep` again.
168168
perl -pi -e 's:"git",:#:' swift-project/swift/test/Misc/verify-swift-feature-testing.test-sh
169169

170170
# Work around swiftlang/swift-driver#1822 for now
171171
perl -pi -g -we "s#(call rm ... \".\{LIBDISPATCH_BUILD_DIR\}\"\n(\s+)fi\n)#\1\2if [[ -d \"\\\${ANDROID_NDK}\" ]]; then call ln -sf \"\\\${SWIFT_BUILD_PATH}/lib/swift\" \"\\\${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib\"; fi#" swift-project/swift/utils/build-script-impl
172172

173-
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
174-
perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' swift-project/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
175-
176173
# Disable posix_spawnattr_* calls for Android API 24
177174
perl -pi -e 's;try _throwIfPosixError\(posix_spawnattr_init;//try _throwIfPosixError\(posix_spawnattr_init;g' swift-project/swift-corelibs-foundation/Sources/Foundation/Process.swift
178175
perl -pi -e 's;try _throwIfPosixError\(posix_spawnattr_setflags;//try _throwIfPosixError\(posix_spawnattr_setflags;g' swift-project/swift-corelibs-foundation/Sources/Foundation/Process.swift
179176
perl -pi -e 's;posix_spawnattr_destroy;//posix_spawnattr_destroy;g' swift-project/swift-corelibs-foundation/Sources/Foundation/Process.swift
180177

181-
# fix getgrgid_r and getgrnam_r missing from Android API 23
182-
perl -pi -e 's;getgrgid_r;{ _, _, _, _, _ in 0 };g' swift-project/swift-foundation/Sources/FoundationEssentials/Platform.swift
183-
perl -pi -e 's;getgrnam_r;{ _, _, _, _, _ in 0 };g' swift-project/swift-foundation/Sources/FoundationEssentials/Platform.swift
178+
# Stub out getgrgid_r and getgrnam_r missing from Android API 23
179+
perl -pi -e 's;getgrgid_r|getgrnam_r;{ _, _, _, _, _ in 0 };g' swift-project/swift-foundation/Sources/FoundationEssentials/Platform.swift
184180

185181
groupend
186182

0 commit comments

Comments
 (0)