Skip to content

Commit

Permalink
Pass bootstrap cargo when --stage 0 and COMPILETST_FORCE_STAGE0
Browse files Browse the repository at this point in the history
And stop passing `BOOTSTRAP_CARGO` as an env var, instead the provided
cargo should go through `--cargo-path.`
  • Loading branch information
jieyouxu committed Sep 24, 2024
1 parent 35daf8b commit 6d132d9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,8 +1730,15 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
let is_rustdoc = suite.ends_with("rustdoc-ui") || suite.ends_with("rustdoc-js");

if mode == "run-make" {
let cargo = builder.ensure(tool::Cargo { compiler, target: compiler.host });
cmd.arg("--cargo-path").arg(cargo);
let cargo_path = if builder.top_stage == 0 {
// If we're using `--stage 0`, we should provide the bootstrap cargo.
builder.initial_cargo.clone()
} else {
// We need to properly build cargo using the suitable stage compiler.
builder.ensure(tool::Cargo { compiler, target: compiler.host })
};

cmd.arg("--cargo-path").arg(cargo_path);
}

// Avoid depending on rustdoc when we don't need it.
Expand Down Expand Up @@ -2088,8 +2095,6 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
cmd.arg("--rustfix-coverage");
}

cmd.env("BOOTSTRAP_CARGO", &builder.initial_cargo);

cmd.arg("--channel").arg(&builder.config.channel);

if !builder.config.omit_git_hash {
Expand Down

0 comments on commit 6d132d9

Please sign in to comment.