@@ -29,7 +29,7 @@ use build_helper::{output, mtime, up_to_date};
2929use filetime:: FileTime ;
3030use serde_json;
3131
32- use util:: { exe, libdir, is_dylib, CiEnv } ;
32+ use util:: { exe, libdir, is_dylib} ;
3333use { Compiler , Mode , GitRepo } ;
3434use native;
3535
@@ -1034,29 +1034,6 @@ pub fn add_to_sysroot(builder: &Builder, sysroot_dst: &Path, stamp: &Path) {
10341034 }
10351035}
10361036
1037- // Avoiding a dependency on winapi to keep compile times down
1038- #[ cfg( unix) ]
1039- fn stderr_isatty ( ) -> bool {
1040- use libc;
1041- unsafe { libc:: isatty ( libc:: STDERR_FILENO ) != 0 }
1042- }
1043- #[ cfg( windows) ]
1044- fn stderr_isatty ( ) -> bool {
1045- type DWORD = u32 ;
1046- type BOOL = i32 ;
1047- type HANDLE = * mut u8 ;
1048- const STD_ERROR_HANDLE : DWORD = -12i32 as DWORD ;
1049- extern "system" {
1050- fn GetStdHandle ( which : DWORD ) -> HANDLE ;
1051- fn GetConsoleMode ( hConsoleHandle : HANDLE , lpMode : * mut DWORD ) -> BOOL ;
1052- }
1053- unsafe {
1054- let handle = GetStdHandle ( STD_ERROR_HANDLE ) ;
1055- let mut out = 0 ;
1056- GetConsoleMode ( handle, & mut out) != 0
1057- }
1058- }
1059-
10601037pub fn run_cargo ( builder : & Builder ,
10611038 cargo : & mut Command ,
10621039 tail_args : Vec < String > ,
@@ -1218,15 +1195,6 @@ pub fn stream_cargo(
12181195 cargo. arg ( "--message-format" ) . arg ( "json" )
12191196 . stdout ( Stdio :: piped ( ) ) ;
12201197
1221- if stderr_isatty ( ) && builder. ci_env == CiEnv :: None &&
1222- // if the terminal is reported as dumb, then we don't want to enable color for rustc
1223- env:: var_os ( "TERM" ) . map ( |t| t != * "dumb" ) . unwrap_or ( true ) {
1224- // since we pass message-format=json to cargo, we need to tell the rustc
1225- // wrapper to give us colored output if necessary. This is because we
1226- // only want Cargo's JSON output, not rustcs.
1227- cargo. env ( "RUSTC_COLOR" , "1" ) ;
1228- }
1229-
12301198 for arg in tail_args {
12311199 cargo. arg ( arg) ;
12321200 }
0 commit comments