Skip to content

Skip dsymutil by default for compiler bootstrap #80213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,14 @@ changelog-seen = 2
# FIXME(#61117): Some tests fail when this option is enabled.
#debuginfo-level-tests = 0

# Whether to run `dsymutil` on Apple platforms to gather debug info into .dSYM
# bundles. `dsymutil` adds time to builds for no clear benefit, and also makes
# it more difficult for debuggers to find debug info. The compiler currently
# defaults to running `dsymutil` to preserve its historical default, but when
# compiling the compiler itself, we skip it by default since we know it's safe
# to do so in that case.
#run-dsymutil = false

# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
#backtrace = true

Expand Down
13 changes: 13 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,19 @@ impl<'a> Builder<'a> {
},
);

// `dsymutil` adds time to builds on Apple platforms for no clear benefit, and also makes
// it more difficult for debuggers to find debug info. The compiler currently defaults to
// running `dsymutil` to preserve its historical default, but when compiling the compiler
// itself, we skip it by default since we know it's safe to do so in that case.
// See https://github.com/rust-lang/rust/issues/79361 for more info on this flag.
if target.contains("apple") {
if self.config.rust_run_dsymutil {
rustflags.arg("-Zrun-dsymutil=yes");
} else {
rustflags.arg("-Zrun-dsymutil=no");
}
}

if self.config.cmd.bless() {
// Bless `expect!` tests.
cargo.env("UPDATE_EXPECT", "1");
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub struct Config {
pub rust_debuginfo_level_std: u32,
pub rust_debuginfo_level_tools: u32,
pub rust_debuginfo_level_tests: u32,
pub rust_run_dsymutil: bool,
pub rust_rpath: bool,
pub rustc_parallel: bool,
pub rustc_default_linker: Option<String>,
Expand Down Expand Up @@ -466,6 +467,7 @@ struct Rust {
debuginfo_level_std: Option<u32>,
debuginfo_level_tools: Option<u32>,
debuginfo_level_tests: Option<u32>,
run_dsymutil: Option<bool>,
backtrace: Option<bool>,
incremental: Option<bool>,
parallel_compiler: Option<bool>,
Expand Down Expand Up @@ -830,6 +832,7 @@ impl Config {
debuginfo_level_std = rust.debuginfo_level_std;
debuginfo_level_tools = rust.debuginfo_level_tools;
debuginfo_level_tests = rust.debuginfo_level_tests;
config.rust_run_dsymutil = rust.run_dsymutil.unwrap_or(false);
optimize = rust.optimize;
ignore_git = rust.ignore_git;
set(&mut config.rust_new_symbol_mangling, rust.new_symbol_mangling);
Expand Down