Add functionality to enable skipping analyzers for implicitly trigger…#54143
Merged
mavasani merged 3 commits intodotnet:mainfrom Jun 18, 2021
Merged
Add functionality to enable skipping analyzers for implicitly trigger…#54143mavasani merged 3 commits intodotnet:mainfrom
mavasani merged 3 commits intodotnet:mainfrom
Conversation
…ed builds inside Visual Studio Work towards [AB#1337109](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1337109) For builds which are indirectly triggered inside Visual Studio from commands such as 'Run Tests' or 'Start Debugging', we implicitly skip analyzers to speed up these builds. Such builds will set a special property `IsIndirectlyTriggeredBuildInsideVisualStudio` to `true`, which guards the implicit skip analyzers logic. We display a special message to inform the users about us implicitly skipping analyzers to speed up the build. To enable MSBuild's incremental build logic and project system's fast-upto-date check logic to work correctly, we create/touch a special semaphore file to indicate the time stamp for last build with skipAnalyzers flag. This semaphore file is passed as a custom additional file input to builds without skipAnalyzers flag to ensure correct incremental builds. Additionally, we pass this file as an 'UpToDateCheckInput' item for project system's fast-upto-date check.
Contributor
How about: IsImplicitlyTriggeredBuild? I'm not sure why we'd need to say it was visual studio, and I imagine this being useful for other hosts. |
jaredpar
reviewed
Jun 16, 2021
Contributor
Author
That sounds reasonable, I'll update the naming. |
jaredpar
approved these changes
Jun 17, 2021
Member
|
@chsienki, @RikkiGibson for second review |
mavasani
added a commit
to mavasani/roslyn
that referenced
this pull request
Jun 21, 2021
Restrict the functionality added in dotnet#54143 to only kick in for SDK style projects. This feature needs work in the project system for upto-date check to work correctly, and we are currently only commited to doing this work for CPS/SDK style projects.
mavasani
added a commit
to mavasani/roslyn
that referenced
this pull request
Jul 19, 2021
… analyzers Follow-up to dotnet#54143 Work towards [AB#1337109](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1337109)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ed builds inside Visual Studio
Work towards AB#1337109
Overview
For builds which are implicitly triggered inside Visual Studio from commands such as 'Run Tests' or 'Start Debugging', we implicitly skip analyzers to speed up these builds.
Such builds will set a special property
IsImplicitlyTriggeredBuildtotrue, which guards the implicit skip analyzers logic. We display a special message to inform the users about us implicitly skipping analyzers to speed up the build. Note this message was provided to us by the UX team.To enable MSBuild's incremental build logic and project system's fast-upto-date check logic to work correctly, we create/touch a special semaphore file to indicate the time stamp for last build with skipAnalyzers flag. This semaphore file is passed as a custom additional file input to builds without skipAnalyzers flag to ensure correct incremental builds. Additionally, we pass this file as an 'UpToDateCheckInput' item for project system's fast-upto-date check.
Testing
AB#1337109 requires few more WIP PRs to go through to work end-to-end:
IsImplicitlyTriggeredBuildtotruefor builds indirectly triggered from these commands. I am working on these changes.I was able to locally build bits with both the above changes + changes from this PR and verify end-to-end functioning of this feature for Run Tests/Debug Tests command. Demo provided below.
Demo