@@ -4,7 +4,9 @@ use std::process::{self, Command};
44
55use super :: path:: { Dirs , RelPath } ;
66use super :: rustc_info:: { get_file_name, get_rustc_version} ;
7- use super :: utils:: { remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject , Compiler } ;
7+ use super :: utils:: {
8+ is_ci, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject , Compiler ,
9+ } ;
810use super :: { CodegenBackend , SysrootKind } ;
911
1012static DIST_DIR : RelPath = RelPath :: DIST ;
@@ -272,10 +274,16 @@ fn build_clif_sysroot_for_triple(
272274 }
273275 compiler. rustflags += & rustflags;
274276 let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
277+ build_cmd. env ( "CARGO_BUILD_INCREMENTAL" , "true" ) ; // Force incr comp even in release mode
278+ if is_ci ( ) {
279+ // Disabling incr comp reduces cache size and incr comp doesn't save as much on CI anyway
280+ build_cmd. env ( "CARGO_BUILD_INCREMENTAL" , "false" ) ;
281+ }
275282 if channel == "release" {
276283 build_cmd. arg ( "--release" ) ;
277284 }
278285 build_cmd. arg ( "--features" ) . arg ( "compiler-builtins-no-asm backtrace panic-unwind" ) ;
286+ build_cmd. env ( "CARGO_PROFILE_RELEASE_DEBUG" , "true" ) ;
279287 build_cmd. env ( "__CARGO_DEFAULT_LIB_METADATA" , "cg_clif" ) ;
280288 if compiler. triple . contains ( "apple" ) {
281289 build_cmd. env ( "CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO" , "packed" ) ;
0 commit comments