Skip to content

Commit bc9fc71

Browse files
committed
add TestFloatParse to tools for bootstrap
1 parent 86bd459 commit bc9fc71

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -3549,9 +3549,7 @@ impl Step for TestFloatParse {
35493549
let path = self.path.to_str().unwrap();
35503550
let crate_name = self.path.components().last().unwrap().as_os_str().to_str().unwrap();
35513551

3552-
if !builder.download_rustc() {
3553-
builder.ensure(compile::Std::new(compiler, self.host));
3554-
}
3552+
builder.ensure(tool::TestFloatParse { host: self.host });
35553553

35563554
// Run any unit tests in the crate
35573555
let cargo_test = tool::prepare_tool_cargo(

src/bootstrap/src/core/build_steps/tool.rs

+32
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,38 @@ tool_extended!((self, builder),
10961096
Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, add_bins_to_sysroot = ["rustfmt", "cargo-fmt"];
10971097
);
10981098

1099+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1100+
pub struct TestFloatParse {
1101+
pub host: TargetSelection,
1102+
}
1103+
1104+
impl Step for TestFloatParse {
1105+
type Output = ();
1106+
const ONLY_HOSTS: bool = true;
1107+
const DEFAULT: bool = false;
1108+
1109+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1110+
run.path("src/etc/test-float-parse")
1111+
}
1112+
1113+
fn run(self, builder: &Builder<'_>) {
1114+
let bootstrap_host = builder.config.build;
1115+
let compiler = builder.compiler(builder.top_stage, bootstrap_host);
1116+
1117+
builder.ensure(ToolBuild {
1118+
compiler,
1119+
target: bootstrap_host,
1120+
tool: "test-float-parse",
1121+
mode: Mode::ToolStd,
1122+
path: "src/etc/test-float-parse",
1123+
source_type: SourceType::InTree,
1124+
extra_features: Vec::new(),
1125+
allow_features: "",
1126+
cargo_args: Vec::new(),
1127+
});
1128+
}
1129+
}
1130+
10991131
impl Builder<'_> {
11001132
/// Gets a `BootstrapCommand` which is ready to run `tool` in `stage` built for
11011133
/// `host`.

0 commit comments

Comments
 (0)