Skip to content

Commit

Permalink
Auto merge of #123337 - workingjubilee:debug-compiler-profile-expecta…
Browse files Browse the repository at this point in the history
…tions, r=fmease

Include line tables in 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 profiling and such by setting `rust.debuginfo-level = "line-tables-only"` at the cost of only 150~200 MB on the weight of a fresh build dir from `./x.py check`.
  • Loading branch information
bors committed May 16, 2024
2 parents b71e8cb + 887151a commit bf8801d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/defaults/config.compiler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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""#,
},
];

0 comments on commit bf8801d

Please sign in to comment.