mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Fix posix_spawn not being used on iOS and visionOS
`man posix_spawn` documents it to be able to return `ENOENT`, and there should be nothing preventing this. Tested in the iOS simulator and on Mac Catalyst.
This commit is contained in:
parent
6b488cd302
commit
f9f3573b62
@ -420,13 +420,11 @@ impl Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(
|
#[cfg(not(any(
|
||||||
target_os = "macos",
|
|
||||||
target_os = "tvos",
|
|
||||||
target_os = "watchos",
|
|
||||||
target_os = "freebsd",
|
target_os = "freebsd",
|
||||||
all(target_os = "linux", target_env = "gnu"),
|
all(target_os = "linux", target_env = "gnu"),
|
||||||
all(target_os = "linux", target_env = "musl"),
|
all(target_os = "linux", target_env = "musl"),
|
||||||
target_os = "nto",
|
target_os = "nto",
|
||||||
|
target_vendor = "apple",
|
||||||
)))]
|
)))]
|
||||||
fn posix_spawn(
|
fn posix_spawn(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -439,14 +437,11 @@ impl Command {
|
|||||||
// Only support platforms for which posix_spawn() can return ENOENT
|
// Only support platforms for which posix_spawn() can return ENOENT
|
||||||
// directly.
|
// directly.
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
target_os = "macos",
|
|
||||||
// FIXME: `target_os = "ios"`?
|
|
||||||
target_os = "tvos",
|
|
||||||
target_os = "watchos",
|
|
||||||
target_os = "freebsd",
|
target_os = "freebsd",
|
||||||
all(target_os = "linux", target_env = "gnu"),
|
all(target_os = "linux", target_env = "gnu"),
|
||||||
all(target_os = "linux", target_env = "musl"),
|
all(target_os = "linux", target_env = "musl"),
|
||||||
target_os = "nto",
|
target_os = "nto",
|
||||||
|
target_vendor = "apple",
|
||||||
))]
|
))]
|
||||||
fn posix_spawn(
|
fn posix_spawn(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -530,7 +525,7 @@ impl Command {
|
|||||||
}
|
}
|
||||||
let addchdir = match self.get_cwd() {
|
let addchdir = match self.get_cwd() {
|
||||||
Some(cwd) => {
|
Some(cwd) => {
|
||||||
if cfg!(any(target_os = "macos", target_os = "tvos", target_os = "watchos")) {
|
if cfg!(target_vendor = "apple") {
|
||||||
// There is a bug in macOS where a relative executable
|
// There is a bug in macOS where a relative executable
|
||||||
// path like "../myprogram" will cause `posix_spawn` to
|
// path like "../myprogram" will cause `posix_spawn` to
|
||||||
// successfully launch the program, but erroneously return
|
// successfully launch the program, but erroneously return
|
||||||
|
Loading…
Reference in New Issue
Block a user