Skip to content

Commit

Permalink
Do not attempt to recompile codegen backend(s) with --keep-stage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mark-Simulacrum committed Jul 14, 2018
1 parent a14a361 commit a569c24
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bootstrap/compile.rs
Expand Up @@ -660,6 +660,16 @@ impl Step for CodegenBackend {

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

if let Some(keep_stage) = builder.config.keep_stage {
if keep_stage <= compiler.stage {
println!("Warning: Using a potentially old codegen backend. \
This may not behave well.");
// Codegen backends are linked separately from this step today, so we don't do
// anything here.
return;
}
}

if builder.force_use_stage1(compiler, target) {
builder.ensure(CodegenBackend {
compiler: builder.compiler(1, builder.config.build),
Expand Down

0 comments on commit a569c24

Please sign in to comment.