Skip to content

Commit e792d1d

Browse files
collin5Mark-Simulacrum
authored andcommitted
remove struct CleanTools
1 parent de3ec8d commit e792d1d

File tree

5 files changed

+22
-53
lines changed

5 files changed

+22
-53
lines changed

src/bootstrap/builder.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ impl<'a> Builder<'a> {
754754
match mode {
755755
Mode::Std => {
756756
self.clear_if_dirty(&my_out, &self.rustc(compiler));
757+
self.clear_if_dirty(&my_out, &libstd_stamp);
757758
},
758759
Mode::Test => {
759760
self.clear_if_dirty(&my_out, &libstd_stamp);
@@ -763,9 +764,19 @@ impl<'a> Builder<'a> {
763764
self.clear_if_dirty(&my_out, &libstd_stamp);
764765
self.clear_if_dirty(&my_out, &libtest_stamp);
765766
},
766-
Mode::Codegen => { },
767-
Mode::ToolStd => { },
768-
Mode::ToolTest => { },
767+
Mode::Codegen => {
768+
self.clear_if_dirty(&my_out, &self.rustc(compiler));
769+
self.clear_if_dirty(&my_out, &libstd_stamp);
770+
self.clear_if_dirty(&my_out, &libtest_stamp);
771+
},
772+
Mode::ToolBootstrap => { },
773+
Mode::ToolStd => {
774+
self.clear_if_dirty(&my_out, &libstd_stamp);
775+
},
776+
Mode::ToolTest => {
777+
self.clear_if_dirty(&my_out, &libstd_stamp);
778+
self.clear_if_dirty(&my_out, &libtest_stamp);
779+
},
769780
Mode::ToolRustc => {
770781
self.clear_if_dirty(&my_out, &libstd_stamp);
771782
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, SourceType};
15+
use tool::{prepare_tool_cargo, SourceType};
1616
use {Compiler, Mode};
1717
use cache::{INTERNER, Interned};
1818
use std::path::PathBuf;
@@ -236,12 +236,7 @@ impl Step for Rustdoc {
236236

237237
let libdir = builder.sysroot_libdir(compiler, target);
238238
add_to_sysroot(&builder, &libdir, &rustdoc_stamp(builder, compiler, target));
239-
240-
builder.ensure(tool::CleanTools {
241-
compiler,
242-
target,
243-
cause: Mode::Rustc,
244-
});
239+
builder.cargo(compiler, Mode::ToolRustc, target, "clean");
245240
}
246241
}
247242

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

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

@@ -606,11 +598,7 @@ impl Step for RustcLink {
606598
target));
607599
add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target),
608600
&librustc_stamp(builder, compiler, target));
609-
builder.ensure(tool::CleanTools {
610-
compiler: target_compiler,
611-
target,
612-
cause: Mode::Rustc,
613-
});
601+
builder.cargo(target_compiler, Mode::ToolRustc, target, "clean");
614602
}
615603
}
616604

src/bootstrap/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ pub enum Mode {
347347
/// Compile a tool which uses all libraries we compile (up to rustc).
348348
/// Doesn't use the stage0 compiler libraries like "other", and includes
349349
/// tools like rustdoc, cargo, rls, etc.
350+
ToolTest,
350351
ToolStd,
351352
ToolRustc,
352353
}
@@ -567,6 +568,7 @@ impl Build {
567568
Mode::Codegen => "-codegen",
568569
Mode::ToolBootstrap => "-bootstrap-tools",
569570
Mode::ToolStd => "-tools",
571+
Mode::ToolTest => "-tools",
570572
Mode::ToolRustc => "-tools",
571573
};
572574
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
pub enum SourceType {
5730
InTree,

0 commit comments

Comments
 (0)