From 887151ad93b0541ae19c6589f4aeb3f07bbc60a1 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Mon, 1 Apr 2024 13:16:15 -0700 Subject: [PATCH] Set `debuginfo-level = "line-tables-only"` for compiler profile This profile has only undergone minimal tweaks since it was originally drafted. I asked a number of compiler contributors and they said they set rust.debug explicitly. This was even true for one contributor that set `rust.debug` = false! Almost everyone seems slightly surprised that `rust.debug = true` is not the default. However, adding full debuginfo at this level costs multiple gigabytes! We can still get much better debuginfo by setting "line-tables-only" at the cost of only 150~200 MB. --- src/bootstrap/defaults/config.compiler.toml | 2 ++ src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/bootstrap/defaults/config.compiler.toml b/src/bootstrap/defaults/config.compiler.toml index d93c5fd25a150..fd2da24699086 100644 --- a/src/bootstrap/defaults/config.compiler.toml +++ b/src/bootstrap/defaults/config.compiler.toml @@ -8,6 +8,8 @@ compiler-docs = true # where adding `debug!()` appears to do nothing. # However, it makes running the compiler slightly slower. debug-logging = true +# Get actually-useful information from backtraces, profiling, etc. with minimal added bytes +debuginfo-level = "line-tables-only" # This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower. incremental = true # Print backtrace on internal compiler errors during bootstrap diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index c3a03693f714f..a1c9ddebb5d96 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -180,4 +180,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "New option `build.lldb` that will override the default lldb binary path used in debuginfo tests", }, + ChangeInfo { + change_id: 123337, + severity: ChangeSeverity::Info, + summary: r#"The compiler profile now defaults to rust.debuginfo-level = "line-tables-only""#, + }, ];