mise icon indicating copy to clipboard operation
mise copied to clipboard

Mise doctor falsely complains shims are missing

Open Pilgrim1379 opened this issue 1 year ago • 5 comments

Below are the result of me running mise doctor. At the bottom you'll see mise complain that shims are missing. However I do have ~/.local/share/mise/shims on PATH and everything seems to be working as expected.

❯ mise doctor
mise version:
  2024.1.26 macos-x64 (2024-01-25)

build:
  Target: x86_64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Thu, 25 Jan 2024 18:37:37 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  /usr/local/bin/zsh
  zsh 5.9 (x86_64-apple-darwin21.3.0)

mise data directory:
  /Users/NQA/.local/share/mise

mise environment variables:
  MISE_USE_TOML=1
  MISE_DATA_DIR=/Users/NQA/.local/share/mise
  MISE_EXPERIMENTAL=1
  MISE_PYTHON_COMPILE=1
  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,
    "jobs": 4,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "node_compile": false,
    "not_found_auto_install": true,
    "paranoid": false,
    "plugin_autoupdate_last_check_duration": "1 week",
    "python_compile": true,
    "python_default_packages_file": "/Users/NQA/.default-python-packages",
    "python_patch_url": null,
    "python_precompiled_os": null,
    "python_patches_directory": null,
    "python_precompiled_arch": null,
    "python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
    "python_venv_auto_create": false,
    "raw": false,
    "shorthands_file": "~/.config/mise/shorthands.toml",
    "task_output": "prefix",
    "trusted_config_paths": [
      "~/workspace"
    ],
    "quiet": false,
    "verbose": false,
    "yes": false,
    "ci": false,
    "cd": null,
    "debug": false,
    "env_file": ".env",
    "trace": false,
    "log_level": "info"
  }

config files:
  ~/.tool-versions
  ~/.config/mise/config.toml
  ~/.mise.toml

plugins:
  bun      (core)
  deno     (core)
  elixir   https://github.com/asdf-vm/asdf-elixir.git#a4c42e1
  elm      https://github.com/asdf-community/asdf-elm.git#34d2627
  erlang   (core)
  go       (core)
  java     (core)
  neovim   https://github.com/richin13/asdf-neovim.git#0b7b611
  nim      https://github.com/asdf-community/asdf-nim.git#397c14a
  node     (core)
  python   (core)
  ruby     (core)
  zig      https://github.com/cheetah/asdf-zig.git#d88f6db
  zigmod   https://github.com/kachick/asdf-zigmod.git#f792744

toolset:
  python@latest, go@latest, erlang@latest, elixir@latest, java@temurin-21, ruby@latest, elm@latest, zig@latest, zigmod@latest, nim@latest, node@lts, bun@latest, neovim@nightly

1 problem found:
shims are missing, run mise reshim to create them```

Pilgrim1379 avatar Jan 25 '24 22:01 Pilgrim1379

@Pilgrim1379 have you tried running mise reshim and then re-running mise doctor to see if the problem is no longer reported?

This is a new check that looks for missing symlinks for your given toolset in the shim directory. So everything may work, but it is possible that a shim is not being used when it should be.

Ajpantuso avatar Jan 26 '24 00:01 Ajpantuso

Yes I did run 'mise reshim'. Sorry should have mentioned that. The issue still persists however.

Pilgrim1379 avatar Jan 26 '24 00:01 Pilgrim1379

created https://github.com/jdx/mise/pull/1529 which will display what they are to help debugging

jdx avatar Jan 26 '24 00:01 jdx

created #1529 which will display what they are to help debugging

Thanks @jdx With the update you pushed, I now see that the missing shims are mix and nimble.

1 problem found:
shims are missing, run mise reshim to create them
Missing shims: mix, nimble

Going through the all the shims in ~/.local/share/mise/shims I find that all the applications in the shims folder are links to the actual applications which are located in /usr/local/bin/mise except those two which are acutal copied over programs not links.

Therefore I deleted all the shims and run mise reshim but those two are still acutal programs and not links.

Pilgrim1379 avatar Jan 26 '24 09:01 Pilgrim1379

Thanks for reporting back!

Yeah we will need to add special handling for executable scripts here: https://github.com/jdx/mise/blob/7b3ae2e7a6f42f23d79586cd7a2e6ddc1f9efa89/src/shims.rs#L159-L163

After installing elixir on my machine:

$ cat /.../.local/share/mise/shims/mix

#!/bin/sh
export ASDF_DATA_DIR=/.../.local/share/mise
export PATH="/.../.local/share/mise/.fake-asdf:$PATH"
mise x -- /.../.local/share/mise/plugins/elixir/shims/mix "$@"

Ajpantuso avatar Jan 26 '24 12:01 Ajpantuso