Commit 28bc5a2
authored
Rollup merge of rust-lang#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 rust-lang#131437 (comment).
Fixes rust-lang#131437.1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1697 | 1697 | | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | | - | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
1701 | 1705 | | |
1702 | 1706 | | |
1703 | 1707 | | |
| |||
0 commit comments