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

RLS in VS Code robustness & performance #8

Closed
3 tasks
repi opened this issue Apr 1, 2019 · 8 comments
Closed
3 tasks

RLS in VS Code robustness & performance #8

repi opened this issue Apr 1, 2019 · 8 comments
Labels

Comments

@repi
Copy link
Contributor

repi commented Apr 1, 2019

We use a single large workspace and monorepo and RLS very often hangs / stops working.

Also performance with having RLS build our repo for its own target can be quite bad, esp. working on laptop. Looking forward to future more incremental background service.

Related issues:

@repi repi added the tools label Apr 1, 2019
@repi
Copy link
Contributor Author

repi commented Jun 1, 2019

Another thing that is extra problematic and annoying when RLS stops working in our large workspace is that then rustfmt on save in VS Code also stops working which most of us have started to rely on quite a bit.

And this is error prone because we require all of our code to be formatted and CI verifies this, so when it stops working dramatically increases the chances of submitting non-formatted code and failing the build.

@repi
Copy link
Contributor Author

repi commented Jul 4, 2019

For a longer term improvements we've started sponsoring the rust-analyzer project as Embark with 1000€/month (as a start) on OpenCollective.

This is a great blog post where they reached out to the community and asking for additional support: https://ferrous-systems.com/blog/rust-analyzer-status-opencollective/

Still hoping for shorter term RLS improvements as it generally doesn't work at all with our Rust monorepo anymore in VS Code.

@AlexEne
Copy link

AlexEne commented Jul 5, 2019

I was thinking for a short-term maybe we can do a spike and debug RLS (at least to fix some crashes).

I know your code is not public, but I wonder if we could potentially reproduce these stability issues with the rust compiler codebase or maybe servo ? or another big rust project ? (not sure if any other are at this scale).

Maybe even create a test hello world that depends on a ton of other crates?

I could raise an issue for us to try/track this in the rust-gamedev wg.

@repi
Copy link
Contributor Author

repi commented Jul 5, 2019

Yes that is a good idea, one probably can reproduce similar hangs / unresponsiveness with RLS in other big Rust workspaces.

@repi
Copy link
Contributor Author

repi commented Aug 16, 2019

Another problem we have with RLS is that we have large C++ dependencies built in their build.rs files and these will be built in RLS for no use and causing RLS to be inactive building for 5-10 minutes on a laptop. Our physx and ash-molten are examples of such crates.

Would want in build.rs to skip these heavy builds if building for RLS, or something similar.

Found a related issue here: rust-lang/cargo#6834

@nox
Copy link

nox commented Oct 20, 2019

As a workaround for RLS, you can do this:

    // Stop here if caller is RLS.
    let cargo = env::var_os("CARGO").unwrap();
    let output = Command::new(cargo).arg("--version").output().unwrap();
    if output.stdout.starts_with(b"rls ") {
        return;
    }

This doesn't help for cargo check though.

@rlabrecque
Copy link

My workspace isn't even large, 3 cargo crates in the workspace, ~200 LOC each, tonic, clap, r2d2-postgres, tracing based. Compiling on a laptop, RLS needs to be restarted at least hourly.

@repi
Copy link
Contributor Author

repi commented Jun 4, 2020

Closing this as rust-analyzer a few months ago got good enough for us to switch over to it at Embark! It does have some issues (that we should file and track) but will be our primary focus going forward

@repi repi closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants