diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-06-17 22:43:44 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-06-18 13:28:29 +0300 |
| commit | f76c3b7fb971fb7d8a0909f107378416bb2d2029 (patch) | |
| tree | 4c2b06af9b7882da987b1a2caabd3decc160528a /src/bootstrap | |
| parent | e794b0f8557c187b5909d889aa35071f81e0a4cc (diff) | |
| download | rust-f76c3b7fb971fb7d8a0909f107378416bb2d2029.tar.gz rust-f76c3b7fb971fb7d8a0909f107378416bb2d2029.zip | |
replace `remove_dir` with `remove_dir_all` in `helpers::symlink_dir`
When using `symlink_dir`, it first removes the existing link with `remove_dir`. However, if the path isn't a link and contains files, `remove_dir` fails with "DirectoryNotEmpty", which causes the symbolic linking to fail as well. We have this problem on linking 'rustlib/rust' because it contains files as an actual directory. Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/utils/helpers.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs index 13d1346b3d9..55cb05f864a 100644 --- a/src/bootstrap/src/utils/helpers.rs +++ b/src/bootstrap/src/utils/helpers.rs @@ -135,7 +135,7 @@ pub fn symlink_dir(config: &Config, original: &Path, link: &Path) -> io::Result< if config.dry_run() { return Ok(()); } - let _ = fs::remove_dir(link); + let _ = fs::remove_dir_all(link); return symlink_dir_inner(original, link); #[cfg(not(windows))] |
