Skip to content

Commit 3e37dca

Browse files
committed
if stage isn't set explicitly, default to 1 when running miri
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 05be24c commit 3e37dca

File tree

1 file changed

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

1 file changed

+9
-1
lines changed

src/bootstrap/src/core/build_steps/run.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@ impl Step for Miri {
118118
fn run(self, builder: &Builder<'_>) {
119119
let host = builder.build.build;
120120
let target = self.target;
121-
let stage = builder.top_stage;
121+
122+
// `x run` uses stage 0 by default but miri does not work well with stage 0.
123+
// Change the stage to 1 if it's not set explicitly.
124+
let stage = if builder.config.is_explicit_stage() || builder.top_stage >= 1 {
125+
builder.top_stage
126+
} else {
127+
1
128+
};
129+
122130
if stage == 0 {
123131
eprintln!("miri cannot be run at stage 0");
124132
std::process::exit(1);

0 commit comments

Comments
 (0)