@@ -4,7 +4,9 @@ use std::process::{self, Command};
4
4
5
5
use super :: path:: { Dirs , RelPath } ;
6
6
use 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
+ } ;
8
10
use super :: { CodegenBackend , SysrootKind } ;
9
11
10
12
static DIST_DIR : RelPath = RelPath :: DIST ;
@@ -272,10 +274,16 @@ fn build_clif_sysroot_for_triple(
272
274
}
273
275
compiler. rustflags += & rustflags;
274
276
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
+ }
275
282
if channel == "release" {
276
283
build_cmd. arg ( "--release" ) ;
277
284
}
278
285
build_cmd. arg ( "--features" ) . arg ( "compiler-builtins-no-asm backtrace panic-unwind" ) ;
286
+ build_cmd. env ( "CARGO_PROFILE_RELEASE_DEBUG" , "true" ) ;
279
287
build_cmd. env ( "__CARGO_DEFAULT_LIB_METADATA" , "cg_clif" ) ;
280
288
if compiler. triple . contains ( "apple" ) {
281
289
build_cmd. env ( "CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO" , "packed" ) ;
0 commit comments