From eb3e8bb7d729a2df19b1fe2a6a6d7b5e43673807 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 29 May 2023 12:16:33 +0000 Subject: [PATCH] Move some profile settings out of the stdlib cargo workspace patch --- build_system/build_sysroot.rs | 10 +++++++++- build_system/prepare.rs | 8 -------- 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 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 @@ fn prepare_stdlib(dirs: &Dirs, rustc: &Path) { 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