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

if the server is started as a systemd service then it can't find rust-analyzer #69

Open
IndianBoy42 opened this issue Jul 23, 2024 · 5 comments
Labels
question Further information is needed

Comments

@IndianBoy42
Copy link

Jul 23 20:12:23 pop-os ra-multiplex[3051108]: Caused by:
Jul 23 20:12:23 pop-os ra-multiplex[3051108]:     0: spawning langauge server: server="rust-analyzer", args=[], cwd="/home/amedhi/dev/tail-sim"
Jul 23 20:12:23 pop-os ra-multiplex[3051108]:     1: No such file or directory (os error 2)

You would get an error message like the above in systemctl status ra-multiplex

This is solved by pass_environment = ["PATH"] in the ra-multiplex config

@pr2502
Copy link
Owner

pr2502 commented Jul 25, 2024

"Sometimes?" Does this really not happen every time? I'd expect this to be a difference between your systemd-user PATH and the path of your editor, probably your rust-analyzer is installed in ~/.rustup/... or ~/.cargo/bin and you only add that to your PATH in the shell initialization script, which doesn't get included in systemd-user environment.

@pr2502 pr2502 added the question Further information is needed label Jul 25, 2024
@IndianBoy42 IndianBoy42 changed the title (Sometimes?) if the server is started as a systemd service then it can't find rust-analyzer if the server is started as a systemd service then it can't find rust-analyzer Jul 27, 2024
@IndianBoy42
Copy link
Author

It worked fine for months and then last week I started having the problem of it not finding rust-analyzer.

@pr2502
Copy link
Owner

pr2502 commented Jul 29, 2024

Hmm, and the only thing that change was a new version of ra-multiplex? The way we use tokio::process::Command::envs should not change the environment if pass_environment is empty (the default).

@pr2502
Copy link
Owner

pr2502 commented Jul 29, 2024

I've added more context to the error message from the description here 247736b, that should help you figure out what's wrong with the PATH in the systemd service.

@sasa-tomic
Copy link

I had the same problem and the pass_environment value of pass_environment = ["PATH", "LD_LIBRARY_PATH"] (similar to the one described in from #83) seems to have solved it.

The whole setup process I used is described here: https://gist.github.com/sasa-tomic/a53302b9935c2c13717f60cd86369579

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

No branches or pull requests

3 participants