jdx / mise

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

mise panics when autocompleting #2670

Closed ralgozino closed 1 month ago

ralgozino commented 1 month ago

Describe the bug

When pressing ⇥ Tab to trigger the autocomplete I got the following error instead of the autocomplete:

mise Error:   × Invalid usage config
thread 'main' panicked at library/std/src/io/mod.rs:1844:21:

I noticed this since updating to the latest version 2024.9.10 macos-arm64 (2024-09-26), but maybe it happens with some previous version too.

First the error was a little misleading, I focused on the panic part until I realised that usage is referencing the usage dependency actually and it is not the usage word.

I then ran mise upgrade and saw that usage was upgraded from version 0.3.1 to 0.6.0.

To Reproduce

downgrade usage to 0.3.1 (probably with some other version not the latest happens too, I haven't tested it).

Expected behavior

I would have expected the tab completion to work or, in this particular case, I think mise should check that the version of usage is the minimum required, or even better upgrade it automatically. It is managed by mise itself after all.

mise doctor output

version: 2024.9.10 macos-arm64 (2024-09-26)
activated: yes
shims_on_path: yes

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Thu, 26 Sep 2024 21:41:52 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04) (Homebrew)
  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
  ~/src/test/furyctl-on-multipass/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  ansible-base   https://github.com/amrox/asdf-pyapp.git#41f5275
  aws-nuke       https://github.com/bersalazar/asdf-aws-nuke.git#f76d8f0
  awscli         https://github.com/MetricMike/asdf-awscli.git#2e31396
  azure-cli      https://github.com/EcoMind/asdf-azure-cli.git#4735c27
  bats           https://github.com/timgluz/asdf-bats.git#299551f
  clusterctl     https://github.com/pfnet-research/asdf-clusterctl.git#169bd58
  cmctl          https://github.com/asdf-community/asdf-cmctl.git#26740f9
  crystal        https://github.com/asdf-community/asdf-crystal.git#6b5c52a
  dive           https://github.com/looztra/asdf-dive.git#1321207
  drone          https://github.com/virtualstaticvoid/asdf-drone.git#1553f4d
  dyff           https://gitlab.com/wt0f/asdf-dyff.git#8878ca0
  furyctl        https://github.com/sighupio/asdf-furyctl.git#b788bb3
  git-chglog     https://github.com/GoodwayGroup/asdf-git-chglog.git#ef79c13
  github-cli     https://github.com/bartlomiejdanek/asdf-github-cli.git#e0605b7
  go-getter      https://github.com/ryodocx/asdf-go-getter.git#7483a12
  golangci-lint  https://github.com/hypnoglow/asdf-golangci-lint.git#fee877b
  goreleaser     https://github.com/kforsthoevel/asdf-goreleaser.git#821ed34
  helm           https://github.com/Antiarchitect/asdf-helm.git#a39e17b
  helm-ct        https://github.com/tablexi/asdf-helm-ct.git#3e3ec87
  jq             https://github.com/lsanwick/asdf-jq.git#addae51
  k9s            https://github.com/looztra/asdf-k9s.git#2b3af87
  kind           https://github.com/johnlayton/asdf-kind.git#4b6ed61
  kubectl        https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  kubectx        https://gitlab.com/wt0f/asdf-kubectx.git#8c0b4aa
  kustomize      https://github.com/Banno/asdf-kustomize.git#8e929af
  make           https://github.com/yacchi/asdf-make.git#2f12c4d
  mc             https://github.com/penpyt/asdf-mc.git#b0458cf
  minikube       https://github.com/alvarobp/asdf-minikube.git#a6adc7b
  minio          https://github.com/aeons/asdf-minio.git#113b19d
  mkcert         https://github.com/salasrod/asdf-mkcert.git#e706f46
  okteto         https://github.com/BradenM/asdf-okteto#34f28d7
  opa            https://github.com/tochukwuvictor/asdf-opa.git#5734a47
  packer         https://github.com/asdf-community/asdf-hashicorp.git#197e3ec
  pluto          https://github.com/FairwindsOps/asdf-pluto.git#e30adc6
  postgres       https://github.com/smashedtoatoms/asdf-postgres.git#acbbc49
  rbac-lookup    https://github.com/looztra/asdf-rbac-lookup.git#4d9ceb3
  stern          https://github.com/looztra/asdf-stern.git#e17efba
  syft           https://github.com/davidgp1701/asdf-syft.git#f070c59
  tekton-cli     https://github.com/johnhamelink/asdf-tekton-cli.git#9b39514
  terraform      https://github.com/asdf-community/asdf-hashicorp.git#197e3ec
  trivy          https://github.com/zufardhiyaulhaq/asdf-trivy.git#537a22a
  usage          https://github.com/jdx/mise-usage.git#fe3888a
  uv             https://github.com/asdf-community/asdf-uv.git#f339c19
  velero         https://github.com/looztra/asdf-velero.git#1ebf994
  yarn           https://github.com/twuni/asdf-yarn.git#376c540
  yq             https://github.com/sudermanjr/asdf-yq.git#772992f

toolset:
  yq@4.34.1
  terraform@1.4.6
  kustomize@3.10.0
  kubectl@1.30.2
  node@20.5.1
  kind@0.23.0
  go-getter@1.7.1
  helm@3.15.1
  velero@1.8.1
  opa@0.41.0
  kubectx@0.9.5
  bats@1.1.0
  cmctl@1.10.0
  awscli@2.8.12
  pluto@5.19.0
  python@3.12.2
  usage@0.3.1
  clusterctl@1.7.3
  mc@2023-01-28T20-29-38Z
  uv@0.4.5
  rbac-lookup@0.10.2
  furyctl@0.29.8

env_vars:
  MISE_SHELL=zsh

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cache_prune_age = "30d"
  cargo_binstall = true
  ci = false
  color = true
  debug = false
  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 = 1
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  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"
  python_venv_auto_create = false
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false

  [node]

  [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
No problems found

Additional context

I have set up mise and autocomplete in my .zshrc file like this:

eval "$(/opt/homebrew/bin/mise activate zsh)"
eval "$(/opt/homebrew/bin/mise completion zsh)"
jdx commented 1 month ago

oh I think I need to release the latest usage version

jc00ke commented 1 month ago

I hadn't upgraded usage since 0.3.0 :fearful: Is there a chance usage can get bundled into the apt repo for auto updates like mise?