-
Notifications
You must be signed in to change notification settings - Fork 256
RLS only compiles the first member of a Cargo workspace #876
Comments
I'm seeing great success with the |
The bogofile errors are not important - we deal with them internally. They are fixed on master where we've updated to the latest Racer (the rustc_ap_syntax version). I'm not sure about the panics, could you run with RUST_BACKTRACE=1 so we can get more detail please? The workspace issues are worrying and interesting. We should be checking all workspaces which are changed. Could you tell me a bit more about the project structure please? Does it look like a or b or something else:
Are there things like multiple binaries, redirected directories, build scripts, etc? When you build the project outside of the RLS, what commandline do you use (just Which directory are you opening in VSCode? The top-level (project) directory, one of the workspace directories, or one of the src directories? |
Yes I will get a backtrace for you. And I realize I gave very little information, apologies...I was about to do so. But I have never had success with RLS even with a simple project, but that was several months ago and I know a lot of fixes have happened since then. The structure is more like
and the root
There are multiple binaries as you can see. No redirected directories, but all of the When I build the project, I build typically from the root directory and specify I open the root directory in VSCode, e.g. Hope this helps. |
Should I be putting a |
Not that this should change the behavior I am seeing, but I am about to reorganize the |
You shouldn't have to do anything different for the RLS vs the CLI, as long as you are running the RLS in the same directory you build in (which it sounds like you are). This might be why the RLS is getting stuck though. Thanks for the additional info! |
And one more question: when you are seeing the RLS build the "first" workspace but not building the modified workspaces, which are they in your diagram? |
It builds the |
Is the repo you're building public? If so, could I get a URL please? |
I've also been seeing this issue with workspace projects. For example a project with a lib workspace dependency, and a main binary.
You can only see the new main diagnostics after a change to main or restarting rls. I created https://github.com/alexheretic/rusttmp/tree/rls-876 to provide a simple way to reproduce this. STR
|
Looked at this today using the STR above: This is caused by @nrc this was introduced in 8c77584 to detect edited innermost crate and minimize rebuilding. |
It sounds like it should
I'm not sure what you're saying or asking here? Do you think the above plan won't work? Or that it will work better than the previous attempt? |
Thanks for continuing work on this all. Just confirming here that I am still seeing the same behavior as of tonight. |
Working on it atm. |
Add CompileMode to Executor callbacks This came up when trying to fix rust-lang/rls#876. So currently in the RLS we recreate our own dep graph, where we store units with a key `(PackageId, TargetKind)`. This turned out to be not enough since a) we can have multiple bin target kinds with different names (unrelated to this PR) b) same package target kind (bin, lib) can be compiled regularly or including the test harness. With this, we can distinguish these cases and properly rerun both regular compilation check and the one including unit tests. Without this information we'd need to fall back on guessing whether the rustc invocation has `--test` but having this information makes it accurate and seems useful enough to add it to the callback arguments. r? @alexcrichton or @matklad
While the fix is merged and it seems to be working now (added a regression test), I'd be really glad if folks could try and test it (by using built-from-source RLS) to see if some cases might have slipped through. |
I open my Cargo workspace into VSCode (just as a directory, not as an official project or workspace or anything) and RLS will compile and check all members of the Cargo workspace as its first action. However after that, with code changes et al, only the first member of the workspace is inspected. That is, I only see in the bottom left status the first member get recompiled, but not any of the other members including the ones into which I am writing intentional syntax errors to test :) If I do syntax errors in the first member, RLS picks them up and reports them accordingly.
I am also seeing this output regularly:
I get those
request-worker-N panicked
messages a lot, every time I type and RLS tries to do type completion it seems.Also these every time I type:
The RLS that is running is from the nightly toolchain, installed today. Any ideas why I would be seeing these issues? The workspace itself is not that large or special. I am surprised these problems aren't being seen by others as they seem fundamental and are happening on a fresh install.
The text was updated successfully, but these errors were encountered: