Skip to content

Commit

Permalink
Auto merge of #117197 - Zalathar:demangler, r=onur-ozkan
Browse files Browse the repository at this point in the history
Avoid unnecessary builds/rebuilds of `rust-demangler`

This is a combination of two loosely-related changes:

- Don't build `rust-demangler` as a dependency of `tests/run-make`, because after #112300 none of the remaining run-make tests actually use it. (If future run-make tests ever do need the demangler, it'll be easy to add it back.)
- For `tests/run-coverage`, build the demangler with the stage 0 compiler instead of the current-stage compiler. This avoids having to uselessly rebuild the demangler after modifying and rebuilding the compiler itself.
  • Loading branch information
bors committed Oct 28, 2023
2 parents 6f349cd + 36c3f90 commit c6eb61a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1567,10 +1567,12 @@ note: if you're sure you want to do this, please open an issue as to why. In the
cmd.arg("--coverage-dump-path").arg(coverage_dump);
}

if mode == "run-make" || mode == "run-coverage" {
if mode == "run-coverage" {
// The demangler doesn't need the current compiler, so we can avoid
// unnecessary rebuilds by using the bootstrap compiler instead.
let rust_demangler = builder
.ensure(tool::RustDemangler {
compiler,
compiler: compiler.with_stage(0),
target: compiler.host,
extra_features: Vec::new(),
})
Expand Down
4 changes: 0 additions & 4 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3546,10 +3546,6 @@ impl<'test> TestCx<'test> {
cmd.env("RUSTDOC", cwd.join(rustdoc));
}

if let Some(ref rust_demangler) = self.config.rust_demangler_path {
cmd.env("RUST_DEMANGLER", cwd.join(rust_demangler));
}

if let Some(ref node) = self.config.nodejs {
cmd.env("NODE", node);
}
Expand Down

0 comments on commit c6eb61a

Please sign in to comment.