Skip to content

Commit a569c24

Browse files
Do not attempt to recompile codegen backend(s) with --keep-stage
Previously we'd attempt to recompile them and that would fail since we've essentially not built the entire compiler yet, or we're faking that fact. This commit should make us ignore the codegen backend build as well. Unlike the other compile steps, there is no CodegenBackendLink step that we run here, because that is done later as a part of assembling the final compiler and as an explicit function call.
1 parent a14a361 commit a569c24

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/compile.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,16 @@ impl Step for CodegenBackend {
660660

661661
builder.ensure(Rustc { compiler, target });
662662

663+
if let Some(keep_stage) = builder.config.keep_stage {
664+
if keep_stage <= compiler.stage {
665+
println!("Warning: Using a potentially old codegen backend. \
666+
This may not behave well.");
667+
// Codegen backends are linked separately from this step today, so we don't do
668+
// anything here.
669+
return;
670+
}
671+
}
672+
663673
if builder.force_use_stage1(compiler, target) {
664674
builder.ensure(CodegenBackend {
665675
compiler: builder.compiler(1, builder.config.build),

0 commit comments

Comments
 (0)