😎

mise でさまざまなプログラミング言語の処理系を導入する

に公開

mise は asdf と互換性のある開発言語のバージョン管理ツールである。Rust で書かれており asdf よりも速い。

インストールと設定は次のとおり

curl https://mise.run | sh
echo "eval \"\$(/home/masakielastic/.local/bin/mise activate bash)\"" >> ~/.bashrc

ターミナルを再起動してバージョンを確認する

mise --version
2024.5.21 linux-x64 (ef24c46 2024-05-23)

node、deno、bun をインストールする

mise use node
mise use deno
mise use bun

私は Python、Go、Rust、Zig を使っているので次のコマンドも実行した

mise use python
mise use go
mise use rust
mise use zig

go install でインストールしたコマンドラインツールが使えるように .bashrc に次の行を追加した

export PATH="$(go env GOPATH)/bin:$PATH"

【追記】
zig の master 版を利用するために次のプラグインを導入した

mise plugin remove asdf-zig
mise plugin add zig https://github.com/liyu1981/asdf-zig.git

https://ziglang.org/download/index.json で最新の master バージョンを調べて ~/.asdf/custom/zig/versions.json に追加した。

{
  "0.13.0-dev.261+710d745a5": {}
}

このパスは bin/list-all にハードコードされている

// https://github.com/liyu1981/asdf-zig/blob/asdf-zig-custom-version/bin/list-all
load_custom_json() {
  local custom_json_path=~/.asdf/custom/zig/versions.json
  cat $custom_json_path 1>/dev/null 2>/dev/null
  local has_custom_json=$?
  if [ $has_custom_json -eq 0 ]; then
    cat $custom_json_path
  else
    echo -n "{}"
  fi
}

mise list-all zig で master のバージョンが表示されることを確認したあと、次のコマンドでインストールした

mise install zig

mise のプラグインは $HOME/.local/share/mise/plugins にインストールされる

Discussion