Skip to content

Commit 275549b

Browse files
committed
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.
1 parent 1364ffc commit 275549b

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
@@ -461,8 +461,6 @@ impl Build {
461461
.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
462462
.env("RUSTC_REAL", self.compiler_path(compiler))
463463
.env("RUSTC_STAGE", stage.to_string())
464-
.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
465-
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
466464
.env("RUSTC_CODEGEN_UNITS",
467465
self.config.rust_codegen_units.to_string())
468466
.env("RUSTC_DEBUG_ASSERTIONS",
@@ -474,6 +472,13 @@ impl Build {
474472
.env("RUSTDOC_REAL", self.rustdoc(compiler))
475473
.env("RUSTC_FLAGS", self.rustc_flags(target).join(" "));
476474

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

0 commit comments

Comments
 (0)