[go: nahoru, domu]

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

Sublime Text 3 instructions aren't sufficient on Linux #1811

Closed
kvark opened this issue Sep 11, 2019 · 5 comments
Closed

Sublime Text 3 instructions aren't sufficient on Linux #1811

kvark opened this issue Sep 11, 2019 · 5 comments

Comments

@kvark
Copy link
kvark commented Sep 11, 2019

Strictly following https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#sublime-text-3 on Linux, I'm not getting it to work: it simply fails to run ra_lsp_server (or rustup, or anything) because it's not in $PATH for sublime.

What I tried:

  • having ~/.profile setting the $PATH
  • forcing environment for Rust build system as described on SO
  • modifying the .desktop file used to launch ST3 to have the environment

In the end, wasn't able to get it to work yet. It only works when launched from the console.
Sorry if this is off-topic (arguably more of a ST3 issue than rust-analyzer). I think instructions should make the path clear.

@matklad
Copy link
Member
matklad commented Sep 11, 2019

Yeah, difference in $PATH between shell and DE on linux is a reoccurring problem... The worst thing is that, at least as far as I know, there's now single standard place to define PATH which works for both!

I don't think we can provide any better diagnostics for this problem on our side, but the docs need clarification

@matklad
Copy link
Member
matklad commented Sep 11, 2019

having ~/.profile setting the $PATH

I think ~/.profile is what is executed by non-graphical shell and ~/.xprofile is executed by graphical login manager. I think I had some success in the past by adding source ./.profile line to my ~/.xprofile

@bors bors bot closed this as completed in 54e92e6 Sep 11, 2019
@lnicola
Copy link
Member
lnicola commented Sep 11, 2019

You can also try putting PATH DEFAULT=${PATH}:@{HOME}/.cargo/bin in ~/.pam_environment.

@kvark
Copy link
Author
kvark commented Sep 11, 2019

Thank you for the suggestions!

  • ~/.xprofile didn't work for me
  • haven't tried the PAM stuff because it appears that it's not shipped with Solus

What did work in the end though is creating /etc/profile.d/cargo.sh with this line:

export PATH=$HOME/.cargo/bin:$PATH

@lnicola
Copy link
Member
lnicola commented Sep 11, 2019

Nb. for anyone from the future there's one issue with the .pam_environment approach. On some distros (Arch?), it prevents /usr/local/bin:/usr/bin from being added to PATH, so non-interactive ssh and scp stop working.

This seems to work, with some caveats about what you expect to find in PATH:

PATH DEFAULT=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:@{HOME}/.cargo/bin:@{HOME}/.local/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants