@@ -118,7 +118,7 @@ use std::time::{self, Duration};
118118use std:: usize;
119119
120120use cargo;
121- use cargo:: util:: { CargoResult , ProcessBuilder , ProcessError , Rustc } ;
121+ use cargo:: util:: { is_ci , CargoResult , ProcessBuilder , ProcessError , Rustc } ;
122122use filetime;
123123use serde_json:: { self , Value } ;
124124use url:: Url ;
@@ -855,7 +855,7 @@ impl Execs {
855855 fn match_process ( & self , process : & ProcessBuilder ) -> MatchResult {
856856 println ! ( "running {}" , process) ;
857857 let res = if self . stream_output {
858- if env :: var ( "CI" ) . is_ok ( ) {
858+ if is_ci ( ) {
859859 panic ! ( "`.stream()` is for local debugging" )
860860 }
861861 process. exec_with_streaming (
@@ -1746,7 +1746,7 @@ pub fn is_coarse_mtime() -> bool {
17461746 // This should actually be a test that `$CARGO_TARGET_DIR` is on an HFS
17471747 // filesystem, (or any filesystem with low-resolution mtimes). However,
17481748 // that's tricky to detect, so for now just deal with CI.
1749- cfg ! ( target_os = "macos" ) && ( env :: var ( "CI" ) . is_ok ( ) || env :: var ( "TF_BUILD" ) . is_ok ( ) )
1749+ cfg ! ( target_os = "macos" ) && is_ci ( )
17501750}
17511751
17521752/// Some CI setups are much slower then the equipment used by Cargo itself.
@@ -1772,6 +1772,10 @@ pub fn clippy_is_available() -> bool {
17721772
17731773#[ cfg( windows) ]
17741774pub fn symlink_supported ( ) -> bool {
1775+ if is_ci ( ) {
1776+ // We want to be absolutely sure this runs on CI.
1777+ return true ;
1778+ }
17751779 let src = paths:: root ( ) . join ( "symlink_src" ) ;
17761780 fs:: write ( & src, "" ) . unwrap ( ) ;
17771781 let dst = paths:: root ( ) . join ( "symlink_dst" ) ;
0 commit comments