Skip to content

Commit 059a205

Browse files
committed
Apply CoreFoundation patch on CI instead of commenting out invocation
1 parent 1239b2e commit 059a205

3 files changed

+34
-11
lines changed

swift-android-testing-except-release.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
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,14 @@ 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+
+ return ENOSYS;
12+
// Currently missing as of:
13+
// - OpenBSD 7.5 (April 2024)
14+
// - QNX 8 (December 2023)
15+
+ // - Android 13
16+
return ENOSYS;
17+
- #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
18+
+ #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__)
19+
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
20+
// - Solaris 11.3 (October 2015)
21+
// - Glibc 2.29 (February 2019)
122
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
223
index 468dc61..a90ae3d 100644
324
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake

swift-android-testing-release.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ index b6bfa5760ef..324d1a77eea 100644
1111

1212
def _cmake_product(self, host_target):
1313
build_root = os.path.dirname(self.build_dir)
14+
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
15+
index 90f4aa78..0429425b 100644
16+
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
17+
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
18+
@@ -2279,7 +2279,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
19+
}
20+
21+
CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
22+
- #if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)
23+
+ #if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
24+
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
25+
// - Amazon Linux 2 (EoL mid-2025)
26+
return ENOSYS;
1427
diff --git a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
1528
index 78227e3..e0db2e9 100644
1629
--- a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift

swift-android.patch

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,6 @@ diff --git a/swift-corelibs-foundation/Sources/Foundation/Process.swift b/swift-
9191
index 758dd1df..02970992 100644
9292
--- a/swift-corelibs-foundation/Sources/Foundation/Process.swift
9393
+++ b/swift-corelibs-foundation/Sources/Foundation/Process.swift
94-
@@ -927,8 +927,8 @@ open class Process: NSObject, @unchecked Sendable {
95-
}
96-
let useFallbackChdir: Bool
97-
if let dir = currentDirectoryURL?.path {
98-
- let chdirResult = _CFPosixSpawnFileActionsChdir(fileActions, dir)
99-
- useFallbackChdir = chdirResult == ENOSYS
100-
+ // let chdirResult = _CFPosixSpawnFileActionsChdir(fileActions, dir)
101-
+ useFallbackChdir = true ; let chdirResult = ENOSYS
102-
if !useFallbackChdir {
103-
try _throwIfPosixError(chdirResult)
104-
}
10594
@@ -944,7 +944,7 @@ open class Process: NSObject, @unchecked Sendable {
10695
var spawnAttrs: posix_spawnattr_t = posix_spawnattr_t()
10796
#endif

0 commit comments

Comments
 (0)