-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiletest: aggressive_rm_rf
might not be aggressive enough
#126334
Labels
A-compiletest
Area: The compiletest test runner
A-run-make
Area: port run-make Makefiles to rmake.rs
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jieyouxu
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
A-compiletest
Area: The compiletest test runner
A-run-make
Area: port run-make Makefiles to rmake.rs
labels
Jun 12, 2024
github-project-automation
bot
moved this to Backlog
in compiletest maintenance and improvements
Jun 12, 2024
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jun 12, 2024
jieyouxu
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jun 12, 2024
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Aug 22, 2024
…iler-errors compiletest: use `std::fs::remove_dir_all` now that it is available It turns out `aggressive_rm_rf` is not sufficiently aggressive (RAGEY) on Windows and obviously handles Windows symlinks incorrectly. Instead of rolling our own version, let's use `std::fs::remove_dir_all` now that it's available (well, it's been available for a good while, but probably wasn't available when this helper was written). cc rust-lang#129187 since basically this is failing due to similar problems. Blocker for rust-lang#128562. Fixes rust-lang#129155. Fixes rust-lang#126334.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 22, 2024
Rollup merge of rust-lang#129302 - jieyouxu:compiletest-RAGEY, r=compiler-errors compiletest: use `std::fs::remove_dir_all` now that it is available It turns out `aggressive_rm_rf` is not sufficiently aggressive (RAGEY) on Windows and obviously handles Windows symlinks incorrectly. Instead of rolling our own version, let's use `std::fs::remove_dir_all` now that it's available (well, it's been available for a good while, but probably wasn't available when this helper was written). cc rust-lang#129187 since basically this is failing due to similar problems. Blocker for rust-lang#128562. Fixes rust-lang#129155. Fixes rust-lang#126334.
github-project-automation
bot
moved this from Backlog
to Done
in compiletest maintenance and improvements
Aug 22, 2024
Re-opening due to revert #129413. |
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 |
jieyouxu
changed the title
compiletest:
compiletest: Dec 22, 2024
aggressive_rm_rf
might not be aggressive enough on non-Windows platformsaggressive_rm_rf
might not be aggressive enough
This was referenced Dec 22, 2024
github-project-automation
bot
moved this from Backlog
to Done
in compiletest maintenance and improvements
Dec 23, 2024
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 23, 2024
Rollup merge of rust-lang#134659 - jieyouxu:recursive-remove, r=ChrisDenton test-infra: improve compiletest and run-make-support symlink handling I was trying to implement rust-lang#134656 to port `tests/run-make/incr-add-rust-src-component.rs`, but found some blockers related to symlink handling, so in this PR I tried to resolve them by improving symlink handling in compiletest and run-make-support (particularly for native windows msvc environment). Key changes: - I needed to copy symlinks (duplicate a symlink pointing to the same file), so I pulled out the copy symlink logic and re-exposed it as `run_make_support::rfs::copy_symlink`. This helper correctly accounts for the Windows symlink-to-file vs symlink-to-dir distinction (hereafter "Windows symlinks") when copying symlinks. - `recursive_remove`: - I needed a way to remove symlinks themselves (no symlink traversal). `std::fs::remove_dir_all` handles them, but only if the root path is a directory. So I wrapped `std::fs::remove_dir_all` to also handle when the root path is a non-directory entity (e.g. file or symlink). Again, this properly accounts for Windows symlinks. - I wanted to use this for both compiletest and run-make-support, so I put the implementation and accompanying tests in `build_helper`. - In this sense, it's a reland of rust-lang#129302 with proper test coverage. - It's a thin wrapper around `std::fs::remove_dir_all` (`remove_dir_all` correctly handles read-only entries on Windows). The helper has additional permission-setting logic for when the root path is a non-dir entry on Windows to handle read-only non-dir entry. Fixes rust-lang#126334.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-compiletest
Area: The compiletest test runner
A-run-make
Area: port run-make Makefiles to rmake.rs
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
rust/src/tools/compiletest/src/runtest.rs
Lines 3420 to 3441 in bbe9a9c
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 causefs::remove_file
to fail, which can lead to artifacts lingering around and cause tests results to not be reproducible.The text was updated successfully, but these errors were encountered: