Enable Analyzers when building source-only
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- build-system, ci-cd
Research direction
Start by reading eng/Analyzers.targets at line 11, then review the linked pull request and historical corefx commit to understand why analyzers were disabled for source-only builds. Check the source-only jobs and SB stage2 validation; done means source-only builds run applicable analyzers while online-only analyzers remain excluded, with CA2025 behavior consistent across build flows.
Written by the indexing model from the issue text.
Description
https://github.com/dotnet/runtime/pull/115395 showed new CA2025 errors but only in the non-source-only jobs. That's because analyzers are disabled globally when building source-only: https://github.com/dotnet/runtime/blob/08cb954444914798a1a7e41737447c26b134169e/eng/Analyzers.targets#L11
This setting dates back to https://github.com/dotnet/corefx/commit/7732d6b2569f5ffa44ecca1755d0135d300e8569 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
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·