Add compilation caching mode to VBCSCompiler server#82881
Conversation
Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/9aafb5ec-14d4-43bf-949b-48a8f6f4a409
…ve exception handling Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/9aafb5ec-14d4-43bf-949b-48a8f6f4a409
…lation twice Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/f91b92a0-0da1-4c9e-ad90-69cf4e004cc5
…heUtilities Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/f91b92a0-0da1-4c9e-ad90-69cf4e004cc5
…ML docs) Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/5b7ed4ce-497c-4362-b550-b9de0fecbb2d
333fred
left a comment
There was a problem hiding this comment.
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.
jaredpar
left a comment
There was a problem hiding this comment.
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.
src/Compilers/Core/MSBuildTaskTests/ManagedCompilerGlobalCacheTests.cs
Outdated
Show resolved
Hide resolved
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>
jaredpar
left a comment
There was a problem hiding this comment.
Had a few comments but overall looks good
src/Compilers/Core/Portable/InternalUtilities/CompilerOptionParseUtilities.cs
Show resolved
Hide resolved
src/Compilers/Core/Portable/InternalUtilities/CompilerOptionParseUtilities.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/InternalUtilities/CompilerOptionParseUtilities.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/CodeAnalysisTest/FileSystem/PathUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
| [Theory] | ||
| [InlineData(false)] | ||
| [InlineData(true)] | ||
| public async Task CacheHit_OmitsWarningDiagnosticsFromOutput(bool visualBasic) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This is also documented in the feature doc as a known limitation. I think it's ok to proceed for now.
Add an opt-in file-system compilation cache to the VBCSCompiler server. When
ROSLYN_CACHE_PATHis set (or theuse-global-cachefeature flag is passed via MSBuild), compilations with identical deterministic keys restore cached outputs instead of re-runningCompileAndEmit.No cache eviction is implemented yet. Side effects like compiler warnings and
/reportanalyzeroutput are not cached.