Closed3

Arch Linux で fish を使っていると rustup で追加した component のパスが通らない

椎名椎名

Arch Linux でログインシェルが fish の環境で neovim を使おうとしたら rust-analyzer のパスが通ってなくて、rustup component list | grep rust-analyzer とか、rustup which rust-analyzer を試すとちゃんとインストールはされてるみたいで困った。普通なら rustup でコンポーネントを追加した場合には ~/.cargo/bin に symlink が追加されるらしい。

椎名椎名

Arch だとなぜか /usr/lib/rustup/bin に symlink を作るから自分で PATH に登録しなきゃいけないというコメントに、ログイン時に /etc/profile.d/rustup.sh を読んでくれるから困らないみたいな返信がついていた。

I am not sure why, but extra/rustup does not add a /usr/bin/rust-analyzer symlink, but instead it has a /usr/lib/rustup/bin/rust-analyzer symlink.

So, differently from /usr/bin/{rust,cargo,rustfmt} etc (which just work), in order for the rust-analyzer component to be in PATH users have to add /usr/lib/rustup/bin to their PATH.
https://wiki.archlinux.org/title/Talk%3ARust#:~:text=Reply-,rustup package from pacman requires modifications to %24PATH for rust-analyzer symlink to work,-Latest comment%3A

PATH is automatically modified by /etc/profile.d/rustup.sh after re-logging
https://wiki.archlinux.org/title/Talk%3ARust#:~:text=Reply-,PATH,after re-logging,--- andreymal (

fish とかじゃなければうまく動くみたい。

このスクラップは4ヶ月前にクローズされました