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

Tools installed via "cargo:a/b@rev:012" immediately pruned #2583

Open
liskin opened this issue Sep 15, 2024 · 0 comments
Open

Tools installed via "cargo:a/b@rev:012" immediately pruned #2583

liskin opened this issue Sep 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@liskin
Copy link

liskin commented Sep 15, 2024

Describe the bug
Tools installed via the cargo: backend from git with a version specified as "rev:…" result in two entries in mise ls, and therefore mise prune suggests to remove the tool.

$ mise ls
Tool                             Version                                       Config Source              Requested                                   
cargo:JojiiOfficial/LiveBudsCli  ref:4a2d75f5bede545738110dccbac033954b1d6087                                                                         
cargo:JojiiOfficial/LiveBudsCli  rev:4a2d75f5bede545738110dccbac033954b1d6087  ~/.config/mise/config.toml rev:4a2d75f5bede545738110dccbac033954b1d6087

Running mise use -g …@ref:… afterwards seems to prevent mise prune from removing it, but the resulting mise config is invalid then—the cargo backend will fail when asked to install a ref:… version:

$ mise uninstall cargo:JojiiOfficial/LiveBudsCli
$ mise use -g --pin cargo:JojiiOfficial/LiveBudsCli@ref:4a2d75f5bede545738110dccbac033954b1d6087
mise Invalid cargo git version: ref:4a2d75f5bede545738110dccbac033954b1d6087
mise Run with --verbose or MISE_VERBOSE=1 for more information

To Reproduce

  1. mise use -g --pin cargo:JojiiOfficial/LiveBudsCli@rev:4a2d75f5bede545738110dccbac033954b1d6087
  2. mise prune
  3. Answer yes to "remove cargo:JojiiOfficial/LiveBudsCli@ref:4a2d75f5bede545738110dccbac033954b1d6087 ?" (note the ref: instead of rev:)

Expected behavior
I expect the cargo backend to consistently handle the ref/rev version specification—in other words if it accepts only "rev:…", then it shouldn't install a version named "ref:…" and then think it is prunable.

mise doctor output

version: 2024.9.3 linux-x64 (e0d1317 2024-09-12)
activated: no
shims_on_path: yes

build_info: 
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Thu, 12 Sep 2024 23:07:12 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell: 
  /bin/bash
  GNU bash, version 5.2.32(1)-release (x86_64-pc-linux-gnu)
  Copyright (C) 2022 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

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

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins: 
  usage  https://github.com/jdx/mise-usage.git#fe3888a

toolset: 
  ubi:cargo-bins/cargo-binstall@v1.10.5  
  usage@0.3.1           
  cargo:ast-grep@0.17.1  
  cargo:cargo-audit@0.18.3  
  cargo:cargo-cache@0.8.3  
  cargo:cargo-edit@0.12.2  
  cargo:cargo-watch@8.5.2  
  cargo:watchexec-cli@1.25.1  
  ubi:YodaEmbedding/frece@v1.0.6  
  cargo:ripgrep_all@0.10.6  
  cargo:tokio-console@0.1.9  
  cargo:JojiiOfficial/LiveBudsCli@rev:4a2d75f5bede545738110dccbac033954b1d6087  

env_vars: 
  (none)

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = true
  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 = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  node_compile = false
  not_found_auto_install = false
  paranoid = true
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "always"
  show_env = true
  show_tools = false

No warnings found
No problems found
@liskin liskin added the bug Something isn't working label Sep 15, 2024
liskin added a commit to liskin/dotfiles that referenced this issue Sep 16, 2024
Can't switch everything because jdx/mise#2583 :-(
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

No branches or pull requests

1 participant