jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.84k stars 238 forks source link

UBI backend picks incorrect "latest" version #2080

Closed jimeh closed 3 months ago

jimeh commented 3 months ago

Describe the bug

The UBI backend resolves latest as oldest remote version, rather than newest. This seems to be due to mise ls-remote ubi:[...] listing github release tags from newest to oldest, the @latest selector simply taking the last release from that list.

To Reproduce

$ mise ls-remote ubi:cargo-bins/cargo-binstall
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.5.0
v1.4.9
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.1
v1.3.0
v1.2.1
v1.2.0
install-cargo-binstall-1.0.0
v1.1.2
v1.1.1
v1.1.0
v1.0.0
v0.23.1
v0.23.0
v0.22.0
$ mise use -g ubi:cargo-bins/cargo-binstall@latest
mise ubi:cargo-bins/cargo-binstall@0.22.0 ✓ installed                                                                                                                                                                                                                                                                                                                                           mise ~/.config/mise/config.toml tools: ubi:cargo-bins/cargo-binstall@0.22.0

Expected behavior

That the correct latest version is picked and installed when use @latest selector.

mise doctor output

version: 2024.5.9 macos-arm64 (b9089f8 2024-05-12)
activated: yes
shims_on_path: yes

build_info: 
  Target: aarch64-apple-darwin
  Features: DEFAULT, GIT2, NATIVE_TLS, OPENSSL
  Built: Sun, 12 May 2024 23:56:30 +0000
  Rust Version: rustc 1.78.0 (9b00956e5 2024-04-29)
  Profile: release

shell: 
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

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

config_files: 
  ~/.config/mise/config.toml

backends: 
  cargo
  go
  npm
  pipx
  ubi

plugins: 
  1password-cli  https://github.com/NeoHsu/asdf-1password-cli.git#f5d5aab
  actionlint     https://github.com/crazy-matt/asdf-actionlint.git#f8df3cf
  awscli         https://github.com/MetricMike/asdf-awscli.git#ac99537
  buf            https://github.com/truepay/asdf-buf.git#6c27312
  bun            (core)
  ctop           https://github.com/NeoHsu/asdf-ctop.git#77c1040
  deno           (core)
  direnv         https://github.com/asdf-community/asdf-direnv.git#a2219c2
  dust           https://github.com/looztra/asdf-dust.git#11bdb8a
  erlang         (core)
  ffmpeg         https://github.com/acj/asdf-ffmpeg#6286583
  github-cli     https://github.com/bartlomiejdanek/asdf-github-cli.git#e0605b7
  go             (core)
  golangci-lint  https://github.com/hypnoglow/asdf-golangci-lint.git#fee877b
  goreleaser     https://github.com/kforsthoevel/asdf-goreleaser.git#821ed34
  hadolint       https://github.com/devlincashman/asdf-hadolint.git#335e230
  helm           https://github.com/Antiarchitect/asdf-helm.git#f4b7f38
  hey            https://github.com/raimon49/asdf-hey.git#e1002d4
  java           (core)
  jq             https://github.com/mise-plugins/asdf-jq.git#6d86d19
  k9s            https://github.com/looztra/asdf-k9s.git#2b3af87
  kubectl        https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  kubectx        https://gitlab.com/wt0f/asdf-kubectx.git#8c0b4aa
  lua            https://github.com/Stratus3D/asdf-lua.git#f0f1ed9
  neovim         https://github.com/richin13/asdf-neovim.git#cefa92a
  node           (core)
  python         (core)
  rclone         https://github.com/johnlayton/asdf-rclone.git#6d0fb47
  ripgrep        https://gitlab.com/wt0f/asdf-ripgrep.git#e836665
  ruby           (core)
  rust           https://github.com/code-lever/asdf-rust.git#95acf4f
  shellcheck     https://github.com/luizm/asdf-shellcheck.git#780d78d
  shfmt          https://github.com/luizm/asdf-shfmt.git#a42c5ff
  starship       https://github.com/grimoh/asdf-starship.git#9ffad1c
  talosctl       https://github.com/bjw-s/asdf-talosctl#9efd59b
  terraform      https://github.com/asdf-community/asdf-hashicorp.git#f1602b6
  terraform-ls   https://github.com/asdf-community/asdf-hashicorp.git#f1602b6
  tflint         https://github.com/skyzyx/asdf-tflint.git#37e7eb9
  usage          https://github.com/jdx/mise-usage.git#fe3888a
  yj             https://github.com/ryodocx/asdf-yj.git#e97b5ca
  yq             https://github.com/sudermanjr/asdf-yq.git#772992f
  zig            (core)
  zoxide         https://github.com/nyrst/asdf-zoxide#8ed95c9

