Skip to content

internal: Share same proc-macro servers between workspaces - #22766

Merged
Veykril merged 1 commit into
rust-lang:masterfrom
Veykril:lukaswirth/push-rwmmzyuozvpl
Jul 11, 2026
Merged

internal: Share same proc-macro servers between workspaces#22766
Veykril merged 1 commit into
rust-lang:masterfrom
Veykril:lukaswirth/push-rwmmzyuozvpl

Conversation

@Veykril

@Veykril Veykril commented Jul 11, 2026

Copy link
Copy Markdown
Member

Also bumps the default proc-macro server count from 1 to 2, I have been test driving this with 4 processes for a long time with no issues.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 11, 2026
@Veykril
Veykril enabled auto-merge July 11, 2026 13:15
@Veykril
Veykril force-pushed the lukaswirth/push-rwmmzyuozvpl branch from c0bbe40 to 7780736 Compare July 11, 2026 13:21
@Veykril
Veykril force-pushed the lukaswirth/push-rwmmzyuozvpl branch from 7780736 to 0c0815c Compare July 11, 2026 13:29
@Veykril
Veykril added this pull request to the merge queue Jul 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 11, 2026
@Veykril
Veykril added this pull request to the merge queue Jul 11, 2026
Merged via the queue into rust-lang:master with commit 5be5e89 Jul 11, 2026
19 checks passed
@Veykril
Veykril deleted the lukaswirth/push-rwmmzyuozvpl branch July 11, 2026 14:19
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 11, 2026
Wilfred added a commit to Wilfred/rust-analyzer that referenced this pull request Aug 10, 2026
fetch_proc_macros() zips proc_macro_clients with a per-workspace
vec. We therefore require proc_macro_clients to have an item for every
workspace, or we get "proc-macro-srv is not running" and no macro
expansion for some workspaces.

This issue is more noticeable when using a discovery command, where it's
common to have have several workspaces, but it can occur in plain
cargo repositories too.

The logic was essentially `if !same_workspaces`, but this doesn't
actually work. When a new workspace is added, switch_workspaces()
updates self.workspaces, pushes to fetch_build_data_queue, and returns
early.

When we actually check the proc macro clients, on the second
invocation, we're seeing the *new* self.workspaces already and it
looks like nothing has changed!

This was broken in rust-lang#22766, and only partially
fixed in rust-lang#22865. Revert the code, and expand
the doc comments.

A better solution would be to track proc macro initialisation state
properly, but this fixes r-a on the >1 workspaces case today.

AI disclosure: Bisected with help by AI.
Wilfred added a commit to Wilfred/rust-analyzer that referenced this pull request Aug 10, 2026
fetch_proc_macros() zips proc_macro_clients with a per-workspace
vec. We therefore require proc_macro_clients to have an item for every
workspace, or we get "proc-macro-srv is not running" and no macro
expansion for some workspaces.

This issue is more noticeable when using a discovery command, where it's
common to have have several workspaces, but it can occur in plain
cargo repositories too.

The logic was essentially `if !same_workspaces`, but this doesn't
actually work. When a new workspace is added, switch_workspaces()
updates self.workspaces, pushes to fetch_build_data_queue, and returns
early.

When we actually check the proc macro clients, on the second
invocation, we're seeing the *new* self.workspaces already and it
looks like nothing has changed!

This was broken in rust-lang#22766, and only partially
fixed in rust-lang#22865. Revert the code, and expand
the doc comments.

A better solution would be to track proc macro initialisation state
properly, but this fixes r-a on the >1 workspaces case today.

AI disclosure: Bisected with help by AI.
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 17, 2026
fetch_proc_macros() zips proc_macro_clients with a per-workspace
vec. We therefore require proc_macro_clients to have an item for every
workspace, or we get "proc-macro-srv is not running" and no macro
expansion for some workspaces.

This issue is more noticeable when using a discovery command, where it's
common to have have several workspaces, but it can occur in plain
cargo repositories too.

The logic was essentially `if !same_workspaces`, but this doesn't
actually work. When a new workspace is added, switch_workspaces()
updates self.workspaces, pushes to fetch_build_data_queue, and returns
early.

When we actually check the proc macro clients, on the second
invocation, we're seeing the *new* self.workspaces already and it
looks like nothing has changed!

This was broken in rust-lang/rust-analyzer#22766, and only partially
fixed in rust-lang/rust-analyzer#22865. Revert the code, and expand
the doc comments.

A better solution would be to track proc macro initialisation state
properly, but this fixes r-a on the >1 workspaces case today.

AI disclosure: Bisected with help by AI.
PrimeTimeTran pushed a commit to PrimeTimeTran/rust-analyzer that referenced this pull request Aug 22, 2026
fetch_proc_macros() zips proc_macro_clients with a per-workspace
vec. We therefore require proc_macro_clients to have an item for every
workspace, or we get "proc-macro-srv is not running" and no macro
expansion for some workspaces.

This issue is more noticeable when using a discovery command, where it's
common to have have several workspaces, but it can occur in plain
cargo repositories too.

The logic was essentially `if !same_workspaces`, but this doesn't
actually work. When a new workspace is added, switch_workspaces()
updates self.workspaces, pushes to fetch_build_data_queue, and returns
early.

When we actually check the proc macro clients, on the second
invocation, we're seeing the *new* self.workspaces already and it
looks like nothing has changed!

This was broken in rust-lang#22766, and only partially
fixed in rust-lang#22865. Revert the code, and expand
the doc comments.

A better solution would be to track proc macro initialisation state
properly, but this fixes r-a on the >1 workspaces case today.

AI disclosure: Bisected with help by AI.
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.

2 participants