Skip to content

Commit c5adf58

Browse files
committed
update std uplifting algorithm
Signed-off-by: onur-ozkan <[email protected]>
1 parent 5dc0d89 commit c5adf58

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)