]> git.lizzy.rs Git - rust.git/commitdiff
Do not attempt to recompile codegen backend(s) with --keep-stage
authorMark Rousskov <mark.simulacrum@gmail.com>
Sat, 14 Jul 2018 00:45:13 +0000 (18:45 -0600)
committerMark Rousskov <mark.simulacrum@gmail.com>
Sat, 14 Jul 2018 02:15:11 +0000 (20:15 -0600)
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.

src/bootstrap/compile.rs

index 7d94bac66f7706aaf2fd10c19450c086954bae61..8cfd85590169841c815c5cb8010c5b4d755d17fc 100644 (file)
@@ -660,6 +660,16 @@ fn run(self, builder: &Builder) {
 
         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),