@@ -29,7 +29,7 @@ use build_helper::{output, mtime, up_to_date};
29
29
use filetime:: FileTime ;
30
30
use serde_json;
31
31
32
- use util:: { exe, libdir, is_dylib, CiEnv } ;
32
+ use util:: { exe, libdir, is_dylib} ;
33
33
use { Compiler , Mode , GitRepo } ;
34
34
use native;
35
35
@@ -1034,29 +1034,6 @@ pub fn add_to_sysroot(builder: &Builder, sysroot_dst: &Path, stamp: &Path) {
1034
1034
}
1035
1035
}
1036
1036
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
-
1060
1037
pub fn run_cargo ( builder : & Builder ,
1061
1038
cargo : & mut Command ,
1062
1039
tail_args : Vec < String > ,
@@ -1218,15 +1195,6 @@ pub fn stream_cargo(
1218
1195
cargo. arg ( "--message-format" ) . arg ( "json" )
1219
1196
. stdout ( Stdio :: piped ( ) ) ;
1220
1197
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
-
1230
1198
for arg in tail_args {
1231
1199
cargo. arg ( arg) ;
1232
1200
}
0 commit comments