You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable Analyzers when building source-only #115397
This setting dates back to dotnet/corefx@7732d6b which disabled analyzers for source-only builds.
This is problematic for various reasons:
Creates an artificial difference between source-only and non-source-only builds
Diverging behavior form other repositories which don't disable analyzers when building source-only
Doesn't get caught in SB's stage2 validation that runs as part of VMR PRs. For the above PR that meant it only get caught in the VMR -> runtime backflow PR and not in the roslyn-analyzers -> VMR forward flow PR.
I propose that we change this setting to only apply to "online" analyzers that don't exist in the source-build graph.
cc @dotnet/source-build @ericstj (as you made the original commit) for opinions
Analyzers have historically been problematic in the past for source-build for projects targeting older TFMs because the targeting packs from SBRP exclude the analyzers. The targeting pack analyzers can't reasonable be built from source. We are in a much better place today with the introduction of NetCurrent. Ideally differences like this wouldn't exist. It should be easy to validate what the impact is of enabling this within the VMR.
Not sure I agree that change was from then - I see e0e1919 renamed the property to apply to all analyzers.
Before that 42183b1#diff-489b1e12d93a4928641f4e40fc9d33fe0490b257176f4f055c901dbfc8b751e5R5 added it as EnableAnalyzers which might have been our own property that controlled some package references to things that were likely not "below runtime" in the source build graph.
The analyzer that made me open this issue is Microsoft.CodeAnalysis.NetAnalyzers which got disabled by that commit. That triggered an analyzer error in today's dotnet -> runtime backflow PR instead of at insertion time in the roslyn-analyzers -> VMR forward flow PR in the source-build stage2 job.
If I don't hear any objections to re-enabling the analyzers when building source-only, I will send a PR re-enabling them (maybe first in the VMR as Michael suggested).
Activity
MichaelSimons commentedon May 8, 2025
Analyzers have historically been problematic in the past for source-build for projects targeting older TFMs because the targeting packs from SBRP exclude the analyzers. The targeting pack analyzers can't reasonable be built from source. We are in a much better place today with the introduction of NetCurrent. Ideally differences like this wouldn't exist. It should be easy to validate what the impact is of enabling this within the VMR.
dotnet-policy-service commentedon May 8, 2025
Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.
ericstj commentedon May 8, 2025
At the time of the commit you linked we were fixing prebuilts -- dotnet/source-build#884
Not sure I agree that change was from then - I see e0e1919 renamed the property to apply to all analyzers.
Before that 42183b1#diff-489b1e12d93a4928641f4e40fc9d33fe0490b257176f4f055c901dbfc8b751e5R5 added it as
EnableAnalyzerswhich might have been our own property that controlled some package references to things that were likely not "below runtime" in the source build graph.Seems like #42272 (comment) might cover this.
ViktorHofer commentedon May 8, 2025
Thanks Eric and Michael for sharing context.
The analyzer that made me open this issue is
Microsoft.CodeAnalysis.NetAnalyzerswhich got disabled by that commit. That triggered an analyzer error in today's dotnet -> runtime backflow PR instead of at insertion time in the roslyn-analyzers -> VMR forward flow PR in the source-build stage2 job.If I don't hear any objections to re-enabling the analyzers when building source-only, I will send a PR re-enabling them (maybe first in the VMR as Michael suggested).