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

Salsify the crate graph #19337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChayimFriedman2
Copy link
Contributor

I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.

This means that changing the metadata of a crate (e.g. adding a dependency) invalidates only it.

Draft for now because I still need to review the after-rebase changes.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2025
@ChayimFriedman2 ChayimFriedman2 force-pushed the salsify-crate-graph-final branch from 50f3794 to c4f6156 Compare March 10, 2025 21:55
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
@ChayimFriedman2 ChayimFriedman2 force-pushed the salsify-crate-graph-final branch from c4f6156 to 57d1198 Compare March 11, 2025 23:46
@ChayimFriedman2
Copy link
Contributor Author

ChayimFriedman2 commented Mar 11, 2025

Okay, this is now ready for review.

There are three big changes in this PR (I should've probably split them to commits, but now it is too late):

  1. Changing the crate graph to be incremental. The changes are mostly in base-db, and also spread in a lot of small changes all over the codebase where we access crate metadata.
  2. Splitting the "local" def map out of the def map, to allow for better incrementality for things like the extern prelude. This changes mostly in hir-def, in nameres.
  3. Loading proc macros and build scripts and only then setting the crate graph, to avoid invalidations. This change is in the rust-analyzer crate.

@ChayimFriedman2 ChayimFriedman2 marked this pull request as ready for review March 11, 2025 23:50
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.

2 participants