mise: Missing tools silently fall back to system version

Describe the bug / To reproduce I’m not sure how this is supposed to work… but if I create (or check out from git, etc) a .mise.toml that says something like this

[tools]
node = "15"

…and I didn’t have node v15 installed in mise’s cache already, then mise just… does nothing; whatever version of node is present on the system gets run:

% node -v
v18.13.0

mise doctor doesn’t see anything wrong:

% mise doctor
[... stuff elided, see below for full output ...]

toolset:
  node@15

No problems found

Now mise ls does show that the tool is missing

% mise ls
Plugin  Version            Config Source                         Requested
node    14.21.3                                                           
node    15.14.0 (missing)  ~/source/jolly-roger/.mise.local.toml 15       
node    20.10.0

And of course mise install goes and gets the missing version and all is well, BUT, when introducing people to mise, this can all be somewhat confusing, as if they happen to have some version of a tool installed globally things will sort-of kind-of work but with the wrong version, and it can be a while before I think to say “…wait, you did run mise install right??”.

Expected behavior EITHER auto install missing tools on entry into a directory (or when config files are changed), but I do see https://github.com/jdx/mise/issues/814 and https://github.com/jdx/mise/issues/735 which point out issues with that

OR swap the system version of the tool with one that fails with an error saying that it’s not installed (and recommending to run mise install), or perhaps asks for permission to go ahead and install; I think this already happens if the tool in question is NOT already installed at the system level

OR at least issue a warning on entry (or when a tool is run) that a tool version is missing, and recommends running install

In any case it seems like mise doctor should have some note when current tool versions are missing?

mise doctor output

mise version:
  2024.1.7 linux-x64 (292e4ac 2024-01-05)

build:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Fri, 5 Jan 2024 19:07:03 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-ubuntu-linux-gnu)

mise data directory:
  /home/egnor/.local/share/mise

mise environment variables:
  MISE_SHELL=zsh

settings:
  {
    "experimental": false,
    "color": true,
    "always_keep_download": false,
    "always_keep_install": false,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "plugin_autoupdate_last_check_duration": "7d",
    "trusted_config_paths": [],
    "log_level": "info",
    "trace": false,
    "debug": false,
    "verbose": false,
    "quiet": false,
    "asdf_compat": false,
    "jobs": 4,
    "shorthands_file": null,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "raw": false,
    "yes": false,
    "task_output": null,
    "not_found_auto_install": true,
    "ci": false,
    "env_file": null,
    "cd": null
  }

config files:
  /home/egnor/source/jolly-roger/.mise.local.toml

plugins:
  bun      (core)
  deno     (core)
  go       (core)
  java     (core)
  node     (core)
  python   (core)
  ruby     (core)

toolset:
  node@15

No problems found

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Reactions: 1
  • Comments: 19 (9 by maintainers)

Most upvoted comments

yeah I see the same behavior. I think rather than fixing that I kind of want to make a new config that’s clearer. I think these 2 lines warrant a dedicated setting.

I’m thinking maybe we make it something where you can pick what you want to see with csv, like this:

MISE_ACTIVATE_STATUS=none # the default
MISE_ACTIVATE_STATUS=tools # see all tools, missing or not
MISE_ACTIVATE_STATUS=missing_tools # just see the missing tools
MISE_ACTIVATE_STATUS=env # see env var changes
MISE_ACTIVATE_STATUS=all # equivalent to tools,missing_tools,env

I think all the work you are doing on this, as well as your desire to make mise as friendly as possible, is commendable.

For whatever its worth, I found it surprising that typing python installed the version requested and would have preferred a warning that told me something to the effect of “run mise install or mise setting ignore-missing-tools=true to silence this warning.”