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.
This commit is contained in:
Mark Rousskov 2018-07-13 18:45:13 -06:00
parent a14a361c2c
commit a569c249c2

View file

@ -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),