Skip to content

uninstall: --keep-* flags are ignored when config, data, and cache directories overlap (default layout) #626

Open

Description

@pmoutsias-amd

Problem

On a default install, rocm uninstall ignores a --keep-* flag when the config, data, and cache directories overlap.

By default, default_config_dir() and default_data_dir() both resolve to ~/.rocm, and default_cache_dir() resolves to ~/.rocm/cache (crates/rocm-core/src/runtime.rs). build_uninstall_plan() (apps/rocm/src/main.rs) plans one removal per category unless that category's flag is set, so:

  • --keep-data still plans config: ~/.rocm, which deletes the downloaded models, managed ROCm SDK installs, and uv-cache that the flag is meant to keep.
  • --keep-config still plans data: ~/.rocm, which contains the config.
  • --keep-cache still plans config: ~/.rocm, which contains cache/.

A user who passes --keep-data on a default install loses every managed runtime and downloaded model.

Suggested fix

When planning removals, skip any directory that equals or contains a directory of a kept category (and, for a kept category inside a removed one, remove only the non-kept entries, or refuse and explain). Add a dry-run test on the default layout for each --keep-* flag.

Current mitigation

The README and docs/engine-plugins.md now tell users to pass --keep-config together with --keep-data on a default install (#616). Remove that caveat when this is fixed.

Found by the automated review on #616.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions