diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 40bf6c48296b2..f1488d7ebded3 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -689,11 +689,14 @@ impl Step for Sysroot { /// 1-3. fn run(self, builder: &Builder<'_>) -> Interned { let compiler = self.compiler; - let sysroot = if compiler.stage == 0 { - builder.out.join(&compiler.host.triple).join("stage0-sysroot") + let sysroot = if builder.kind == Kind::Check { + "check-sysroot".to_owned() + } else if compiler.stage == 0 { + "stage0-sysroot".to_owned() } else { - builder.out.join(&compiler.host.triple).join(format!("stage{}", compiler.stage)) + format!("stage{}", compiler.stage) }; + let sysroot = builder.out.join(&compiler.host.triple).join(sysroot); let _ = fs::remove_dir_all(&sysroot); t!(fs::create_dir_all(&sysroot));