Skip to content

Commit

Permalink
ensure std for cross-targets
Browse files Browse the repository at this point in the history
Previously, doing `x test compiler/*` would fail the build due to missing std.
This change ensures that it is prepared.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Mar 13, 2024
1 parent 735f758 commit a4aecdc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2563,8 +2563,17 @@ impl Step for Crate {
let target = self.target;
let mode = self.mode;

// See [field@compile::Std::force_recompile].
builder.ensure(compile::Std::force_recompile(compiler, target));
// If we're not in stage 0, then we won't have a std from the beta
// compiler around. That means we need to make sure there's one in
// the sysroot for the compiler to find. Otherwise, we're going to
// fail when building crates that need to generate code (e.g., build
// scripts and their dependencies).
if compiler.stage != 0 {
// See [field@compile::Std::force_recompile].
builder.ensure(compile::Std::force_recompile(compiler, compiler.host));
builder.ensure(compile::Std::force_recompile(compiler, target));
}

builder.ensure(RemoteCopyLibs { compiler, target });

// If we're not doing a full bootstrap but we're testing a stage2
Expand Down

0 comments on commit a4aecdc

Please sign in to comment.