Skip to content

Commit

Permalink
Add stand-alone explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
trevyn committed May 31, 2023
1 parent 5dfae68 commit ac3ccdd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/ops/cargo_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ fn rm_rf(path: &Path, config: &Config, progress: &mut dyn CleaningProgressBar) -
let entry = entry?;
progress.on_clean()?;
if entry.file_type().is_dir() {
// `remove_dir_all` is used here due to https://github.com/rust-lang/cargo/issues/11441
// The contents should have been removed by now, but sometimes a race condition is hit
// where other files have been added by the OS. `paths::remove_dir_all` also falls back
// to `std::fs::remove_dir_all`, which may be more reliable than a simple walk in
// platform-specific edge cases.
paths::remove_dir_all(entry.path())
.with_context(|| "could not remove build directory")?;
} else {
Expand Down

0 comments on commit ac3ccdd

Please sign in to comment.