Skip to content

uninstall: remove a directory symlink or junction root on Windows with remove_dir #560

Open

Description

@rominf

Current behavior

On Windows, remove_path (used by rocm uninstall and rocm storage remove-downloads) calls remove_file on any symlink. A directory symlink or junction needs RemoveDirectory, so a config, data or cache folder that is a directory link may fail to uninstall. This is untested; no Windows lane covers it.

Expected behavior

A directory symlink or junction root is unlinked, never followed, whether or not it is written with a trailing \.

Possible solution

On Windows, when FileTypeExt::is_symlink_dir() is true (junctions included), call fs::remove_dir, which removes the link without following it. Add a Windows-lane test that covers:

  • a symlinked root;
  • a junction root;
  • both of the above written with a trailing \.

Related: #532 (the Linux trailing-slash case).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions