Skip to content

Commit 6d132d9

Browse files
committed
Pass bootstrap cargo when --stage 0 and COMPILETST_FORCE_STAGE0
And stop passing `BOOTSTRAP_CARGO` as an env var, instead the provided cargo should go through `--cargo-path.`
1 parent 35daf8b commit 6d132d9

File tree

1 file changed

+9
-4
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+9
-4
lines changed

src/bootstrap/src/core/build_steps/test.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,15 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
17301730
let is_rustdoc = suite.ends_with("rustdoc-ui") || suite.ends_with("rustdoc-js");
17311731

17321732
if mode == "run-make" {
1733-
let cargo = builder.ensure(tool::Cargo { compiler, target: compiler.host });
1734-
cmd.arg("--cargo-path").arg(cargo);
1733+
let cargo_path = if builder.top_stage == 0 {
1734+
// If we're using `--stage 0`, we should provide the bootstrap cargo.
1735+
builder.initial_cargo.clone()
1736+
} else {
1737+
// We need to properly build cargo using the suitable stage compiler.
1738+
builder.ensure(tool::Cargo { compiler, target: compiler.host })
1739+
};
1740+
1741+
cmd.arg("--cargo-path").arg(cargo_path);
17351742
}
17361743

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

2091-
cmd.env("BOOTSTRAP_CARGO", &builder.initial_cargo);
2092-
20932098
cmd.arg("--channel").arg(&builder.config.channel);
20942099

20952100
if !builder.config.omit_git_hash {

0 commit comments

Comments
 (0)