]> git.lizzy.rs Git - rust.git/commitdiff
Do not produce debuginfo for tools
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Thu, 14 Dec 2017 14:40:51 +0000 (15:40 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Thu, 14 Dec 2017 14:40:51 +0000 (15:40 +0100)
src/bootstrap/builder.rs

index dcffc83c4b6f6a28e695ce69abe4822c8dec5113..bdc00295a2041073dd15476f4ff91dae482d0886 100644 (file)
@@ -495,10 +495,13 @@ pub fn cargo(&self,
         if let Some(target_linker) = self.build.linker(target) {
             cargo.env("RUSTC_TARGET_LINKER", target_linker);
         }
-        cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
-            .env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
 
         if mode != Mode::Tool {
+            // Tools don't get debuginfo right now, e.g. cargo and rls don't
+            // get compiled with debuginfo.
+            // Adding debuginfo increases their sizes by a factor of 3-4.
+            cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string());
+            cargo.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
             cargo.env("RUSTC_FORCE_UNSTABLE", "1");
 
             // Currently the compiler depends on crates from crates.io, and