Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mise prune wanna remove a tool just installed by mise use: probably version tag slash/dash issue #2870

Closed
powerman opened this issue Oct 30, 2024 · 1 comment · Fixed by #3217
Labels
bug Something isn't working

Comments

@powerman
Copy link
Contributor

Describe the bug
After installing a tool with mise use following mise prune asks to delete it.

To Reproduce

$ mise use ubi:plandex-ai/plandex@cli/v1.1.1
mise Installed binary into /home/powerman/.local/share/mise/installs/ubi-plandex-ai-plandex/cli-v1.1.1/bin/plandex
mise ubi:plandex-ai/plandex@cli/v1.1.1 ✓ installed
mise ~/tmp/mise-proj/.mise.toml tools: ubi:plandex-ai/plandex@cli/v1.1.1
$ cat .mise.toml
[tools]
"ubi:plandex-ai/plandex" = "cli/v1.1.1"
$ mise prune -y
mise pruned configuration links
mise ubi:plandex-ai/[email protected] ✓ removing ~/.cache/mise/ubi-plandex-ai-plandex/cli-v1.1.1

Expected behavior
mise prune shouldn't remove tool listed in .mise.toml.

mise doctor output

version: 2024.10.13 linux-x64 (ee83488 2024-10-28)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 28 Oct 2024 03:25:17 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-pc-linux-gnu)

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/.config/mise/config.toml
  ~/tmp/mise-bug-plandex/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:

toolset:
  ubi:plandex-ai/plandex@cli/v1.1.1  (missing)
  ubi:jdx/[email protected]

env_vars:
  MISE_SHELL=zsh

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cache_prune_age = "30d"
  ci = false
  color = true
  debug = false
  disable_backends = []
  disable_default_registry = false
  disable_hints = []
  disable_tools = []
  experimental = true
  fetch_remote_versions_cache = "1h"
  fetch_remote_versions_timeout = "10s"
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = "30s"
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  lockfile = false
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  yes = false

  [cargo]
  binstall = true

  [node]

  [pipx]
  uvx = false

  [python]
  default_packages_file = "~/.default-python-packages"
  pyenv_repo = "https://github.com/pyenv/pyenv.git"
  venv_auto_create = false
  venv_stdlib = false

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
No warnings found
1 problem found:

1. unused shims are present, run mise reshim to remove them
   Unused shims: plandex

Additional context
It's weird mise prune reports version as cli-v1.1.1 instead of cli/v1.1.1 - maybe it's related to the issue.

@powerman powerman added the bug Something isn't working label Oct 30, 2024
jdx added a commit that referenced this issue Nov 26, 2024
jdx added a commit that referenced this issue Nov 26, 2024
jdx added a commit that referenced this issue Nov 26, 2024
@syhol
Copy link
Contributor

syhol commented Nov 26, 2024

I can confirm that #3195 seems to have fixed the immediate problem:

mise use ubi:plandex-ai/plandex@cli/v1.1.1
mise Installed binary into /Users/simon/.local/share/mise/installs/ubi-plandex-ai-plandex/cli-v1.1.1/bin/plandex
mise ubi:plandex-ai/plandex@cli/v1.1.1 ✓ installed                                                                                                                                                    mise ~/Code/sandbox/vars/mise.toml tools: ubi:plandex-ai/plandex@cli/v1.1.1rm mise.tomlmise prune
mise pruned configuration links
remove ubi:plandex-ai/[email protected] ? Yes
mise ubi:plandex-ai/[email protected] ✓ remove ~/Library/Caches/mise/ubi-plandex-ai-plandex/cli-v1.1.1                                                                                               

However the tool is now listed twice in mise ls

mise ls
Tool                    Version     Config Source                 Requested
ubi:plandex-ai/plandex  cli/v1.1.1  ~/Code/sandbox/vars/mise.toml cli/v1.1.1
ubi:plandex-ai/plandex  cli-v1.1.1

Both are removed after the prune.

jdx added a commit that referenced this issue Nov 26, 2024
@jdx jdx closed this as completed in #3217 Nov 27, 2024
jdx added a commit that referenced this issue Nov 27, 2024
* fix: use tv.short in `mise prune`

Fixes #2870

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants