Skip to content

Commit

Permalink
bootstrap: register features-status-dump as runnable tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Nov 28, 2024
1 parent a5e5453 commit a542953
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/bootstrap/src/core/build_steps/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,34 @@ impl Step for UnicodeTableGenerator {
cmd.run(builder);
}
}

#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
pub struct FeaturesStatusDump;

impl Step for FeaturesStatusDump {
type Output = ();
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/features-status-dump")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(FeaturesStatusDump);
}

fn run(self, builder: &Builder<'_>) {
let mut cmd = builder.tool_cmd(Tool::FeaturesStatusDump);

cmd.arg("--library-path");
cmd.arg(builder.src.join("library"));

cmd.arg("--compiler-path");
cmd.arg(builder.src.join("compiler"));

cmd.arg("--output-path");
cmd.arg(builder.out.join("features-status-dump.json"));

cmd.run(builder);
}
}
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ bootstrap_tool!(
RustcPerfWrapper, "src/tools/rustc-perf-wrapper", "rustc-perf-wrapper";
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
UnicodeTableGenerator, "src/tools/unicode-table-generator", "unicode-table-generator";
FeaturesStatusDump, "src/tools/features-status-dump", "features-status-dump";
);

/// These are the submodules that are required for rustbook to work due to
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ impl<'a> Builder<'a> {
run::GenerateWindowsSys,
run::GenerateCompletions,
run::UnicodeTableGenerator,
run::FeaturesStatusDump,
),
Kind::Setup => {
describe!(setup::Profile, setup::Hook, setup::Link, setup::Editor)
Expand Down

0 comments on commit a542953

Please sign in to comment.