Skip to content

Commit bc9fc71

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

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
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‎

Lines changed: 32 additions & 0 deletions
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+
pubstructTestFloatParse{
1101+
pubhost:TargetSelection,
1102+
}
1103+
1104+
implStepforTestFloatParse{
1105+
typeOutput = ();
1106+
constONLY_HOSTS:bool = true;
1107+
constDEFAULT:bool = false;
1108+
1109+
fnshould_run(run:ShouldRun<'_>) -> ShouldRun<'_>{
1110+
run.path("src/etc/test-float-parse")
1111+
}
1112+
1113+
fnrun(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
implBuilder<'_>{
11001132
/// Gets a `BootstrapCommand` which is ready to run `tool` in `stage` built for
11011133
/// `host`.

0 commit comments

Comments
 (0)