about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-05-29 12:16:33 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-06-13 16:39:59 +0000
commiteb3e8bb7d729a2df19b1fe2a6a6d7b5e43673807 (patch)
tree11016c1cdafb8ccbebce97f09e9fc0dab6873aec
parent8ad9e9f861c9cbdd85c99df73a4a2d03a0d15014 (diff)
downloadrust-eb3e8bb7d729a2df19b1fe2a6a6d7b5e43673807.tar.gz
rust-eb3e8bb7d729a2df19b1fe2a6a6d7b5e43673807.zip
Move some profile settings out of the stdlib cargo workspace patch
-rw-r--r--build_system/build_sysroot.rs10
-rw-r--r--build_system/prepare.rs8
2 files changed, 9 insertions, 9 deletions
diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs
index 1045023c361..5ea34f758b9 100644
--- a/build_system/build_sysroot.rs
+++ b/build_system/build_sysroot.rs
@@ -4,7 +4,9 @@ use std::process::{self, Command};
 
 use super::path::{Dirs, RelPath};
 use super::rustc_info::{get_file_name, get_rustc_version};
-use super::utils::{remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler};
+use super::utils::{
+    is_ci, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler,
+};
 use super::{CodegenBackend, SysrootKind};
 
 static DIST_DIR: RelPath = RelPath::DIST;
@@ -272,10 +274,16 @@ fn build_clif_sysroot_for_triple(
     }
     compiler.rustflags += &rustflags;
     let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);
+    build_cmd.env("CARGO_BUILD_INCREMENTAL", "true"); // Force incr comp even in release mode
+    if is_ci() {
+        // Disabling incr comp reduces cache size and incr comp doesn't save as much on CI anyway
+        build_cmd.env("CARGO_BUILD_INCREMENTAL", "false");
+    }
     if channel == "release" {
         build_cmd.arg("--release");
     }
     build_cmd.arg("--features").arg("compiler-builtins-no-asm backtrace panic-unwind");
+    build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
     build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
     if compiler.triple.contains("apple") {
         build_cmd.env("CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO", "packed");
diff --git a/build_system/prepare.rs b/build_system/prepare.rs
index c6bc796f3a9..350c3ad8fdc 100644
--- a/build_system/prepare.rs
+++ b/build_system/prepare.rs
@@ -37,14 +37,6 @@ rustc-std-workspace-core = { path = "./library/rustc-std-workspace-core" }
 rustc-std-workspace-alloc = { path = "./library/rustc-std-workspace-alloc" }
 rustc-std-workspace-std = { path = "./library/rustc-std-workspace-std" }
 
-[profile.dev]
-lto = "off"
-
-[profile.release]
-debug = true
-incremental = true
-lto = "off"
-
 # Mandatory for correctly compiling compiler-builtins
 [profile.dev.package.compiler_builtins]
 debug-assertions = false