Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
databoose opened this issue Sep 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@databoose
Copy link

databoose commented Sep 10, 2024

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 : rust-lang/rust-analyzer#2873 (comment)

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.
rust-lang/rust-analyzer#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.
@daiyam
Copy link
Member

daiyam commented Sep 22, 2024

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

@noonsleeper
Copy link
Contributor

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 =)

@min-er-va
Copy link

@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
Copy link

min-er-va commented Oct 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants