Skip to content

Fix issue when caching CompilationWithAnalyzers against ProjectState instead of a project#80422

Merged
CyrusNajmabadi merged 3 commits intodotnet:mainfrom
CyrusNajmabadi:compAnalyzerCrash
Sep 24, 2025
Merged

Fix issue when caching CompilationWithAnalyzers against ProjectState instead of a project#80422
CyrusNajmabadi merged 3 commits intodotnet:mainfrom
CyrusNajmabadi:compAnalyzerCrash

Conversation

@CyrusNajmabadi
Copy link
Contributor Author

@jasonmalinowski ptal. Will also do a test insertion.

@CyrusNajmabadi
Copy link
Contributor Author

Note: i do not expect this to cause perf issues. We already do checksum checking at a higher layer (LSP) to not bother computing diagnostics for things that aren't impacted by user changes. In other words the LSP caching layer knows to return quickly, unless something has actually changed int he input ot a project (in which case its checksum changes).

What this does though is ensure that N things asking questions about hte same solution on the OOP side (like diags, code actions, or fix all) operate on the same instance. And then that all just cleanly gets dumped as the solution moves forward.

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Oh wow that cache never made sense before. Definitely wrong with source generators now, but even then references to other compilations could still get out of sync...

@CyrusNajmabadi
Copy link
Contributor Author

Looks like all the speedometer stuff is ngen, which is being addressed by the revert of the sig help change. So merging this in.

@CyrusNajmabadi CyrusNajmabadi merged commit 84dc361 into dotnet:main Sep 24, 2025
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the compAnalyzerCrash branch September 24, 2025 09:06
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 24, 2025
@jasonmalinowski
Copy link
Member

/backport to release/dev18.0

@github-actions
Copy link
Contributor

Started backporting to release/dev18.0 (link to workflow run)

phil-allen-msft added a commit that referenced this pull request Oct 29, 2025
…inst ProjectState instead of a project (#80922)

Backport of #80422 to release/dev18.0

/cc @jasonmalinowski @CyrusNajmabadi

## Customer Impact

## Regression

- [ ] Yes
- [ ] No

[If yes, specify when the regression was introduced. Provide the PR or
commit if known.]

## Testing

[How was the fix verified? How was the issue missed previously? What
tests were added?]

## Risk

[High/Medium/Low. Justify the indication by mentioning how risks were
measured and addressed.]
@davidwengier davidwengier modified the milestones: Next, 18.3 Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants