Skip to content

Prefer using symlinks on Windows #3677

@ChrisDenton

Description

@ChrisDenton

Problem you are trying to solve

On Windows rustup currently uses junction points exclusively.

rustup/src/utils/raw.rs

Lines 136 to 141 in d55d41c

fn symlink_dir_inner(src: &Path, dest: &Path) -> io::Result<()> {
// std's symlink uses Windows's symlink function, which requires
// admin. We can create directory junctions the hard way without
// though.
symlink_junction_inner(src, dest)
}

(note: that comment is wrong, user symlinks can be enabled by granting a single permission or more recently by enabling developer mode)

Junction points are always absolute which makes moving rustup (e.g. when setting up a dev drive) a more fraught process than it needs to be.

Solution you'd like

Use symlink_dir and only fallback to juncture points if that fails.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions