[HELP] rust-analyzer on VScodium completely fails to load workspace

Relevant version/installation info

Plasma Wayland at 6.3.5
Kernel version at 6.15.2-arch1-1 (64-bit)

Rust tools

rustup 1.28.2
rustc 1.87.0 (17067e9ac 2025-05-09)
All tools are added to PATH and working correctly in the terminal from root and from within the project body

VScodium

Version: 1.101.03933
Commit: 3a9d13eb624032e7f764def3dd45db451a4f0270
Date: 2025-06-12T21:31:35.492Z
Electron: 35.5.1
ElectronBuildId: undefined
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Linux x64 6.15.2-arch1-1

Problem description

Recently I have decided to do a migration over to Linux, which went well so far. However the rust-analyzer extensions fails miserably trying to fetch my workspaces. This happens to both my old ones (Which previously worked fine with my old VSCode + Windows setup), and a fresh "Example" project I made whilst trying to solve the issue myself. Below is a snippet of the extension output generated whenever I open a .rs file in the workplace

2025-06-16T11:00:10.77176176+02:00 ERROR failed fetching toolchain version for ManifestPath { file: AbsPathBuf("/home/Waterpig/Documents/git/example/Cargo.toml") } workspace e=Failed to query rust toolchain version via `cd "/home/Waterpig/Documents/git/example" && "cargo" "--version"`, is your toolchain setup correctly?
2025-06-16T11:00:10.772182703+02:00 ERROR failed fetching data layout for ManifestPath { file: AbsPathBuf("/home/Waterpig/Documents/git/example/Cargo.toml") } workspace e=unable to fetch target-data-layout via `cd "/home/Waterpig/Documents/git/example" && RUSTC_BOOTSTRAP="1" "rustc" "-Z" "unstable-options" "--print" "target-spec-json"`
2025-06-16T11:00:10.772316083+02:00 ERROR FetchWorkspaceError: rust-analyzer failed to load workspace: Failed to load the project at /home/Waterpig/Documents/git/example/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /home/Waterpig/Documents/git/example/Cargo.toml, None: Failed to run `cd "/home/Waterpig/Documents/git/example" && "cargo" "metadata" "--format-version" "1" "--manifest-path" "/home/Waterpig/Documents/git/example/Cargo.toml"`: No such file or directory (os error 2)

Running all these inside either the VSCodium bash terminal or completely out of scope from a terminal works completely fine. For brevity sake here's just one such example:

I'm unsure if I missed a crucial configuration step here? I've not seen this issue anywhere.

Things already tried

  • Reinstalling rustup, and adding it to path manually instead of it doing it automatically
  • Restarting everything like 10 times, once for each step
  • Reinstalling rust-analyzer
  • Changing the default terminal for VSCodium

what OS distribution are you using? is vscodium installed from your system package manager, or using other means, such as snapper, flatpak, appimage?

It's Arch Linux with Wayland, vscodium was installed through flatpak.

flatpak apps are running in a sandboxed container, so host file system and development tools are not accessible, you need some extra configurations to make it work, but it's might not be as smooth as a locally installed vscodium, just keep that in mind.

there are some instructions on the rust-analyzer website, but in summary, you need to:

  • grant com.vscodium.codium full access to your user's home directory;

  • override the PATH environment variable of the sandbox to include $HOME/.cargo/bin

you can do this with the flatpak override command, or from a GUI app, such as flatseal, or the flatpak kcm module since you are on kde.

unless you have a good reason to use flatpak, I suggest you to install development tools like vscodium using the system package manager. for Arch, vscodium is available on the AUR as vscodium-bin.


side note:

I happen to use vscodium from flatpak too, that's because I'm using an immutable OS installation, openSUSE MicroOS with KDE, codename Kalpa, if you are curious. but MicroOS comes with distrobox integrated out of the box, and all my development tools -- rust toolchain, gcc, llvm, etc -- are installed on distrobox guest OSes, so I mainly use the flatpak vscodium to connect to the guest system using the vscode remote protocol. (it may sound silly to use a "remote" protocol on a local machine, but it is the easiest way to work around the sandbox limitations. and it is also how vscode's wsl extension is implemented)

btw, distrobox is a fantastic tool, not just for immutable systems, but for all linux users. I highly recommend everyone to give it a try.

for example, I have an openSUSE tumbleweed guest system as default working environment, but I also have an ubuntu system and an alpine system installed, which is handy when I need to test something on different systems.

if you are using vscodium (including the flatpak version) and this extension: GitHub - xaberus/vscode-remote-oss: Remote development for OSS Builds of VSCode like VSCodium , but you only use it for distrobox integration, just like me, you may want to check out my vscodium extension as an alternative:

That did the trick, didn't know that about flatpak, well at least I do now. Thank you

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.