@@ -415,6 +415,7 @@ impl Command {
415
415
all( target_os = "linux" , target_env = "musl" ) ,
416
416
target_os = "nto" ,
417
417
target_vendor = "apple" ,
418
+ target_os = "cygwin" ,
418
419
) ) ) ]
419
420
fn posix_spawn (
420
421
& mut self ,
@@ -433,6 +434,7 @@ impl Command {
433
434
all( target_os = "linux" , target_env = "musl" ) ,
434
435
target_os = "nto" ,
435
436
target_vendor = "apple" ,
437
+ target_os = "cygwin" ,
436
438
) ) ]
437
439
fn posix_spawn (
438
440
& mut self ,
@@ -584,7 +586,7 @@ impl Command {
584
586
/// Some platforms can set a new working directory for a spawned process in the
585
587
/// `posix_spawn` path. This function looks up the function pointer for adding
586
588
/// such an action to a `posix_spawn_file_actions_t` struct.
587
- #[ cfg( not( all( target_os = "linux" , target_env = "musl" ) ) ) ]
589
+ #[ cfg( not( any ( all( target_os = "linux" , target_env = "musl" ) , target_os = "cygwin ") ) ) ]
588
590
fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
589
591
use crate :: sys:: weak:: weak;
590
592
@@ -618,7 +620,9 @@ impl Command {
618
620
/// Weak symbol lookup doesn't work with statically linked libcs, so in cases
619
621
/// where static linking is possible we need to either check for the presence
620
622
/// of the symbol at compile time or know about it upfront.
621
- #[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
623
+ ///
624
+ /// Cygwin doesn't support weak symbol, so just link it.
625
+ #[ cfg( any( all( target_os = "linux" , target_env = "musl" ) , target_os = "cygwin" ) ) ]
622
626
fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
623
627
// Our minimum required musl supports this function, so we can just use it.
624
628
Some ( libc:: posix_spawn_file_actions_addchdir_np)
0 commit comments