Skip to content

Commit f5dff8d

Browse files
committed
bootstrap: wire up src/tools/features-status-dump as a runnable tool
And also register its check step.
1 parent d4dcef7 commit f5dff8d

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

src/bootstrap/src/core/build_steps/check.rs

+1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ tool_check_step!(Rls { path: "src/tools/rls" });
455455
tool_check_step!(Rustfmt { path: "src/tools/rustfmt" });
456456
tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools" });
457457
tool_check_step!(TestFloatParse { path: "src/etc/test-float-parse" });
458+
tool_check_step!(FeaturesStatusDump { path: "src/tools/features-status-dump" });
458459

459460
tool_check_step!(Bootstrap { path: "src/bootstrap", default: false });
460461

src/bootstrap/src/core/build_steps/run.rs

+31
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,34 @@ impl Step for UnicodeTableGenerator {
311311
cmd.run(builder);
312312
}
313313
}
314+
315+
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
316+
pub struct FeaturesStatusDump;
317+
318+
impl Step for FeaturesStatusDump {
319+
type Output = ();
320+
const ONLY_HOSTS: bool = true;
321+
322+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
323+
run.path("src/tools/features-status-dump")
324+
}
325+
326+
fn make_run(run: RunConfig<'_>) {
327+
run.builder.ensure(FeaturesStatusDump);
328+
}
329+
330+
fn run(self, builder: &Builder<'_>) {
331+
let mut cmd = builder.tool_cmd(Tool::FeaturesStatusDump);
332+
333+
cmd.arg("--library-path");
334+
cmd.arg(builder.src.join("library"));
335+
336+
cmd.arg("--compiler-path");
337+
cmd.arg(builder.src.join("compiler"));
338+
339+
cmd.arg("--output-path");
340+
cmd.arg(builder.out.join("features-status-dump.json"));
341+
342+
cmd.run(builder);
343+
}
344+
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ bootstrap_tool!(
363363
RustcPerfWrapper, "src/tools/rustc-perf-wrapper", "rustc-perf-wrapper";
364364
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
365365
UnicodeTableGenerator, "src/tools/unicode-table-generator", "unicode-table-generator";
366+
FeaturesStatusDump, "src/tools/features-status-dump", "features-status-dump";
366367
);
367368

368369
/// These are the submodules that are required for rustbook to work due to

src/bootstrap/src/core/builder/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ impl<'a> Builder<'a> {
938938
check::Bootstrap,
939939
check::RunMakeSupport,
940940
check::Compiletest,
941+
check::FeaturesStatusDump,
941942
),
942943
Kind::Test => describe!(
943944
crate::core::build_steps::toolstate::ToolStateCheck,
@@ -1089,6 +1090,7 @@ impl<'a> Builder<'a> {
10891090
run::GenerateWindowsSys,
10901091
run::GenerateCompletions,
10911092
run::UnicodeTableGenerator,
1093+
run::FeaturesStatusDump,
10921094
),
10931095
Kind::Setup => {
10941096
describe!(setup::Profile, setup::Hook, setup::Link, setup::Editor)

0 commit comments

Comments
 (0)