Open valeriansaliou opened 2 years ago
Rust Analyzer uses Cargo for issue checks on save (cargo check
or cargo clippy
depending on the preference you set as shown above), which is why your target
directory is being shared.
Your best bet to prevent sharing is probably to add --target-dir ./target-check
to the Additional Arguments preference in the Issues section (see your screenshot above). You can of course use whatever directory name suits you, but you'd need to add it to your .gitignore
. I'll note that you can set this preference per-project if it doesn't make sense as a global preference. (Project -> Project Settings... -> Rust extension)
Thank you, this worked perfect to fix the issue!
In terms of developer UX, I'd advise adding this to the README, or maybe even auto-configuring the default --target-dir
to be some temporary folder owned by Nova (possibly w/ a permanent cache), outside of the Rust project. Even if I know the standard Rust tools share the target/
folder between commands, something definitely collides here.
Describe the bug
Whenever I save a Rust file from Nova,
nova-rust
performs a background check of the syntax and errors, which works perfectly fine. However, whenever this runs, I lose mytarget/
cache from the previous build in my terminal (manual build using eg.cargo build
), which makes the next build slow.Also, when the background syntax check operation runs, and is still running while I attempt to call:
cargo build
in my terminal, I also see:Blocking waiting for file lock on build directory
This shows that something is sharing the same
target/
directory in my local project, and I'm not sure this used to happen in the previousnova-rust
versions.My options are as follow in the screenshot:
To Reproduce
cargo build
cargo build
(thetarget/
cache is used)cargo build
(slow!), the cache was purged by the extensionExpected behavior
My
target/
build cache would stay populated, and I wouldnt have to compete w/ another build lockfile.Versions (please complete the following information):
rustc 1.60.0 (7737e0b5c 2022-04-04)