File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,17 @@ impl Step for Std {
192192
193193 let mut target_deps = builder. ensure ( StartupObjects { compiler, target } ) ;
194194
195- let compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
195+ let mut compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
196196 trace ! ( ?compiler_to_use) ;
197197
198- if compiler_to_use != compiler {
198+ if compiler_to_use != compiler
199+ // Never uplift std unless we have compiled stage 2; if stage 2 is compiled,
200+ // uplift it from there.
201+ //
202+ // FIXME: improve `fn compiler_for` to avoid adding stage condition here.
203+ && compiler. stage > 2
204+ {
205+ compiler_to_use. stage = 2 ;
199206 trace ! ( ?compiler_to_use, ?compiler, "compiler != compiler_to_use, uplifting library" ) ;
200207
201208 builder. ensure ( Std :: new ( compiler_to_use, target) ) ;
You can’t perform that action at this time.
0 commit comments