jdx / mise

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

What is set by `mise link` is not observed when running `mise use` or `mise doctor` #2796

Open gullpong opened 1 week ago

gullpong commented 1 week ago

Describe the bug I'm running on M3 MacBook and I have an issue with installing node@12.16.0 via mise install. So I've used installing it by nvm which worked fine. And then I ran mise link node@12.16.0 <node binary path returned by nvm which>. and mise ls command shows it correctly:

$ mise ls
Tool    Version               Config Source              Requested
java    corretto-11.0.25.9.1
node    12.16.0 (symlink)     ~/airlab/repos/deck/.nvmrc 12.16.0
node    18.17.1
node    18.20.4 (symlink)
python  2.7.18
python  3.9.20
python  3.10.15
ruby    3.1.6

But I tried to use it by mise use node@12.16.0 then it removes the symlink and tries to reinstall the node version. Also, mise doctor command shows it's still missing even if it's linked.

$ mise doctor
...
toolset:
  node@12.16.0  (missing)
...

Because I can't run mise use command, switching node version via nvm in another place affects the version of node in this repo.

To Reproduce

$ nvm install node@12.16.0
$ nvm which
$ mise link --force node@12.16.0  <node binary path returned by nvm which>
$ mise doctor
$ mise use node@12.16.0

Expected behavior mise doctor and mise use should observe what's set up by mise link.

mise doctor output

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

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
  ~/airlab/Gemfile
  ~/airlab/repos/deck/.nvmrc

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:

toolset:
  node@12.16.0  (missing)

env_vars:
  MISE_SHELL=zsh
  MISE_ACTIVATE_AGGRESSIVE=true

settings:
  activate_aggressive = true
  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 = false
  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 = true
  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]
  compile = false

  [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. new mise version 2024.10.8 available, currently on 2024.10.7

Additional context N/A

jdx commented 1 week ago

seems to be working fine for me:

❯ mise ls node
Tool  Version  Config Source Requested

❯ mise link node@18.0.0 ~/.nodes/18.0.0

❯ mise ls node
Tool  Version           Config Source Requested
node  18.0.0 (symlink)                         

❯ mise use node@18.0.0
mise /tmp/mise.toml tools: node@18.0.0

❯ mise ls node
Tool  Version           Config Source  Requested
node  18.0.0 (symlink)  /tmp/mise.toml 18.0.0                                       
gullpong commented 5 days ago

It never works for me....

after running mise link this is how the mise local shared dir looks like:

image

but if I run mise use node@12.16.0, it keeps downloading the node tar and trying to compile it and then eventually fails.

jinyong_lee@Jinyongs-MacBook-Pro:~/airlab/repos/deck jlee--exec-rerun-update$ mise use node@12.16.0
mise node@12.16.0 verifying node-v12.16.0.tar.gz                                                                     39.50 MiB/49.86 MiB (0s)

this is very very strange as I already have installed all required node versions via nvm.

jinyong_lee@Jinyongs-MacBook-Pro:~/airlab/repos/deck jlee--exec-rerun-update$ nvm ls
->     v12.16.0
       v18.20.4
default -> 18 (-> v18.20.4)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.20.4) (default)
stable -> 18.20 (-> v18.20.4) (default)
lts/* -> lts/iron (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.4
lts/iron -> v20.18.0 (-> N/A)

Clearly mise doesn't detect the linked node version:

$ mise ls -i
Tool    Version               Config Source Requested
java    corretto-11.0.25.9.1
node    18.17.1
node    18.20.4 (symlink)
python  2.7.18
python  3.9.20
python  3.10.15
ruby    3.1.6

$ mise ls -m
Tool  Version            Config Source              Requested
node  12.16.0 (symlink)  ~/airlab/repos/deck/.nvmrc 12.16.0

I wonder "where" does this node installation information come from for mise, if there's any state being maintained. I believe that state is somehow corrupted/broken.