vscodium icon indicating copy to clipboard operation
vscodium copied to clipboard

Flatpak Permissions are improperly configured, not allowing cargo to be found by VSC

Open databoose opened this issue 1 year ago • 5 comments

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:

  1. Open VSCodium, import a rust project
  2. Install the rust-analyser extension.
  3. Restart VSCodium to take effect
  4. See error

Expected behavior For cargo to be found by the application.

Screenshots image

image

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.

databoose avatar Sep 10 '24 18:09 databoose

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

daiyam avatar Sep 22 '24 23:09 daiyam

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 avatar Sep 23 '24 01:09 noonsleeper

@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 !!

min-er-va avatar Oct 04 '24 02:10 min-er-va

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.

min-er-va avatar Oct 04 '24 02:10 min-er-va

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!

github-actions[bot] avatar Apr 03 '25 01:04 github-actions[bot]

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.

github-actions[bot] avatar May 04 '25 01:05 github-actions[bot]