Skip to content

Commit d02eb95

Browse files
committed
remove struct CleanTools
1 parent a08b3c4 commit d02eb95

File tree

5 files changed

+21
-53
lines changed

5 files changed

+21
-53
lines changed

src/bootstrap/builder.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,19 @@ impl<'a> Builder<'a> {
762762
self.clear_if_dirty(&my_out, &libstd_stamp);
763763
self.clear_if_dirty(&my_out, &libtest_stamp);
764764
},
765-
Mode::Codegen => { },
766-
Mode::ToolStd => { },
767-
Mode::ToolTest => { },
765+
Mode::Codegen => {
766+
self.clear_if_dirty(&my_out, &self.rustc(compiler));
767+
self.clear_if_dirty(&my_out, &libstd_stamp);
768+
self.clear_if_dirty(&my_out, &libtest_stamp);
769+
},
770+
Mode::ToolBootstrap => { },
771+
Mode::ToolStd => {
772+
self.clear_if_dirty(&my_out, &libstd_stamp);
773+
},
774+
Mode::ToolTest => {
775+
self.clear_if_dirty(&my_out, &libstd_stamp);
776+
self.clear_if_dirty(&my_out, &libtest_stamp);
777+
},
768778
Mode::ToolRustc => {
769779
self.clear_if_dirty(&my_out, &libstd_stamp);
770780
self.clear_if_dirty(&my_out, &libtest_stamp);

src/bootstrap/check.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
use compile::{run_cargo, std_cargo, test_cargo, rustc_cargo, rustc_cargo_env, add_to_sysroot};
1414
use builder::{RunConfig, Builder, ShouldRun, Step};
15-
use tool::{self, prepare_tool_cargo};
15+
use tool::prepare_tool_cargo;
1616
use {Compiler, Mode};
1717
use cache::{INTERNER, Interned};
1818
use std::path::PathBuf;
@@ -223,12 +223,7 @@ impl Step for Rustdoc {
223223

224224
let libdir = builder.sysroot_libdir(compiler, target);
225225
add_to_sysroot(&builder, &libdir, &rustdoc_stamp(builder, compiler, target));
226-
227-
builder.ensure(tool::CleanTools {
228-
compiler,
229-
target,
230-
cause: Mode::Rustc,
231-
});
226+
builder.cargo(compiler, Mode::ToolRustc, target, "clean");
232227
}
233228
}
234229

src/bootstrap/compile.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use serde_json;
3232
use util::{exe, libdir, is_dylib, CiEnv};
3333
use {Compiler, Mode};
3434
use native;
35-
use tool;
3635

3736
use cache::{INTERNER, Interned};
3837
use builder::{Step, RunConfig, ShouldRun, Builder};
@@ -244,11 +243,7 @@ impl Step for StdLink {
244243
copy_apple_sanitizer_dylibs(builder, &builder.native_dir(target), "osx", &libdir);
245244
}
246245

247-
builder.ensure(tool::CleanTools {
248-
compiler: target_compiler,
249-
target,
250-
cause: Mode::Std,
251-
});
246+
builder.cargo(target_compiler, Mode::ToolStd, target, "clean");
252247
}
253248
}
254249

@@ -443,11 +438,8 @@ impl Step for TestLink {
443438
target));
444439
add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target),
445440
&libtest_stamp(builder, compiler, target));
446-
builder.ensure(tool::CleanTools {
447-
compiler: target_compiler,
448-
target,
449-
cause: Mode::Test,
450-
});
441+
442+
builder.cargo(target_compiler, Mode::ToolTest, target, "clean");
451443
}
452444
}
453445

@@ -604,11 +596,7 @@ impl Step for RustcLink {
604596
target));
605597
add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target),
606598
&librustc_stamp(builder, compiler, target));
607-
builder.ensure(tool::CleanTools {
608-
compiler: target_compiler,
609-
target,
610-
cause: Mode::Rustc,
611-
});
599+
builder.cargo(target_compiler, Mode::ToolRustc, target, "clean");
612600
}
613601
}
614602

src/bootstrap/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ pub enum Mode {
340340
/// Compile a tool which uses all libraries we compile (up to rustc).
341341
/// Doesn't use the stage0 compiler libraries like "other", and includes
342342
/// tools like rustdoc, cargo, rls, etc.
343+
ToolTest,
343344
ToolStd,
344345
ToolRustc,
345346
}
@@ -559,6 +560,7 @@ impl Build {
559560
Mode::Rustc => "-rustc",
560561
Mode::ToolBootstrap => "-bootstrap-tools",
561562
Mode::ToolStd => "-tools",
563+
Mode::ToolTest => "-tools",
562564
Mode::ToolRustc => "-tools",
563565
};
564566
self.out.join(&*compiler.host)

src/bootstrap/tool.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,6 @@ use channel::GitInfo;
2525
use cache::Interned;
2626
use toolstate::ToolState;
2727

28-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
29-
pub struct CleanTools {
30-
pub compiler: Compiler,
31-
pub target: Interned<String>,
32-
pub cause: Mode,
33-
}
34-
35-
impl Step for CleanTools {
36-
type Output = ();
37-
38-
fn should_run(run: ShouldRun) -> ShouldRun {
39-
run.never()
40-
}
41-
42-
fn run(self, _builder: &Builder) {
43-
let cause = self.cause;
44-
45-
for &cur_mode in &[Mode::Std, Mode::Test, Mode::Rustc] {
46-
// If we are a rustc tool, and std changed, we also need to clear ourselves out -- our
47-
// dependencies depend on std. Therefore, we iterate up until our own mode.
48-
if cause == cur_mode {
49-
break;
50-
}
51-
}
52-
}
53-
}
54-
5528
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
5629
struct ToolBuild {
5730
compiler: Compiler,

0 commit comments

Comments
 (0)