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

Describe why and how to use a separate build directory for rust-analyzer #2106

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

Zalathar
Copy link
Contributor

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jieyouxu jieyouxu merged commit 124513e into rust-lang:master Oct 29, 2024
1 check passed
@Zalathar Zalathar deleted the build-rust-analyzer branch October 29, 2024 10:19
@lnicola
Copy link
Member

lnicola commented Oct 29, 2024

My comments on this from the r-a side:

  • if you prefer to run ./x.py check from the command line, another option is to disable checkOnSave
  • a check started by r-a will block one started from the terminal, but the latter will be fast enough since it will have nothing to do besides checking for freshness; running two checks at once is wasteful but with CPU and disk space

@Zalathar
Copy link
Contributor Author

Zalathar commented Oct 30, 2024

The issue is more that r-a running checks in the background will block all command-line bootstrap actions, including building the compiler or running tests, even if the check is relatively unimportant.

And once r-a has started its check, there's no way to stop it without stopping the server, which then implies several minutes of re-indexing when the server is restarted.

And aside from that, there are a few known cases where bootstrap will delete artifacts to avoid incompatibilities between different commands, which means that letting r-a touch the main build directory in the background is a really bad idea (even if everything is protected by locks).

@lnicola
Copy link
Member

lnicola commented Oct 30, 2024

The issue is more that r-a running checks in the background will block all command-line bootstrap actions, including building the compiler or running tests, even if the check is relatively unimportant.

Yes, but will the equivalent of cargo check & cargo test --no-run; wait be faster than cargo check; cargo test --no-run? I wouldn't be sure.

And once r-a has started its check, there's no way to stop it without stopping the server

In VS Code (and other clients which implement the extension) there is a "Cancel running flycheck" command that does exactly that. Clicking on the status bar item and Cancel might also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants