@@ -415,6 +415,7 @@ impl Command {
415415 all( target_os = "linux" , target_env = "musl" ) ,
416416 target_os = "nto" ,
417417 target_vendor = "apple" ,
418+ target_os = "cygwin" ,
418419 ) ) ) ]
419420 fn posix_spawn (
420421 & mut self ,
@@ -433,6 +434,7 @@ impl Command {
433434 all( target_os = "linux" , target_env = "musl" ) ,
434435 target_os = "nto" ,
435436 target_vendor = "apple" ,
437+ target_os = "cygwin" ,
436438 ) ) ]
437439 fn posix_spawn (
438440 & mut self ,
@@ -584,7 +586,7 @@ impl Command {
584586 /// Some platforms can set a new working directory for a spawned process in the
585587 /// `posix_spawn` path. This function looks up the function pointer for adding
586588 /// 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 ") ) ) ]
588590 fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
589591 use crate :: sys:: weak:: weak;
590592
@@ -618,7 +620,9 @@ impl Command {
618620 /// Weak symbol lookup doesn't work with statically linked libcs, so in cases
619621 /// where static linking is possible we need to either check for the presence
620622 /// 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" ) ) ]
622626 fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
623627 // Our minimum required musl supports this function, so we can just use it.
624628 Some ( libc:: posix_spawn_file_actions_addchdir_np)
0 commit comments