Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c4cca3a

Browse files
committedSep 30, 2017
Auto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 15 pull requests - Successful merges: #44124, #44287, #44320, #44694, #44708, #44794, #44797, #44824, #44836, #44840, #44845, #44854, #44889, #44900, #44903 - Failed merges:
2 parents 4491ea5 + d6451f0 commit c4cca3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+458
-318
lines changed
 

‎src/bootstrap/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<'a> Builder<'a> {
306306
Subcommand::Bench { ref paths, .. } => (Kind::Bench, &paths[..]),
307307
Subcommand::Dist { ref paths } => (Kind::Dist, &paths[..]),
308308
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
309-
Subcommand::Clean => panic!(),
309+
Subcommand::Clean { .. } => panic!(),
310310
};
311311

312312
let builder = Builder {

‎src/bootstrap/clean.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,37 @@
1313
//! Responsible for cleaning out a build directory of all old and stale
1414
//! artifacts to prepare for a fresh build. Currently doesn't remove the
1515
//! `build/cache` directory (download cache) or the `build/$target/llvm`
16-
//! directory as we want that cached between builds.
16+
//! directory unless the --all flag is present.
1717
1818
use std::fs;
1919
use std::io::{self, ErrorKind};
2020
use std::path::Path;
2121

2222
use Build;
2323

24-
pub fn clean(build: &Build) {
24+
pub fn clean(build: &Build, all: bool) {
2525
rm_rf("tmp".as_ref());
26-
rm_rf(&build.out.join("tmp"));
27-
rm_rf(&build.out.join("dist"));
2826

29-
for host in &build.hosts {
30-
let entries = match build.out.join(host).read_dir() {
31-
Ok(iter) => iter,
32-
Err(_) => continue,
33-
};
27+
if all {
28+
rm_rf(&build.out);
29+
} else {
30+
rm_rf(&build.out.join("tmp"));
31+
rm_rf(&build.out.join("dist"));
3432

35-
for entry in entries {
36-
let entry = t!(entry);
37-
if entry.file_name().to_str() == Some("llvm") {
38-
continue
33+
for host in &build.hosts {
34+
let entries = match build.out.join(host).read_dir() {
35+
Ok(iter) => iter,
36+
Err(_) => continue,
37+
};
38+
39+
for entry in entries {
40+
let entry = t!(entry);
41+
if entry.file_name().to_str() == Some("llvm") {
42+
continue
43+
}
44+
let path = t!(entry.path().canonicalize());
45+
rm_rf(&path);
3946
}
40-
let path = t!(entry.path().canonicalize());
41-
rm_rf(&path);
4247
}
4348
}
4449
}

0 commit comments

Comments
 (0)
Please sign in to comment.