Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Update dependencies from dotnet/roslyn-analyzers #111518

Merged
merged 12 commits into from
Feb 3, 2025

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Jan 17, 2025

This pull request updates the following dependencies

From https://github.com/dotnet/roslyn-analyzers

  • Subscription: 5465c78f-1281-49a8-f9b0-08d9301a7704
  • Build: 20250131.1
  • Date Produced: January 31, 2025 3:57:05 PM UTC
  • Commit: 8fe7aeb135c64e095f43292c427453858d937184
  • Branch: refs/heads/main

…uild 20250116.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25066.1
…uild 20250122.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25072.1
…uild 20250123.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25073.1
…uild 20250124.5

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25074.5
…uild 20250126.4

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25076.4
@ViktorHofer
Copy link
Member

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs(179,59): error CA1416: (NETCORE_ENGINEERING_TELEMETRY=Build) This call site is reachable on all platforms. 'Environment.CpuUsage' is unsupported on: 'maccatalyst'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

cc @tarekgh

@tarekgh
Copy link
Member

tarekgh commented Jan 30, 2025

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs(179,59): error CA1416: (NETCORE_ENGINEERING_TELEMETRY=Build) This call site is reachable on all platforms. 'Environment.CpuUsage' is unsupported on: 'maccatalyst'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

I am not sure if this is a valid violation. @akoeplinger has fixed that before in the PR #105409.

The code is clearly marking the method with [UnsupportedOSPlatform("ios")] and [SupportedOSPlatform("maccatalyst")]. The method is calling Environment.CpuUsage which is also marked with [UnsupportedOSPlatform("ios")] and [SupportedOSPlatform("maccatalyst")]. I am not seeing anything wrong here.

@akoeplinger may confirm that and maybe someone help with that analyzer or at least explain if we are missing anything.

@akoeplinger
Copy link
Member

akoeplinger commented Jan 31, 2025

This was actually another case of #105409, triggered by the unrelated PR #109806 which ran the code formatter on the System.Runtime.cs ref assembly source which reordered the SupportedOSPlatform("maccatalyst") to be before the ios one and triggering that bug.

I left a comment in the ref source to hopefully make this easier to spot in the future.

The new analyzer also uncovered a case in Normalization.Icu.cs where we used some enum values unsupported on browser, suppressed the warning there since it is checked afterwards.

akoeplinger and others added 5 commits January 31, 2025 18:40
…uild 20250131.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.12.0-beta1.24629.1 -> To Version 3.12.0-beta1.25081.1
…ate()

X509CertificateLoader.LoadCertificate() is not supported there, bubble up the warning.
@akoeplinger
Copy link
Member

/ba-g failures are unrelated to the roslyn-analyzers bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-codeflow for labeling automated codeflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants