Skip to content

Commit

Permalink
bootstrap: show diagnostics relative to rustc src dir
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 2, 2024
1 parent 588a420 commit 846d03c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ def build_bootstrap_cmd(self, env):
raise Exception("no cargo executable found at `{}`".format(
self.cargo()))
args = [self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml"),
"-Zroot-dir="+self.rust_root]
args.extend("--verbose" for _ in range(self.verbose))
if self.use_locked_deps:
args.append("--locked")
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ impl Builder<'_> {

cargo.arg("-j").arg(self.jobs().to_string());

// Make cargo emit diagnostics relative to the rustc src dir.
cargo.arg(format!("-Zroot-dir={}", self.src.display()));

// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
// Force cargo to output binaries with disambiguating hashes in the name
let mut metadata = if compiler.stage == 0 {
Expand Down

0 comments on commit 846d03c

Please sign in to comment.