-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathswift-android-foundation-except-release.patch
41 lines (40 loc) · 2 KB
/
swift-android-foundation-except-release.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
index 16e05052609..7ab8cebfab8 100755
--- a/swift/utils/build-script-impl
+++ b/swift/utils/build-script-impl
@@ -2622,6 +2622,7 @@ for host in "${ALL_HOSTS[@]}"; do
echo "Cleaning the libdispatch build directory"
call rm -rf "${LIBDISPATCH_BUILD_DIR}"
fi
+ call ln -sf "${SWIFT_BUILD_PATH}/lib/swift" "${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib"
cmake_options=(
-DENABLE_SWIFT=YES
diff --git a/swift-corelibs-foundation/Sources/Foundation/Process.swift b/swift-corelibs-foundation/Sources/Foundation/Process.swift
index 758dd1df..02970992 100644
--- a/swift-corelibs-foundation/Sources/Foundation/Process.swift
+++ b/swift-corelibs-foundation/Sources/Foundation/Process.swift
@@ -927,8 +927,8 @@ open class Process: NSObject, @unchecked Sendable {
}
let useFallbackChdir: Bool
if let dir = currentDirectoryURL?.path {
- let chdirResult = _CFPosixSpawnFileActionsChdir(fileActions, dir)
- useFallbackChdir = chdirResult == ENOSYS
+ // let chdirResult = _CFPosixSpawnFileActionsChdir(fileActions, dir)
+ useFallbackChdir = true ; let chdirResult = ENOSYS
if !useFallbackChdir {
try _throwIfPosixError(chdirResult)
}
@@ -942,13 +942,6 @@ open class Process: NSObject, @unchecked Sendable {
var spawnAttrs: posix_spawnattr_t? = nil
#else
var spawnAttrs: posix_spawnattr_t = posix_spawnattr_t()
-#endif
-#if os(Android)
- guard var spawnAttrs else {
- throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno), userInfo: [
- NSURLErrorKey:self.executableURL!
- ])
- }
#endif
try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs))
try _throwIfPosixError(posix_spawnattr_setflags(&spawnAttrs, .init(POSIX_SPAWN_SETPGROUP)))