Skip to content

Fix failures to use VBCSCompiler.exe for Roslyn builds#46671

Merged
sharwell merged 2 commits intodotnet:masterfrom
sharwell:update-compiler
Aug 11, 2020
Merged

Fix failures to use VBCSCompiler.exe for Roslyn builds#46671
sharwell merged 2 commits intodotnet:masterfrom
sharwell:update-compiler

Conversation

@sharwell
Copy link
Contributor

@sharwell sharwell commented Aug 10, 2020

  • Update to Microsoft.Net.Compilers.Toolset 3.8.0-2.20408.4, which brings in Fix issue where compiler host dropped connections under load #46510.
  • Exclude problematic code fix assemblies from command line builds. These assemblies do not provide analyzers, so they are expected to silently be excluded from the build. However, in two cases the dependencies of the code fix assembly were triggering the analyzer inconsistency check in VBCSCompiler, which resulted in disabling the compiler server for impacted builds.

Rebuild time locally:

  • Before change: 5:40 minutes
  • After change: 2:03 minutes

@sharwell sharwell requested a review from a team as a code owner August 10, 2020 16:18
Copy link
Member

Choose a reason for hiding this comment

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

The underlying issue here is that when the server sees missing dependencies loading analyzers it considers that a fatal state and begins tearing down the compiler server. I'm no longer convinced that is the right thing to do.

The history there is that when originally authoring the server we were very concerned about assembly load address space pollution. Given every analyzer loads into the same AppDomain on desktop over time they can pollute the assembly load space such that a given compilation in the compiler server would fail due to inability to load an analyzer but it would succeed when run on the command line.

We were very concerned about this space when we originally wrote the server and when in doubt we leaned towards the paranoid interpretation of the error (when in doubt, shut down).

Thinking through this now i think missing dependencies should not be a fatal error. If it misses in the server, it's going to miss in the command line. Assembly load space pollution can really only cause incorrect dependencies to load (which we handle) but can't really see a way it would cause them to reasonably not load.

Possibly the implementation of ShadowCopyAnalyzerAssemblyLoader needs to change to better support analyzers. Overall though this work around doesn't really scale to customers. Feel like we need a sustainable solution for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overall though this work around doesn't really scale to customers. Feel like we need a sustainable solution for this.

I totally agree with this, but can we have the workaround in the meantime to avoid the build time regression?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with a work around but want to link it to the long term issue. Just a sec.

Copy link
Member

Choose a reason for hiding this comment

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

Please drop a link to #46684 in the change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@sharwell sharwell merged commit bbfee62 into dotnet:master Aug 11, 2020
@ghost ghost added this to the Next milestone Aug 11, 2020
@sharwell sharwell deleted the update-compiler branch August 11, 2020 00:34
@RikkiGibson RikkiGibson modified the milestones: Next, 16.8.P2 Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants