-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/9.0-preview7] Fix platform analyzer attribute order for MacCatalyst #105410
[release/9.0-preview7] Fix platform analyzer attribute order for MacCatalyst #105410
Conversation
We need to make sure the attribute for MacCatalyst comes _after_ the iOS one due to how MacCatalyst is a superset of iOS: https://learn.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#platform-inclusion This caused an error in aspnetcore in the latest dependency flow because the analyzer thought AesGcm is _only_ supported on MacCatalyst: > error CA1416: (NETCORE_ENGINEERING_TELEMETRY=Build) This call site is reachable on all platforms. 'AesGcm.Decrypt(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>, Span<byte>, ReadOnlySpan<byte>)' is only supported on: 'maccatalyst' 13.0 and later.
Note regarding the
|
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
Please send the email to Tactics requesting approval, we're running short on time for merging backports to prev7. |
That's really unusual. Should we fix the analyzer? I don't think it's normal to have attribute order matter. This fix is fine to unblock P7 but I'm surprised to learn about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unblocks p7 codeflow even if the actual problem is in the analyzer
Approved by Tactics via email. Eric said offline his comment is non-blocking. Merging now. |
There was an unrelated test failure in CodePages. The tests succeeded but the test execution was marked as failed for some weird reason. Anyway, not a problem. |
Backport of #105409 to release/9.0-preview7
/cc @akoeplinger
Customer Impact
We need to make sure the attribute for MacCatalyst comes after the iOS one due to how MacCatalyst is a superset of iOS: learn.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#platform-inclusion
This caused an error in aspnetcore in the latest dependency flow because the analyzer thought AesGcm is only supported on MacCatalyst:
error CA1416: (NETCORE_ENGINEERING_TELEMETRY=Build) This call site is reachable on all platforms. 'AesGcm.Decrypt(ReadOnlySpan, ReadOnlySpan, ReadOnlySpan, Span, ReadOnlySpan)' is only supported on: 'maccatalyst' 13.0 and later.
Regression
The attributes were only added recently a couple days ago.
Testing
Tested locally by overwriting the ref assembly in my dotnet SDK and observing the analyzer warning to be fixed.
Risk
Low, this just reorders the attributes on two classes in ref assemblies (the rest of the changes are internal in implementation assemblies and no-op).