Repository navigation
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-run-makeArea: port run-make Makefiles to rmake.rsArea: port run-make Makefiles to rmake.rsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
rust/src/tools/compiletest/src/runtest.rs
Lines 3420 to 3441 in bbe9a9c
| fn aggressive_rm_rf(&self, path: &Path) -> io::Result<()> { | |
| for e in path.read_dir()? { | |
| let entry = e?; | |
| let path = entry.path(); | |
| if entry.file_type()?.is_dir() { | |
| self.aggressive_rm_rf(&path)?; | |
| } else { | |
| // Remove readonly files as well on windows (by default we can't) | |
| fs::remove_file(&path).or_else(|e| { | |
| if cfg!(windows) && e.kind() == io::ErrorKind::PermissionDenied { | |
| let mut meta = entry.metadata()?.permissions(); | |
| meta.set_readonly(false); | |
| fs::set_permissions(&path, meta)?; | |
| fs::remove_file(&path) | |
| } else { | |
| Err(e) | |
| } | |
| })?; | |
| } | |
| } | |
| fs::remove_dir(path) | |
| } |
aggressive_rm_rf seems to only account for read-only files in Windows (and tries really hard to rm -rf), but does not try as hard on Linux or macOS or other non-Windows platforms. This can pose issues to tests that modifies file or folder permissions in one way or another that could cause fs::remove_file to fail, which can lead to artifacts lingering around and cause tests results to not be reproducible.
Metadata
Metadata
Assignees
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-run-makeArea: port run-make Makefiles to rmake.rsArea: port run-make Makefiles to rmake.rsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
- StatusShow more project fieldsDone
Activity
Rollup merge of rust-lang#129302 - jieyouxu:compiletest-RAGEY, r=comp…
Rollup merge of rust-lang#129302 - jieyouxu:compiletest-RAGEY, r=comp…
Unrolled build for rust-lang#129302
jieyouxu commentedon Aug 22, 2024
Re-opening due to revert #129413.
jieyouxu commentedon Dec 22, 2024
compiletest triage: ironically this is not aggressive enough for Windows platforms either. For example, Windows distinguishes between symlink-to-file versus symlink-to-directory, and you need to use the matching
remove_fileandremove_dirrespectively.[-]compiletest: `aggressive_rm_rf` might not be aggressive enough on non-Windows platforms[/-][+]compiletest: `aggressive_rm_rf` might not be aggressive enough[/+]Rollup merge of rust-lang#134659 - jieyouxu:recursive-remove, r=Chris…
Unrolled build for rust-lang#134659