Skip to content

Commit 0f4c8dc

Browse files
committed
Move some profile settings out of the stdlib cargo workspace patch
1 parent 14da737 commit 0f4c8dc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

build_system/build_sysroot.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use std::process::{self, Command};
44

55
use super::path::{Dirs, RelPath};
66
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+
};
810
use super::{CodegenBackend, SysrootKind};
911

1012
static 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");

build_system/prepare.rs

-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ rustc-std-workspace-core = { path = "./library/rustc-std-workspace-core" }
3737
rustc-std-workspace-alloc = { path = "./library/rustc-std-workspace-alloc" }
3838
rustc-std-workspace-std = { path = "./library/rustc-std-workspace-std" }
3939
40-
[profile.dev]
41-
lto = "off"
42-
43-
[profile.release]
44-
debug = true
45-
incremental = true
46-
lto = "off"
47-
4840
# Mandatory for correctly compiling compiler-builtins
4941
[profile.dev.package.compiler_builtins]
5042
debug-assertions = false

0 commit comments

Comments
 (0)