You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deny compiletest self-tests being run against stage 0 rustc unless forced
Otherwise, `compiletest` would have to know e.g. how to parse two
different target spec, if target spec format was changed between beta
`rustc` and in-tree `rustc`.
Even when forced, neither `compiletest` nor `compiletest` self-tests are
expected to pass against a non-in-tree `rustc`, such as if the stage 0
`rustc` happens to be a beta `rustc`.
@@ -713,9 +716,23 @@ impl Step for CompiletestTest {
713
716
}
714
717
715
718
/// Runs `cargo test` for compiletest.
719
+
#[cfg_attr(
720
+
feature = "tracing",
721
+
instrument(level = "debug", name = "CompiletestTest::run", skip_all)
722
+
)]
716
723
fnrun(self,builder:&Builder<'_>){
717
724
let host = self.host;
725
+
726
+
if builder.top_stage == 0 && !builder.config.compiletest_force_stage0{
727
+
eprintln!("\
728
+
ERROR: `--stage 0` runs compiletest self-tests against the stage0 (precompiled) compiler, not the in-tree compiler, and will almost always cause tests to fail
729
+
NOTE: if you're sure you want to do this, please open an issue as to why. In the meantime, you can override this with `--set build.compiletest-force-stage0=true`."
730
+
);
731
+
crate::exit!(1);
732
+
}
733
+
718
734
let compiler = builder.compiler(builder.top_stage, host);
735
+
debug!(?compiler);
719
736
720
737
// We need `ToolStd` for the locally-built sysroot because
721
738
// compiletest uses unstable features of the `test` crate.
0 commit comments