Skip to content

Commit 28bc5a2

Browse files
authored
Rollup merge of #131442 - jieyouxu:mir-opt-rebuild, r=onur-ozkan
Match std `RUSTFLAGS` for host and target for `mir-opt` test suite to fix double std build/rebuilds Previously the bootstrap compiletest `Step::run` flow had: ```rs // ensure that `libproc_macro` is available on the host. builder.ensure(compile::Std::new(compiler, compiler.host)); // ... if suite == "mir-opt" { builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, target)); } else { builder.ensure(compile::Std::new(compiler, target)); } ``` This can cause unnecessary std rebuilds (even on the same invocation) because if host == target then `builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, target))` will have different `RUSTFLAGS` than `builder.ensure(compile::Std::new(compiler, compiler.host))`. This PR fixes that by matching up std `RUSTFLAGS` if the test suite is `mir-opt`: ```rs if suite == "mir-opt" { builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, compiler.host)); } else { builder.ensure(compile::Std::new(compiler, compiler.host)); } ``` This is a short-term fix, the better fix is to enforce how `RUSTFLAGS` are handled as described in #131437 (comment). Fixes #131437.
2 parents 4f2af12 + becf664 commit 28bc5a2

File tree

1 file changed

+5
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+5
-1
lines changed

src/bootstrap/src/core/build_steps/test.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,11 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
16971697
builder.ensure(TestHelpers { target: compiler.host });
16981698

16991699
// ensure that `libproc_macro` is available on the host.
1700-
builder.ensure(compile::Std::new(compiler, compiler.host));
1700+
if suite == "mir-opt" {
1701+
builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, compiler.host));
1702+
} else {
1703+
builder.ensure(compile::Std::new(compiler, compiler.host));
1704+
}
17011705

17021706
// As well as the target
17031707
if suite != "mir-opt" {

0 commit comments

Comments
 (0)