Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,9 @@ impl Builder<'_> {
// Avoid doing this during dry run as that usually means the relevant
// compiler is not yet linked/copied properly.
//
// Only clear out the directory if we're compiling std; otherwise, we
// Only clear out the directory if we're running Cargo on std; otherwise, we
// should let Cargo take care of things for us (via depdep info)
if !self.config.dry_run() && mode == Mode::Std && cmd_kind == Kind::Build {
if !self.config.dry_run() && mode == Mode::Std {
build_stamp::clear_if_dirty(self, &out_dir, &self.rustc(compiler));
}

Expand Down
8 changes: 7 additions & 1 deletion src/bootstrap/src/utils/build_stamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ pub fn clear_if_dirty(builder: &Builder<'_>, dir: &Path, input: &Path) -> bool {
let stamp = BuildStamp::new(dir);
let mut cleared = false;
if mtime(stamp.path()) < mtime(input) {
builder.do_if_verbose(|| println!("Dirty - {}", dir.display()));
builder.do_if_verbose(|| {
println!(
"Removing dirty directory `{}` because `{}` changed",
dir.display(),
input.display(),
)
});
let _ = fs::remove_dir_all(dir);
cleared = true;
} else if stamp.path().exists() {
Expand Down
Loading