Skip to content

Commit 452bf08

Browse files
committed
Auto merge of #41354 - alexcrichton:tool-no-debug, r=aturon
Disable debuginfo when compiling tools Currently the Cargo binary has jumped from 14M to 34M on the beta channel, which appears to be due to the fact that we're compiling tools with debug information inside them. This additionally means that the `rls` binary is 62M right now! This wasn't an intentional change, so be sure to disable debuginfo when compiling tools as it's just intended for the standard library and compile for now.
2 parents 467aaab + e3ad1b5 commit 452bf08

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bootstrap/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,6 @@ impl Build {
464464
.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
465465
.env("RUSTC_REAL", self.compiler_path(compiler))
466466
.env("RUSTC_STAGE", stage.to_string())
467-
.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
468-
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
469467
.env("RUSTC_CODEGEN_UNITS",
470468
self.config.rust_codegen_units.to_string())
471469
.env("RUSTC_DEBUG_ASSERTIONS",
@@ -477,6 +475,13 @@ impl Build {
477475
.env("RUSTDOC_REAL", self.rustdoc(compiler))
478476
.env("RUSTC_FLAGS", self.rustc_flags(target).join(" "));
479477

478+
// Tools don't get debuginfo right now, e.g. cargo and rls don't get
479+
// compiled with debuginfo.
480+
if mode != Mode::Tool {
481+
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
482+
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
483+
}
484+
480485
// Enable usage of unstable features
481486
cargo.env("RUSTC_BOOTSTRAP", "1");
482487
self.add_rust_test_threads(&mut cargo);

0 commit comments

Comments
 (0)