Skip to content

Commit

Permalink
ensure that sysroot is properly set 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 libraries.
This change ensures that it is prepared.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Mar 12, 2024
1 parent 735f758 commit d6fcc88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,12 @@ impl Step for Crate {
// we're working with automatically.
let compiler = builder.compiler_for(compiler.stage, compiler.host, target);

// During cross compilations, sysroot for the target may not be available.
// Ensure that it is prepared.
if builder.config.build != target {
builder.ensure(compile::Std::new(compiler, compiler.host));
}

let mut cargo = builder::Cargo::new(
builder,
compiler,
Expand Down

0 comments on commit d6fcc88

Please sign in to comment.