toolset: 
  cargo:bacon@2.17.0    
  cargo:bat@0.24.0      
  cargo:cargo-audit@0.20.0  
  cargo:cargo-binstall@1.6.5  
  cargo:cargo-edit@0.12.2  
  cargo:cargo-info@0.7.6  
  cargo:cargo-quickinstall@0.2.10  
  cargo:cargo-update@13.4.0  
  cargo:difftastic@0.57.0  
  cargo:dirstat-rs@0.3.7  
  cargo:eza@0.18.14     
  cargo:gitu@0.19.2     
  cargo:hexyl@0.14.0    
  cargo:hwatch@0.3.13   
  cargo:jwt-cli@6.0.0   
  cargo:kubectl-watch@0.2.4  
  cargo:sccache@0.8.0   
  cargo:tlrc@1.9.2      
  cargo:ubi@0.0.29      
  cargo:watchexec-cli@2.1.1  
  go:github.com/bufbuild/buf-language-server/cmd/bufls@latest  
  go:github.com/go-delve/delve/cmd/dlv@1.22.1  
  go:github.com/golang/mock/mockgen@1.6.0  
  go:github.com/hashicorp/terraform-ls@0.33.1  
  go:github.com/nametake/golangci-lint-langserver@0.0.9  
  go:github.com/rakyll/hey@0.1.4  
  go:github.com/segmentio/golines@0.12.2  
  go:golang.org/x/tools/cmd/godoc@0.21.0  
  go:golang.org/x/tools/cmd/goimports@0.21.0  
  go:golang.org/x/tools/gopls@0.15.3  
  go:golang.org/x/vuln/cmd/govulncheck@1.1.0  
  go:google.golang.org/grpc/cmd/protoc-gen-go-grpc@1.3.0  
  go:google.golang.org/protobuf/cmd/protoc-gen-go@1.34.1  
  go:mvdan.cc/gofumpt@0.6.0  
  npm:@mermaid-js/mermaid-cli@10.9.0  
  npm:@prettier/plugin-php@0.22.2  
  npm:@prettier/plugin-ruby@4.0.4  
  npm:@prettier/plugin-xml@3.4.1  
  npm:dockerfile-language-server-nodejs@0.11.0  
  npm:eslint@9.2.0      
  npm:eslint-config-prettier@9.1.0  
  npm:eslint-plugin-prettier@5.1.3  
  npm:eslint_d@13.1.2   
  npm:htmllint-cli@0.0.7  
  npm:httpsnippet@3.0.1  
  npm:jsonlint@1.6.3    
  npm:localtunnel@2.0.2  
  npm:markdown-it@14.1.0  
  npm:prettier@3.2.5    
  npm:prettier-plugin-toml@2.0.1  
  npm:prettier-pnp@0.3.0  
  npm:stylelint@16.5.0  
  npm:typescript@5.4.5  
  npm:typescript-formatter@7.2.2  
  npm:typescript-language-server@4.3.3  
  npm:uuid-cli@2.0.0    
  npm:vscode-css-languageserver-bin@1.4.0  
  npm:vscode-json-languageserver@1.3.4  
  npm:yaml-language-server@1.14.0  
  1password-cli@2.28.0  
  actionlint@1.7.0      
  buf@1.31.0            
  ctop@0.7.7            
  direnv@2.34.0         
  dust@1.0.0            
  github-cli@2.49.1     
  go@1.22.3             
  golangci-lint@1.58.1  
  goreleaser@1.26.0     
  hadolint@2.12.0       
  helm@3.14.4           
  jq@1.7.1              
  k9s@0.32.4            
  kubectl@1.30.0        
  kubectx@0.9.5         
  lua@5.4.6             
  neovim@0.9.5          
  node@20.13.1          
  python@3.12.3         
  rclone@1.66.0         
  ripgrep@14.1.0        
  ruby@3.3.1            
  shellcheck@0.10.0     
  shfmt@3.8.0           
  starship@1.18.2       
  talosctl@1.7.1        
  terraform@1.8.3       
  tflint@0.51.1         
  usage@0.2.0           
  yj@5.1.0              
  yq@4.44.1             
  zoxide@0.9.4          
  ubi:goreleaser/goreleaser@1.13.1  

env_vars: 
  MISE_INSTALL_PATH=/Users/jimeh/.local/share/mise/bin/mise
  MISE_SHELL=zsh

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

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

No warnings found
No problems found

Additional context

N/A

jimeh commented 3 months ago

Hmmm, I might be missing something, UBI still doesn't seem to install the latest version of cargo-binstall for me:


jimeh@noct ~ ❯ mise version
2024.5.12 macos-arm64 (29a84f8 2024-05-13)
jimeh@noct ~ ❯ mise upgrade cargo:ubi
mise All tools are up to date
jimeh@noct ~ ❯ mise use -g ubi:cargo-bins/cargo-binstall
mise ubi:cargo-bins/cargo-binstall@v0.22.0 ✓ installed                                                                                                                                                                                                                                                                                                                                          mise ~/.config/mise/config.toml tools: ubi:cargo-bins/cargo-binstall@v0.22.0
jdx commented 3 months ago

try clearing cache, it's working for me:

jdx in 🌐 bamboo in mise  bubble  1 ❯ m use -g ubi:cargo-bins/cargo-binstall
mise ubi:cargo-bins/cargo-binstall@v1.6.6 ✓ installed                                                                 mise ~/.config/mise/config.toml tools: ubi:cargo-bins/cargo-binstall@v1.6.6
jimeh commented 3 months ago

🤦‍♂️... I was missing something, clearing the cache. I did no think of that in my half-asleep state last night :)

Apologies for the hassle, and thank you again :D