jdx / mise

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

Installing `jq` via new built-in UBI fails #2764

Open jimeh opened 2 days ago

jimeh commented 2 days ago

Describe the bug

When using mise to install jq, it fails with a 404 error trying to lookup the tag. The ubi CLI however can install jq just fine.

I believe it stems from the fact that JQ's git tags have a jq- prefix, so latest tag is jq-1.7.1.

To Reproduce

Attempt to install latest version:

$ mi use -g ubi:jqlang/jq@latest --verbose                                                                                                                                                                                                                                                                             ☸ nobu(default)  v20.17.0 1 [22:09:42]
DEBUG mise::cli ARGS: /Users/jimeh/.local/share/mise/bin/mise use -g ubi:jqlang/jq@latest --verbose
DEBUG mise::config config: ~/.config/mise/config.toml
DEBUG mise::toolset install_versions: ubi:jqlang/jq@latest
DEBUG mise::http GET https://api.github.com/repos/jqlang/jq/releases/tags/latest
DEBUG reqwest::connect starting new connection: https://api.github.com/
DEBUG mise::http GET https://api.github.com/repos/jqlang/jq/releases/tags/latest 404 Not Found
DEBUG ubi Parsed --project jqlang/jq = jqlang / jq
DEBUG ubi exe name = jq
DEBUG ubi install path = /Users/jimeh/.local/share/mise/installs/ubi-jqlang-jq/latest/bin/jq
DEBUG reqwest::connect starting new connection: https://api.github.com/
Error:
   0: HTTP status client error (404 Not Found) for url (https://api.github.com/repos/jqlang/jq/releases/tags/vlatest)

Location:
   src/backend/ubi.rs:90

Version:
   2024.10.7 macos-arm64 (7d15bd5 2024-10-14)

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮
   4: <mise::backend::ubi::UbiBackend as mise::backend::Backend>::install_version_impl::h065dbf1a922aca93
      at <unknown source file>:<unknown line>
   5: mise::backend::Backend::install_version::h27c6bf0c5410e36f
      at <unknown source file>:<unknown line>
   6: std::sys::backtrace::__rust_begin_short_backtrace::h1c6a2e222519b033
      at <unknown source file>:<unknown line>
   7: core::ops::function::FnOnce::call_once{{vtable.shim}}::h6ea12d94fe4c7ebe
      at <unknown source file>:<unknown line>
   8: std::sys::pal::unix::thread::Thread::new::thread_start::h1bd1b9c95010bf71
      at <unknown source file>:<unknown line>
   9: __pthread_joiner_wake<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

Attempting to install a specific version:

$ mi use -g ubi:jqlang/jq@1.7.1 --verbose                                                                                                                                                                                                                                                                              ☸ nobu(default)  v20.17.0 1 [22:12:00]
DEBUG mise::cli ARGS: /Users/jimeh/.local/share/mise/bin/mise use -g ubi:jqlang/jq@1.7.1 --verbose
DEBUG mise::config config: ~/.config/mise/config.toml
DEBUG mise::toolset install_versions: ubi:jqlang/jq@1.7.1
DEBUG mise::http GET https://api.github.com/repos/jqlang/jq/releases/tags/1.7.1
DEBUG reqwest::connect starting new connection: https://api.github.com/
DEBUG mise::http GET https://api.github.com/repos/jqlang/jq/releases/tags/1.7.1 404 Not Found
DEBUG ubi Parsed --project jqlang/jq = jqlang / jq
DEBUG ubi exe name = jq
DEBUG ubi install path = /Users/jimeh/.local/share/mise/installs/ubi-jqlang-jq/1.7.1/bin/jq
DEBUG reqwest::connect starting new connection: https://api.github.com/
Error:
   0: HTTP status client error (404 Not Found) for url (https://api.github.com/repos/jqlang/jq/releases/tags/v1.7.1)

Location:
   src/backend/ubi.rs:90

Version:
   2024.10.7 macos-arm64 (7d15bd5 2024-10-14)

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮
   4: <mise::backend::ubi::UbiBackend as mise::backend::Backend>::install_version_impl::h065dbf1a922aca93
      at <unknown source file>:<unknown line>
   5: mise::backend::Backend::install_version::h27c6bf0c5410e36f
      at <unknown source file>:<unknown line>
   6: std::sys::backtrace::__rust_begin_short_backtrace::h1c6a2e222519b033
      at <unknown source file>:<unknown line>
   7: core::ops::function::FnOnce::call_once{{vtable.shim}}::h6ea12d94fe4c7ebe
      at <unknown source file>:<unknown line>
   8: std::sys::pal::unix::thread::Thread::new::thread_start::h1bd1b9c95010bf71
      at <unknown source file>:<unknown line>
   9: __pthread_joiner_wake<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

Expected behavior

That mise installs jq correctly, just like ubi -p jqlang/jq does.

mise doctor output

version: 2024.10.7 macos-arm64 (7d15bd5 2024-10-14)
activated: yes
shims_on_path: yes

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 14 Oct 2024 22:19:06 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  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
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  1password-cli  https://github.com/NeoHsu/asdf-1password-cli.git#f5d5aab
  actionlint     https://github.com/crazy-matt/asdf-actionlint.git#f8df3cf
  argocd         https://github.com/beardix/asdf-argocd.git#429bbf9
  awscli         https://github.com/MetricMike/asdf-awscli.git#c26bbb4
  buf            https://github.com/truepay/asdf-buf.git#6c27312
  ctop           https://github.com/NeoHsu/asdf-ctop.git#77c1040
  direnv         https://github.com/asdf-community/asdf-direnv.git#6ff3dbe
  ffmpeg         https://github.com/acj/asdf-ffmpeg#6286583
  fzf            https://github.com/kompiro/asdf-fzf.git#f8fcea1
  github-cli     https://github.com/bartlomiejdanek/asdf-github-cli.git#e0605b7
  helm           https://github.com/Antiarchitect/asdf-helm.git#091d00f
  helm-diff      https://github.com/dex4er/asdf-helm-diff.git#47bb84b
  hey            https://github.com/raimon49/asdf-hey.git#e1002d4
  k9s            https://github.com/looztra/asdf-k9s.git#a79bed6
  kubectl        https://github.com/asdf-community/asdf-kubectl.git#2fb3b57
  kubectx        https://gitlab.com/wt0f/asdf-kubectx.git#8c0b4aa
  kustomize      https://github.com/Banno/asdf-kustomize.git#8e929af
  lua            https://github.com/Stratus3D/asdf-lua.git#e0c15ea
  neovim         https://github.com/richin13/asdf-neovim.git#d6118ad
  rclone         https://github.com/johnlayton/asdf-rclone.git#6a87924
  ripgrep        https://gitlab.com/wt0f/asdf-ripgrep.git#e836665
  rust           https://github.com/code-lever/asdf-rust.git#95acf4f
  shellcheck     https://github.com/luizm/asdf-shellcheck.git#66200ff
  shfmt          https://github.com/luizm/asdf-shfmt.git#a42c5ff
  sops           https://github.com/mise-plugins/mise-sops#a4186d6
  starship       https://github.com/grimoh/asdf-starship.git#9f7504b
  talosctl       https://github.com/bjw-s/asdf-talosctl#5e79375
  terraform      https://github.com/asdf-community/asdf-hashicorp.git#22eb1c4
  terraform-ls   https://github.com/asdf-community/asdf-hashicorp.git#22eb1c4
  tflint         https://github.com/skyzyx/asdf-tflint.git#37e7eb9
  usage          https://github.com/jdx/mise-usage.git#fe3888a
  yt-dlp         https://github.com/duhow/asdf-yt-dlp#152effb
  zoxide         https://github.com/nyrst/asdf-zoxide#8ed95c9

toolset:
  cargo:bacon@2.21.0
  cargo:bat@0.24.0
  cargo:cargo-audit@0.20.1
  cargo:cargo-binstall@1.10.6
  cargo:cargo-edit@0.13.0
  cargo:cargo-info@0.7.7
  cargo:cargo-update@14.1.1
  cargo:difftastic@0.60.0
  cargo:dirstat-rs@0.3.7
  cargo:eza@0.19.4
  cargo:gitu@0.25.0
  cargo:hexyl@0.14.0
  cargo:hwatch@0.3.15
  cargo:jwt-cli@6.1.1
  cargo:kubectl-watch@0.2.4
  cargo:paper-terminal@3.0.0
  cargo:sccache@0.8.1
  cargo:tlrc@1.9.3
  cargo:watchexec-cli@2.1.2
  cargo:ubi-cli@0.2.0
  go:github.com/DarthSim/hivemind@1.1.0
  go:github.com/bufbuild/buf-language-server/cmd/bufls@latest
  go:github.com/danielgtaylor/restish@0.20.0
  go:github.com/go-delve/delve/cmd/dlv@1.23.1
  go:github.com/golang/mock/mockgen@1.6.0
  go:github.com/hashicorp/terraform-ls@0.34.3
  go:github.com/nametake/golangci-lint-langserver@0.0.9
  go:github.com/rakyll/hey@0.1.4
  go:github.com/rhysd/actionlint/cmd/actionlint@1.7.2
  go:github.com/rogpeppe/godef@1.1.2
  go:github.com/segmentio/golines@0.12.2
  go:golang.org/x/tools/cmd/godoc@0.25.0
  go:golang.org/x/tools/cmd/goimports@0.25.0
  go:golang.org/x/tools/gopls@0.16.2
  go:golang.org/x/vuln/cmd/govulncheck@1.1.3
  go:google.golang.org/grpc/cmd/protoc-gen-go-grpc@1.5.1
  go:google.golang.org/protobuf/cmd/protoc-gen-go@1.34.2
  go:mvdan.cc/gofumpt@0.7.0
  npm:@mermaid-js/mermaid-cli@11.2.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.13.0
  npm:eslint@9.11.1
  npm:eslint-config-prettier@9.1.0
  npm:eslint-plugin-prettier@5.2.1
  npm:eslint_d@14.0.4
  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.3.3
  npm:prettier-plugin-toml@2.0.1
  npm:prettier-pnp@0.3.0
  npm:stylelint@16.9.0
  npm:typescript@5.6.2
  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.15.0
  ubi:argoproj/argo-cd@v2.12.4
  ubi:bcicen/ctop@v0.7.7
  ubi:bootandy/dust@v1.1.1
  ubi:bufbuild/buf@v1.45.0
  ubi:cli/cli@v2.58.0
  ubi:golangci/golangci-lint@v1.61.0
  ubi:goreleaser/goreleaser@v2.3.2
  ubi:mikefarah/yq@v4.44.3
  ubi:sclevine/yj@v5.1.0
  ubi:hadolint/hadolint@v2.12.0
  ubi:helmfile/helmfile@v0.168.0
  ubi:jqlang/jq@1.7.1   (missing)
  1password-cli@2.30.0
  direnv@2.35.0
  fzf@0.55.0
  go@1.23.2
  helm@3.16.2
  k9s@0.32.5
  kubectl@1.31.1
  kubectx@0.9.5
  kustomize@5.5.0
  lua@5.4.7
  node@20.17.0
  python@3.12.6
  rclone@1.68.1
  ripgrep@14.1.1
  ruby@3.3.5
  shellcheck@0.10.0
  shfmt@3.9.0
  starship@1.20.1
  talosctl@1.8.1
  terraform@1.9.7
  tflint@0.53.0
  usage@0.8.4
  zoxide@0.9.6

env_vars:
  MISE_INSTALL_PATH=~/.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
  cache_prune_age = "30d"
  cargo_binstall = true
  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
  log_level = "info"
  not_found_auto_install = false
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  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 = "never"
  show_env = true
  show_tools = false
No warnings found
No problems found
roele commented 18 hours ago

To me this looks like an issues with resolving latest (mise latest does not return anything) as following works just fine mise i ubi:jqlang/jq@jq-1.7.1.

Looks like the ubi backend should implement its own fuzzy match logic to accommodate for other prefixes besides v.

jimeh commented 18 hours ago

What's interesting is that the ubi CLI does correctly install the latest version when I run ubi -p jqlang/jq.