Skip to content

Commit fd8628c

Browse files
committed
Stop applying Foundation patch that was upstreamed to trunk branch on the CI
1 parent d082809 commit fd8628c

5 files changed

+62
-44
lines changed

.github/workflows/sdks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
else
133133
if ${{ matrix.version == 'trunk' }}; then
134134
git apply swift-android-trunk-libdispatch.patch
135+
else
136+
git apply swift-android-devel.patch
135137
fi
136138
git apply -C2 swift-android-ci-except-release.patch swift-android-testing-except-release.patch
137139
SDK_NAME=$(ls | grep swift-${{ matrix.version }}-android-aarch64)

swift-android-devel.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
2+
index 5769a3317e..916a7accbb 100644
3+
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
4+
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
5+
@@ -1948,7 +1948,7 @@ CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
6+
#endif
7+
}
8+
9+
-#if TARGET_OS_ANDROID
10+
+#if TARGET_OS_ANDROID && __ANDROID_API__ < 28
11+
12+
#include <dlfcn.h>
13+
#include <spawn.h>
14+
@@ -2277,6 +2277,10 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
15+
return _CFPosixSpawnFileActionsAddCloseImpl(file_actions, filedes);
16+
}
17+
18+
+CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
19+
+ return ENOSYS;
20+
+}
21+
+
22+
CF_EXPORT int _CFPosixSpawn(pid_t *_CF_RESTRICT pid, const char *_CF_RESTRICT path, _CFPosixSpawnFileActionsRef file_actions, _CFPosixSpawnAttrRef _Nullable _CF_RESTRICT attrp, char *_Nullable const argv[_Nullable _CF_RESTRICT], char *_Nullable const envp[_Nullable _CF_RESTRICT]) {
23+
_CFPosixSpawnInitialize();
24+
return _CFPosixSpawnImpl(pid, path, file_actions, attrp, argv, envp);
25+
@@ -2317,12 +2317,13 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
26+
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
27+
// - Amazon Linux 2 (EoL mid-2025)
28+
return ENOSYS;
29+
- #elif defined(__OpenBSD__) || defined(__QNX__)
30+
+ #elif defined(__OpenBSD__) || defined(__QNX__) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
31+
// Currently missing as of:
32+
// - OpenBSD 7.5 (April 2024)
33+
// - QNX 8 (December 2023)
34+
+ // - Android 13
35+
return ENOSYS;
36+
- #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
37+
+ #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__)
38+
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
39+
// - Solaris 11.3 (October 2015)
40+
// - Glibc 2.29 (February 2019)

swift-android-testing-except-release.patch

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
2-
index 5769a3317e..916a7accbb 100644
3-
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
4-
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
5-
@@ -2317,12 +2317,13 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
6-
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
7-
// - Amazon Linux 2 (EoL mid-2025)
8-
return ENOSYS;
9-
- #elif defined(__OpenBSD__) || defined(__QNX__)
10-
+ #elif defined(__OpenBSD__) || defined(__QNX__) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
11-
// Currently missing as of:
12-
// - OpenBSD 7.5 (April 2024)
13-
// - QNX 8 (December 2023)
14-
+ // - Android 13
15-
return ENOSYS;
16-
- #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
17-
+ #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__)
18-
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
19-
// - Solaris 11.3 (October 2015)
20-
// - Glibc 2.29 (February 2019)
211
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
222
index 468dc61..a90ae3d 100644
233
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake

swift-android-testing-release.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@ diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swi
1515
index 90f4aa78..0429425b 100644
1616
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
1717
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
18+
@@ -1948,7 +1948,7 @@ CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
19+
#endif
20+
}
21+
22+
-#if TARGET_OS_ANDROID
23+
+#if TARGET_OS_ANDROID && __ANDROID_API__ < 28
24+
25+
#include <dlfcn.h>
26+
#include <spawn.h>
27+
@@ -2277,6 +2277,10 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
28+
return _CFPosixSpawnFileActionsAddCloseImpl(file_actions, filedes);
29+
}
30+
31+
+CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
32+
+ return ENOSYS;
33+
+}
34+
+
35+
CF_EXPORT int _CFPosixSpawn(pid_t *_CF_RESTRICT pid, const char *_CF_RESTRICT path, _CFPosixSpawnFileActionsRef file_actions, _CFPosixSpawnAttrRef _Nullable _CF_RESTRICT attrp, char *_Nullable const argv[_Nullable _CF_RESTRICT], char *_Nullable const envp[_Nullable _CF_RESTRICT]) {
36+
_CFPosixSpawnInitialize();
37+
return _CFPosixSpawnImpl(pid, path, file_actions, attrp, argv, envp);
1838
@@ -2279,7 +2279,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
1939
}
2040

swift-android.patch

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,6 @@ index 7f290d16..95366592 100644
5959
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
6060
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
6161
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
62-
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
63-
index 5769a331..238f2ecb 100644
64-
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
65-
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
66-
@@ -1948,7 +1948,7 @@ CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
67-
#endif
68-
}
69-
70-
-#if TARGET_OS_ANDROID
71-
+#if TARGET_OS_ANDROID && __ANDROID_API__ < 28
72-
73-
#include <dlfcn.h>
74-
#include <spawn.h>
75-
@@ -2277,6 +2277,10 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
76-
return _CFPosixSpawnFileActionsAddCloseImpl(file_actions, filedes);
77-
}
78-
79-
+CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
80-
+ return ENOSYS;
81-
+}
82-
+
83-
CF_EXPORT int _CFPosixSpawn(pid_t *_CF_RESTRICT pid, const char *_CF_RESTRICT path, _CFPosixSpawnFileActionsRef file_actions, _CFPosixSpawnAttrRef _Nullable _CF_RESTRICT attrp, char *_Nullable const argv[_Nullable _CF_RESTRICT], char *_Nullable const envp[_Nullable _CF_RESTRICT]) {
84-
_CFPosixSpawnInitialize();
85-
return _CFPosixSpawnImpl(pid, path, file_actions, attrp, argv, envp);
8662
diff --git a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt b/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
8763
index 016bf294..5c42986a 100644
8864
--- a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt

0 commit comments

Comments
 (0)