Skip to content

Add compilation caching mode to VBCSCompiler server#82881

Merged
333fred merged 32 commits intomainfrom
copilot/add-caching-mode-to-compiler-server
Apr 3, 2026
Merged

Add compilation caching mode to VBCSCompiler server#82881
333fred merged 32 commits intomainfrom
copilot/add-caching-mode-to-compiler-server

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Add an opt-in file-system compilation cache to the VBCSCompiler server. When ROSLYN_CACHE_PATH is set (or the use-global-cache feature flag is passed via MSBuild), compilations with identical deterministic keys restore cached outputs instead of re-running CompileAndEmit.

No cache eviction is implemented yet. Side effects like compiler warnings and /reportanalyzer output are not cached.

Copilot AI and others added 2 commits March 20, 2026 22:20
Copilot AI and others added 2 commits March 20, 2026 23:19
Copy link
Copy Markdown
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Got a couple of files in, haven't done a full review yet, but need to step away for now so publishing what I've said so far.

@333fred 333fred marked this pull request as ready for review March 30, 2026 16:31
@333fred 333fred requested a review from a team as a code owner March 30, 2026 16:31
Copy link
Copy Markdown
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

Feel like the passing of environment variables between the processes is adding a bit of complexity we don't need. Wanted to make sure we get to an agreement on that vs. just munging the flag we pass through.

Copilot stopped work on behalf of jaredpar due to an error March 30, 2026 18:13
Copilot AI requested a review from jaredpar March 30, 2026 18:13
Copy link
Copy Markdown
Member

@RikkiGibson RikkiGibson left a comment

Choose a reason for hiding this comment

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

Done review pass

Move ROSLYN_CACHE_PATH handling to request normalization so cache enablement flows through /features:use-global-cache instead of extra server environment propagation. Update compiler server cache creation to read parsed feature flags, refresh the design doc, and add coverage for existing /features switches in both C# and VB.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

Had a few comments but overall looks good

@RikkiGibson RikkiGibson self-requested a review April 2, 2026 17:14
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task CacheHit_OmitsWarningDiagnosticsFromOutput(bool visualBasic)
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.

At first I thought: no big deal, msbuild already does this for incremental builds, and then thought..

Yeah, if I pass /t:Rebuild, and I do not see any warnings locally, but warnings appear in CI, I am going to feel quite confused/inconvenienced.

This isn't blocking, but, it might be worth looking at serializing the diagnostics for a compilation and including that in a cache also.

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.

This is also documented in the feature doc as a known limitation. I think it's ok to proceed for now.

@333fred 333fred enabled auto-merge (squash) April 3, 2026 20:48
@333fred 333fred merged commit ae96a65 into main Apr 3, 2026
23 of 24 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 3, 2026
@333fred 333fred deleted the copilot/add-caching-mode-to-compiler-server branch April 3, 2026 22:32
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.

5 participants