Skip to content

add support for build-dir configuration - #22944

Open
icewind1991 wants to merge 2 commits into
rust-lang:masterfrom
icewind1991:add-build-dir-support
Open

add support for build-dir configuration#22944
icewind1991 wants to merge 2 commits into
rust-lang:masterfrom
icewind1991:add-build-dir-support

Conversation

@icewind1991

Copy link
Copy Markdown

Fixes #20150

Allows for configuring a rust-analyzer specific build-dir just as it already allows for target-dir.

Changes mostly consist of duplicating the existing target-dir logic, only the logic around setting the option for the spawned commands is different, since there is no --build-dir cargo argument.

Has been tested by setting cargo.buildDir = true and verifying that the expected subdirectory in the globally configured build-dir is created, and that I can run cargo check in parallel to the RA check without running into a lock.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2026
@icewind1991
icewind1991 force-pushed the add-build-dir-support branch from fcbc7a9 to f4d6148 Compare July 28, 2026 21:06
@rustbot

This comment has been minimized.

cmd.arg("--target-dir").arg(target_dir.as_ref());
}
if let Some(build_dir) = self.build_dir_config.target_dir(ws_build_dir) {
cmd.env("CARGO_BUILD_BUILD_DIR", build_dir.as_ref());

@Veykril Veykril Aug 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I take it there is no flag equivalent for this? Bit weird to see target dir and build dir being configured differently

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, there is no flag to set the build dir at the moment

@icewind1991
icewind1991 force-pushed the add-build-dir-support branch from f4d6148 to 6253068 Compare August 8, 2026 11:48
@rustbot

rustbot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cargo build-dir support

3 participants