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 @@ -191,10 +191,17 @@ impl Step for Std {
191191
192192 let mut target_deps = builder. ensure ( StartupObjects { compiler, target } ) ;
193193
194- let compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
194+ let mut compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
195195 trace ! ( ?compiler_to_use) ;
196196
197- if compiler_to_use != compiler {
197+ if compiler_to_use != compiler
198+ // Never uplift std unless we have compiled stage 2; if stage 2 is compiled,
199+ // uplift it from there.
200+ //
201+ // FIXME: improve `fn compiler_for` to avoid adding stage condition here.
202+ && compiler. stage > 2
203+ {
204+ compiler_to_use. stage = 2 ;
198205 trace ! ( ?compiler_to_use, ?compiler, "compiler != compiler_to_use, uplifting library" ) ;
199206
200207 builder. ensure ( Std :: new ( compiler_to_use, target) ) ;
You can’t perform that action at this time.
0 commit comments