Skip to content

Commit 5766750

Browse files
ChrisDentondjc
authored andcommitted
Add comment on why we prefer symlinks to junctions
1 parent c72cb9e commit 5766750

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/raw.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
136136
fn symlink_dir_inner(src: &Path, dest: &Path) -> io::Result<()> {
137137
// On Windows creating symlinks isn't allowed by default so if it fails
138138
// we fallback to creating a directory junction.
139+
// We prefer to use symlinks here because junction point paths, unlike symlinks,
140+
// must always be absolute. This makes moving the rustup directory difficult.
139141
std::os::windows::fs::symlink_dir(src, dest).or_else(|_| symlink_junction_inner(src, dest))
140142
}
141143
#[cfg(not(windows))]

0 commit comments

Comments
 (0)