-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Canceling initial check build does not work #13348
Comments
The initial cargo check is not a flycheck. It is a special invocation with a rustc wrapper that makes it only run build scripts and compile proc macros (you have this option to use the wrapper disabled. likely because it is incompatible with x.py) The result of this is necessary for usage by rust-analyzer itself to better analyse your code. It doesn't run again when you save, so aborting it would effectively break those features until you restart rust-analyzer or edit Cargo.toml or build.rs to retrigger it. |
Buildscripts and proc-macros are disabled though so the wrapper shouldn't run at all. We kick off one check invocation per workspace loaded, in your case the two linked projects. |
@bjorn3 yeah that's why I disabled proc-macros and build scripts -- they make the startup time on a 'cold' rustc checkout just too big. I can also see in htop that the invocation is for |
Is this maybe |
Ctrl-C on x.py in the terminal works as expected and kills cargo immediately. |
Yeah maybe it's a problem in the interaction with x.py. When I save a file while |
Ctrl-C sends SIGINT to the entire process group. Rust-analyzer doesn't set up a process group I believe and as such it only kills bootstrap. I don't believe bootstrap has code to kill it's inner cargo instance. See https://github.com/rust-lang/cargo/blob/c39193a7c5ecb65508257d0b1bdde579570ee5f2/src/cargo/util/job.rs for some explanation (on windows cargo has to manually set up the equivalent of a process group to get the right behavior) |
So we either need x.py to tear down inner processes, or RA to send a signal to the entire process tree? |
I think rust-analyzer should set up a process group for each subprocess it spawns. |
To reproduce:
touch library/core/src/lib.rs
)./x.py test src/test/ui
in a terminalExpected behavior:
Actual behavior:
Strangely, that build is out-of-sync with the flycheck status bar at the bottom of the vscode window: usually it shows there the last crate whose check was completed, but in cases like this that status bar either shows some very early crate from the library (despite the check build already being long past that, and working on rustc crates), or it doesn't show any completed crates at all. It seems almost as if RA would kick off two checkbuilds, a flycheck and something else, and even the flycheck is blocked waiting for that other build to complete. I have proc macro support disabled though so I cannot think of why it would do that.
rust-analyzer version: rust-analyzer version: 0.3.1221-standalone
rustc version: (rustc bootstrap)
relevant settings:
workspace settings
user settings
The text was updated successfully, but these errors were encountered: