Skip to content

Commit 6563437

Browse files
committed
Create the OptimizedDist tool with a macro
1 parent 2f58193 commit 6563437

File tree

1 file changed

+1
-39
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+1
-39
lines changed

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

+1-39
Original file line numberDiff line numberDiff line change
@@ -445,51 +445,13 @@ bootstrap_tool!(
445445
WasmComponentLd, "src/tools/wasm-component-ld", "wasm-component-ld", is_unstable_tool = true, allow_features = "min_specialization";
446446
UnicodeTableGenerator, "src/tools/unicode-table-generator", "unicode-table-generator";
447447
FeaturesStatusDump, "src/tools/features-status-dump", "features-status-dump";
448+
OptimizedDist, "src/tools/opt-dist", "opt-dist", submodules = &["src/tools/rustc-perf"];
448449
);
449450

450451
/// These are the submodules that are required for rustbook to work due to
451452
/// depending on mdbook plugins.
452453
pub static SUBMODULES_FOR_RUSTBOOK: &[&str] = &["src/doc/book", "src/doc/reference"];
453454

454-
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
455-
pub struct OptimizedDist {
456-
pub compiler: Compiler,
457-
pub target: TargetSelection,
458-
}
459-
460-
impl Step for OptimizedDist {
461-
type Output = ToolBuildResult;
462-
463-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
464-
run.path("src/tools/opt-dist")
465-
}
466-
467-
fn make_run(run: RunConfig<'_>) {
468-
run.builder.ensure(OptimizedDist {
469-
compiler: run.builder.compiler(0, run.builder.config.build),
470-
target: run.target,
471-
});
472-
}
473-
474-
fn run(self, builder: &Builder<'_>) -> ToolBuildResult {
475-
// We need to ensure the rustc-perf submodule is initialized when building opt-dist since
476-
// the tool requires it to be in place to run.
477-
builder.require_submodule("src/tools/rustc-perf", None);
478-
479-
builder.ensure(ToolBuild {
480-
compiler: self.compiler,
481-
target: self.target,
482-
tool: "opt-dist",
483-
mode: Mode::ToolBootstrap,
484-
path: "src/tools/opt-dist",
485-
source_type: SourceType::InTree,
486-
extra_features: Vec::new(),
487-
allow_features: "",
488-
cargo_args: Vec::new(),
489-
})
490-
}
491-
}
492-
493455
/// The [rustc-perf](https://github.com/rust-lang/rustc-perf) benchmark suite, which is added
494456
/// as a submodule at `src/tools/rustc-perf`.
495457
#[derive(Debug, Clone, Hash, PartialEq, Eq)]

0 commit comments

Comments
 (0)