Flatpak Permissions are improperly configured, not allowing cargo to be found by VSC
Before i start this report, there is a currently working workaround on an unrelated repo posted by user mmstick.
Link to his solution that had worked for me personally : https://github.com/rust-lang/rust-analyzer/issues/2873#issuecomment-575815147
Describe the bug
Couldn't get rust-analyzer extension to work, figured perhaps file permission issue so went into flatseal, gave it all file perms it needed, problem still occured, check attached sceenshots, they are in order.
Please confirm that this problem is VSCodium-specific Yes, as vscode does not provide a flatpak (at least upon viewing the vscode website), and this is flatpak related.
Please confirm that the issue/resolution isn't already documented
This issue has been documented on another repository unrelated to vscodium. Link below. https://github.com/rust-lang/rust-analyzer/issues/2873
To Reproduce Steps to reproduce the behavior:
- Open VSCodium, import a rust project
- Install the rust-analyser extension.
- Restart VSCodium to take effect
- See error
Expected behavior For cargo to be found by the application.
Screenshots
Desktop (please complete the following information):
- OS: Linux Mint victoria 21.2 x86_64
- App Manager : APT, flatpak, and pacstall.
- Sandboxed : Overall system not sandboxed, obviously some of my flatpaks and virtual machines are inherently sandboxed though.
The issue is due to the flatpak sandbox.
I don't any real solution since the PATH might need to be augmented for any languages. Who decide which language and which PATH of the langauge to include.
I think it's better to leave it to the user.
Maybe an help could be added after https://github.com/flathub/com.vscodium.codium?tab=readme-ov-file#sdks
I use rust-analyzer extension for my projects and work and until now is working Can you try these steps?
flatpak install flathub --user -y org.freedesktop.Sdk.Extension.rust-stable
flatpak override --env="FLATPAK_ENABLE_SDK_EXT=rust-stable" --user com.vscodium.codium
Then on my zshrc and bashrc
### User specific environment
if ! [[ "${PATH}" =~ ${HOME}/.local/bin: ]]
then
PATH="${HOME}/.local/bin:${PATH}"
fi
export PATH
### This comes from rustup
### Load Rust environment automatically
rust_env="${HOME}/.cargo/env"
# shellcheck source=/dev/null
[[ -f "${rust_env}" ]] && . "${rust_env}"
If these works for you, I will add these steps on the Flatpak FAQ or better where @daiyam thinks will be better to place =)
@noonsleeper I'm not the original poster but I'm running Debian 12 and the above did not work for me - I'm getting the same error. Thank you though !!
I found another thread that gave me flatpak --user override com.vscodium.codium --env=PATH=/app/bin:/usr/bin:/home/$USER/.cargo/bin which worked. I imagine this isn't the best for flatpak vscodium's path but hey.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue, please open a new issue.