-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Checking doesn't work for workspace projects. #61
Comments
Do you have some code with which to reproduce? A minimal example would be great. Here I have no issues checking code inside a subcrate of this project for instance. |
Sure thing. Check out this minimal project. I'm seeing the same behaviour: flycheck works for |
I'm sorry to report that it works on my side :/ Opening If I open However, if there is an error in Other than that, what's your |
It seems that it's the rust version that breaks things. I am on Rust nightly (with Is it a known thing that nightly doesn't work with Flycheck, or is it a regression in the version I have installed ( It's a bit annoying, because I switched to nightly to be able to use rustfmt from Emacs... |
Workspaces breaking on nightly is news to me. On the other hand, our testing infrastructure is a bit lacking, so I can't say for how long this has been broken. Luckily, we've got users who report bugs soon enough ;) I've looked into this, and this stems from the fix to #1378 that was incomplete. For workspace projects, In any case, I'd rather have rust-lang/cargo#4788 is the culprit, rust-lang/cargo#4933 added I'll hop onto rust-lang/cargo#4998 to see if we can't get absolute paths in the JSON format. |
@fmdkdd Thanks for looking into this and for the in-depth explanation! Indeed, it sounds that getting absolute paths would be easiest on you guys and also make any tools based on these values less brittle. |
I tested Does cargo return relative paths also in the case of non-workspace projects? |
Yes it does, that was the cause of flycheck/flycheck#1378 |
Should be fixed by flycheck/flycheck#1422. |
Thanks! |
Hi there!
I have a Rust project organized as a workspace - in the root of the project, there are two other sub-crates which are part of the workspace.
When editing the main file of the root project (
<PROJECT_ROOT>/src/main.rs
) or even the library part of the root project ('<PROJECT_ROOT>/src/lib.rs`) there are no issues with flycheck.When editing the contents of any of the sub-crates (i.e.
<PROJECT_ROOT>/<SUBCRATE>/src/lib.rs
) there is no checking happening.I suspect that flycheck isn't aware of workspace projects. When checking my code from the command line, I usually have to specify the
--all
parameter to thecheck
command to instruct it to recurse into sub-crates. For example:$ cargo check --all --tests
I don't know how this is done with
cargo rustc
.Here are some diagnostics/output from my computer:
This is how I configure Flycheck in my Emacs'
init.el
:It would be really useful to have flycheck support in workspace projects.
Thanks for the great work on Flycheck, this is the first issue I've encountered for Rust, it works great otherwise!
The text was updated successfully, but these errors were encountered: