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

Fix crate IDs when multiple workspaces are loaded #16961

Merged
merged 2 commits into from Apr 1, 2024

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Mar 27, 2024

Previously, we assumed that the crate numbers in a rust-project.json always matched the CrateId values in the crate graph. This isn't true when there are multiple workspaces, because the crate graphs are merged and the CrateId values in the merged graph are different.

This broke flycheck (see first commit), because we were unable to find the workspace when a file changed, so we ran every single flycheck, producing duplicate compilation errors.

Instead, use the crate root module path to look up the relevant flycheck. This makes ProjectWorkspace::Json consistent with ProjectWorkspace::Cargo.

Also, define a separate JSON crate number type, to prevent bugs like this happening again.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 27, 2024
@Wilfred Wilfred marked this pull request as ready for review March 27, 2024 19:55
@Veykril
Copy link
Member

Veykril commented Apr 1, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Apr 1, 2024

📌 Commit 0f72ab1 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 1, 2024

⌛ Testing commit 0f72ab1 with merge a6ddf5f...

@bors
Copy link
Collaborator

bors commented Apr 1, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing a6ddf5f to master...

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.

None yet

4 participants