-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patch for disabling PosixSpawn for Android
- Loading branch information
1 parent
d2ba1d9
commit 1b6be45
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
patches/swift-corelibs-foundation/0018-disable-posix-spawn.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 31f094b6c1b7f2a5f95384f39ab8dbb2420d424f Mon Sep 17 00:00:00 2001 | ||
From: Andriy Druk <[email protected]> | ||
Date: Sat, 18 Jan 2025 13:40:36 +0200 | ||
Subject: [PATCH] process | ||
|
||
--- | ||
Sources/Foundation/Process.swift | 11 ++--------- | ||
1 file changed, 2 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/Sources/Foundation/Process.swift b/Sources/Foundation/Process.swift | ||
index cfe4cd19..8173d0aa 100644 | ||
--- a/Sources/Foundation/Process.swift | ||
+++ b/Sources/Foundation/Process.swift | ||
@@ -929,8 +929,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) | ||
} | ||
@@ -943,13 +943,6 @@ open class Process: NSObject, @unchecked Sendable { | ||
#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 | ||
|
||
#if !os(Android) | ||
try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs)) | ||
-- | ||
2.39.5 (Apple Git-154) | ||
|