-
Notifications
You must be signed in to change notification settings - Fork 13.8k
make rust-analyzer use a dedicated build directory #141839
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
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
I feel like this was discussed #general > ✔ Setup multiple editors for work on standard lib? @ 💬 but I don't remember why we used a top-level |
Oh I think it just happens to be an option that works. |
It has unintuitive interactions with If people choose to inflict those risks on themselves, fine, but I don’t think a nested RA build directory is a responsible default. |
Oh right. I think that's the caveat I was vaguely recalling... |
would it be good to get |
Or even just avoid deleting |
Bootstrap “owns” the build directory, so I think it's reasonable for
IIRC, one of the motivations people commonly cite for using |
Anyhow, I strongly agree that our default IDE configs really should be using a separate build dir (e.g. |
I recently found that |
Could you file a compiler MCP for this? I'd like to see some more eyes on this before we move in this direction. |
This won't actually work reliably due to a bug in rustic: emacs-rustic/rustic#105 |
That seems specific to emacs? r=me on the change itself once MCP is approved. |
Ah, right, this will still improve things for other editors (this PR was linked to me as "changing the default for emacs"), so there's no point blocking it on emacs being fixed. |
the MCP is now accepted and the pr updated to match |
made the move to build-rust-analyzer/ more comprehensive... it did not cover rustfmt and procmacro settings should be ready now @Mark-Simulacrum |
I'm not sure this is actually the right approach. Doing so makes it so that when rust-analyzer runs A better approach might be to have some shim binary (or bootstrap option) that oversees rust-analyzer processes and aborts any work in progress when it detects an actual user-run command is waiting to acquire the lock. |
@fee1-dead I'm not sure that fixes the other issue this fixes, which is cache corruption, which was happening to me really often, causing changes to source code to not update the behavior of the final binary. |
@bors r+ |
☔ The latest upstream changes (presumably #143888) made this pull request unmergeable. Please resolve the merge conflicts. |
needs another approval... |
I'm interested in this, so I manually applied the changes, but with the directory
|
This avoids rust-analyzer having to wait for a build lock due to ./x running other commands (and the other way around).
8d57763
to
24144ff
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@thaliaarchi have you tried with |
Please use @bors r=Mark-Simulacrum,fee1-dead |
Rollup of 6 pull requests Successful merges: - #141839 (make rust-analyzer use a dedicated build directory) - #146166 (Implement range support in `//@ edition`) - #147259 (cg_llvm: Use helper methods for all calls to `LLVMMDNodeInContext2`) - #147263 (Disable triagebot auto stable-regression compiler backport nominations pending redesign) - #147268 (add arm-maintainers to various targets) - #147270 (Move doc_cfg-specific code into `cfg.rs`) r? `@ghost` `@rustbot` modify labels: rollup
Bors hasn't noticed that this was merged. @bors r- |
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141839 (make rust-analyzer use a dedicated build directory) - rust-lang/rust#146166 (Implement range support in `//@ edition`) - rust-lang/rust#147259 (cg_llvm: Use helper methods for all calls to `LLVMMDNodeInContext2`) - rust-lang/rust#147263 (Disable triagebot auto stable-regression compiler backport nominations pending redesign) - rust-lang/rust#147268 (add arm-maintainers to various targets) - rust-lang/rust#147270 (Move doc_cfg-specific code into `cfg.rs`) r? `@ghost` `@rustbot` modify labels: rollup
inspired by #132794