Skip to content

Commit 46bfaa2

Browse files
committed
Implement RunMakeSupport tool using the bootstrap_tool! macro
1 parent e0a00d0 commit 46bfaa2

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

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

-45
Original file line numberDiff line numberDiff line change
@@ -1211,51 +1211,6 @@ macro_rules! test {
12111211
};
12121212
}
12131213

1214-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
1215-
pub struct RunMakeSupport {
1216-
pub compiler: Compiler,
1217-
pub target: TargetSelection,
1218-
}
1219-
1220-
impl Step for RunMakeSupport {
1221-
type Output = PathBuf;
1222-
const DEFAULT: bool = true;
1223-
1224-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1225-
run.never()
1226-
}
1227-
1228-
fn make_run(run: RunConfig<'_>) {
1229-
let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple());
1230-
run.builder.ensure(RunMakeSupport { compiler, target: run.build_triple() });
1231-
}
1232-
1233-
/// Builds run-make-support and returns the path to the resulting rlib.
1234-
fn run(self, builder: &Builder<'_>) -> PathBuf {
1235-
builder.ensure(compile::Std::new(self.compiler, self.target));
1236-
1237-
let cargo = tool::prepare_tool_cargo(
1238-
builder,
1239-
self.compiler,
1240-
Mode::ToolStd,
1241-
self.target,
1242-
Kind::Build,
1243-
"src/tools/run-make-support",
1244-
SourceType::InTree,
1245-
&[],
1246-
);
1247-
1248-
cargo.into_cmd().run(builder);
1249-
1250-
let lib_name = "librun_make_support.rlib";
1251-
let lib = builder.tools_dir(self.compiler).join(lib_name);
1252-
1253-
let cargo_out = builder.cargo_out(self.compiler, Mode::ToolStd, self.target).join(lib_name);
1254-
builder.copy_link(&cargo_out, &lib);
1255-
lib
1256-
}
1257-
}
1258-
12591214
/// Runs `cargo test` on the `src/tools/run-make-support` crate.
12601215
/// That crate is used by run-make tests.
12611216
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

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

+1
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ bootstrap_tool!(
467467
UnicodeTableGenerator, "src/tools/unicode-table-generator", "unicode-table-generator";
468468
FeaturesStatusDump, "src/tools/features-status-dump", "features-status-dump";
469469
OptimizedDist, "src/tools/opt-dist", "opt-dist", submodules = &["src/tools/rustc-perf"];
470+
RunMakeSupport, "src/tools/run-make-support", "run_make_support", artifact_kind = ToolArtifactKind::Library;
470471
);
471472

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

0 commit comments

Comments
 (0)