Skip to content

Commit 1be64f3

Browse files
authored
Rollup merge of rust-lang#89756 - jyn514:bootstrap-times, r=Mark-Simulacrum
Greatly reduce amount of debuginfo compiled for bootstrap itself Rather than compiling rustbuild and all its dependencies with `debuginfo=2`, this compiles dependencies without debuginfo and rustbuild with `debuginfo=1`. On my laptop, this brings compile times down from ~1:20 to ~1:05. See also https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/async.20in.20bootstrap.3F/near/254847594. r? ``@Mark-Simulacrum``
2 parents 57504aa + 7f974d0 commit 1be64f3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ gimli.debug = 0
8989
miniz_oxide.debug = 0
9090
object.debug = 0
9191

92+
# The only package that ever uses debug builds is bootstrap.
93+
# We care a lot about bootstrap's compile times, so don't include debug info for
94+
# dependencies, only bootstrap itself.
95+
[profile.dev]
96+
debug = 0
97+
[profile.dev.package]
98+
# Only use debuginfo=1 to further reduce compile times.
99+
bootstrap.debug = 1
100+
92101
# We want the RLS to use the version of Cargo that we've got vendored in this
93102
# repository to ensure that the same exact version of Cargo is used by both the
94103
# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository

src/bootstrap/bootstrap.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,9 @@ def build_bootstrap(self):
933933
env["LIBRARY_PATH"] = os.path.join(self.bin_root(True), "lib") + \
934934
(os.pathsep + env["LIBRARY_PATH"]) \
935935
if "LIBRARY_PATH" in env else ""
936+
936937
# preserve existing RUSTFLAGS
937938
env.setdefault("RUSTFLAGS", "")
938-
env["RUSTFLAGS"] += " -Cdebuginfo=2"
939-
940939
build_section = "target.{}".format(self.build)
941940
target_features = []
942941
if self.get_toml("crt-static", build_section) == "true":

0 commit comments

Comments
 (0)