Skip to content

bootstrap: fix clean's remove_dir_all implementation#129187

Merged
bors merged 1 commit intorust-lang:masterfrom
jieyouxu:squeaky-clean-windows-symlinks
Aug 22, 2024
Merged

bootstrap: fix clean's remove_dir_all implementation#129187
bors merged 1 commit intorust-lang:masterfrom
jieyouxu:squeaky-clean-windows-symlinks

Conversation

@jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Aug 17, 2024

It turns out bootstrap's clean.rs's hand-rolled rm_rf (which probably comes before std::fs::remove_dir_all was stable) is very broken on native Windows around both read-only files/directories and especially symbolic links. So instead of rolling our own, just use std::fs::remove_dir_all.

This is a related to compiletest's own rm_rf implementation #129155 which happens to be also buggy, which in turn is a blocker for the rmake.rs test port #128562 that heavily exercises symlinks (I was reviewing #128562 and testing it on native Windows which is how I found out).

Fixes #112544 (because now we handle Windows symlinks properly).

try-job: x86_64-msvc
try-job: i686-mingw
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-apple
try-job: aarch64-gnu

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap cannot remove host symlink on Windows if created from WSL2

7 participants