Skip to content

Commit d0d85bb

Browse files
committed
Fix patch application
1 parent c01a313 commit d0d85bb

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

swift-ci/sdks/android/build-docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ source ./scripts/toolchain-vars.sh
2727

2828
# Check-out and patch the sources
2929
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
30-
${WORKDIR}/patches/apply-patches.sh ${WORKDIR}/source/swift-project
30+
./patches/apply-patches.sh ${WORKDIR}/source/swift-project
3131

3232
mkdir -p ${WORKDIR}/products
3333
chmod ugo+rwx ${WORKDIR}/products

swift-ci/sdks/android/build-local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fi
5252

5353
# Check-out and patch the sources
5454
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
55-
${WORKDIR}/patches/apply-patches.sh ${WORKDIR}/source/swift-project
55+
./patches/apply-patches.sh ${WORKDIR}/source/swift-project
5656

5757
mkdir -p ${WORKDIR}/products
5858

swift-ci/sdks/android/patches/apply-patches.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@
33
patches_dir=$(dirname $(realpath -- "${BASH_SOURCE[0]}"))
44
cd ${1}
55

6-
# patch the patch, which seems to only be needed for an API less than 28
7-
# https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110
8-
perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' ${patches_dir}/swift-android.patch
9-
10-
# remove the need to link in android-execinfo
11-
perl -pi -e 's;dispatch android-execinfo;dispatch;g' ${patches_dir}/swift-android.patch
12-
136
case "${BUILD_SCHEME}" in
14-
release)
15-
git apply -v -C1 ${patches_dir}/swift-android.patch
16-
git apply -v -C1 ${patches_dir}/swift-android-testing-release.patch
17-
;;
187
swift-*-branch)
198
git apply -v -C1 ${patches_dir}/swift-android.patch
209
git apply -v -C1 ${patches_dir}/swift-android-testing-except-release.patch
@@ -30,7 +19,6 @@ case "${BUILD_SCHEME}" in
3019
;;
3120
esac
3221

33-
perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift
3422
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
3523
perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
3624

swift-ci/sdks/android/patches/swift-android.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ index 758dd1df..02970992 100644
9696
#endif
9797
try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs))
9898
-#if os(Android)
99-
+#if os(Windows)
99+
+#if os(Android)
100100
guard var spawnAttrs else {
101101
throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno),
102102
userInfo: [NSURLErrorKey:self.executableURL!])
@@ -136,7 +136,7 @@ index e40cb1b..ff2f920 100644
136136
if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
137137
target_link_libraries(Testing PUBLIC
138138
- dispatch)
139-
+ dispatch android-execinfo)
139+
+ dispatch)
140140
+ list(GET CMAKE_FIND_ROOT_PATH 0 BT_DIR)
141141
+ target_include_directories(Testing PUBLIC ${BT_DIR}/usr/include)
142142
+ target_link_directories(Testing PUBLIC ${BT_DIR}/usr/lib)

0 commit comments

Comments
 (0)