Skip to content

Commit 8ceadf9

Browse files
committed
Fix CoreFoundation patch on CI
1 parent 059a205 commit 8ceadf9

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

swift-android-testing-except-release.patch

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swi
22
index 5769a3317e..916a7accbb 100644
33
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
44
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
5-
@@ -2317,12 +2317,14 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
5+
@@ -2317,12 +2317,13 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
66
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
77
// - Amazon Linux 2 (EoL mid-2025)
88
return ENOSYS;
99
- #elif defined(__OpenBSD__) || defined(__QNX__)
1010
+ #elif defined(__OpenBSD__) || defined(__QNX__) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
11-
+ return ENOSYS;
1211
// Currently missing as of:
1312
// - OpenBSD 7.5 (April 2024)
1413
// - QNX 8 (December 2023)

swift-android.patch

+24
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ 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);
6286
diff --git a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt b/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
6387
index 016bf294..5c42986a 100644
6488
--- a/swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt

0 commit comments

Comments
 (0)