Skip to content

Commit 7a2bff7

Browse files
committed
Do not produce debuginfo for tools
1 parent 1ba46dc commit 7a2bff7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bootstrap/builder.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,13 @@ impl<'a> Builder<'a> {
495495
if let Some(target_linker) = self.build.linker(target) {
496496
cargo.env("RUSTC_TARGET_LINKER", target_linker);
497497
}
498-
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
499-
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
500498

501499
if mode != Mode::Tool {
500+
// Tools don't get debuginfo right now, e.g. cargo and rls don't
501+
// get compiled with debuginfo.
502+
// Adding debuginfo increases their sizes by a factor of 3-4.
503+
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string());
504+
cargo.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
502505
cargo.env("RUSTC_FORCE_UNSTABLE", "1");
503506

504507
// Currently the compiler depends on crates from crates.io, and

0 commit comments

Comments
 (0)