Skip to content

Commit

Permalink
Auto merge of #122205 - onur-ozkan:incorrect-sysroot-for-target, r=al…
Browse files Browse the repository at this point in the history
…bertlarsan68

ensure that sysroot is properly set for cross-targets

Previously, doing `x test compiler/*` would result in build failures due to missing libraries. This ensures properly setting up the sysroot for cross targets.
  • Loading branch information
bors committed Mar 12, 2024
2 parents a165f1f + d6fcc88 commit 7ecd864
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 @@ -2575,6 +2575,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 7ecd864

Please sign in to comment.