-
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] Add missing [RequiresDynamicCode]
attributes to System.Linq.Expressions API in ref assembly
#107638
Merged
Conversation
This file contains 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
Calling Expression.Lambda without a delegate type isn't AOT compatible. Fix this by passing the delegate type.
Note regarding the
|
Note regarding the
|
Tagging subscribers to this area: @cston |
eerhardt
approved these changes
Sep 12, 2024
jeffschwMSFT
approved these changes
Sep 12, 2024
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.
approved. we can merge when ready
jeffschwMSFT
added
Servicing-approved
Approved for servicing release
and removed
Servicing-consider
Issue for next servicing release review
labels
Sep 12, 2024
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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.
Backport of #107580 to release/9.0
/cc @eerhardt @cston
Customer Impact
When customers use the native AOT Roslyn Analyzer to find AOT incompatible code, they are not getting the warnings correctly for System.Linq.Expressions. This degrades the value of the Roslyn Analyzer.
By adding these attributes to the
ref
assemblies, this allows the Roslyn Analyzers to work correctly and raise warnings where customer code is calling AOT-incompatible APIs.Regression
[If yes, specify when the regression was introduced. Provide the PR or commit if known.]
Testing
The change to Microsoft.Extensions.DependencyInjection in our repo was because the Roslyn Analyzer found a place where we were calling an incompatible API. This verifies that the ref assembly is correctly attributed.
All existing automated tests pass.
Risk
Low. The change to Linq.Expressions is only to put the matching attributes in the ref assembly from the implementation assembly. This only affects compilation and won't affect runtime behavior. The change to Microsoft.Extensions.DependencyInjection was verified by existing tests and is in code that is only used in
netstandard2.0
builds, not in .NET Framework or .NET Core builds.