-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Annotate CDP as AOT-unsafe #14637
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
[dotnet] Annotate CDP as AOT-unsafe #14637
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
I will start to review after basic #14574 is merged. I thought that CDP requires deeper knowledge, so on hold for now. |
|
@nvborisenko Thanks! It looks like a lot of the work you're doing could be addressed if It doesn't have much support because this kind of conversion isn't roundtrippable. Maybe Selenium can make the case for this functionality there? |
|
No, Source Generation in Json is very good. The problem I am trying to resolve is that many many years ago wire objects were serialized as You referenced to the issue, which is in open state... |
|
@nvborisenko Yeah the But, that would involve a lot of legwork. I would love to contribute any PRs if that's the direction this project wants to go down. |
|
I am in communication with https://github.com/appium/appium team, they are testing #14574 We should migrate "classic" before moving further. |
Unfortunately it is big boom breaking change :( |
|
I removed the devtools changes from this PR. This PR doesn't need to handle the AOT compat for that scenario, such changes can come after (maybe paired with some generator changes, who knows). |
|
PR has been updated, CDP is fully unsupported on AOT |
* [dotnet] Add trimming attributes, address some trim warnings * Make DomainType struct readonly * center preprocessor directives on .net 8+ * Add file header to `TrimmingAttributes.cs` * Tweak #if location * Hide `Assembly.CodeBase` from .NET 8 compilation * Remove changes from `DevToolsDomains` * remove remaining changes from `DevToolsDomains` * Annotate CDP as AOT-unsafe * Annotate CDP as fully AOT-unsafe * Improve AOT incompatibility message
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
This improves the story for trimming/AOT using Selenium, specifically addressing non-JSON related warnings.
Motivation and Context
In furtherance of #14480
Types of changes
Checklist
PR Type
Enhancement, Other
Description
DevToolsDomainsclass to improve AOT compatibility by introducing aDomainTypestruct and usingDynamicallyAccessedMembersattributes.JsonEnumMemberConverterclass by adding attributes for public fields and updating enum value retrieval for .NET 5.0 or greater.TrimmingAttributes.cswith custom attributes to support trimming and AOT compatibility, including conditional compilation for different .NET versions.WebDriver.csprojfile to include a conditional AOT compatibility property for future .NET versions.Changes walkthrough 📝
DevToolsDomains.cs
Enhance DevToolsDomains for AOT compatibilitydotnet/src/webdriver/DevTools/DevToolsDomains.cs
DomainTypestruct to handle trimming.DynamicallyAccessedMembersattribute for public constructors.DomainTypeinstead ofType.JsonEnumMemberConverter.cs
Improve JsonEnumMemberConverter for AOT compatibilitydotnet/src/webdriver/DevTools/Json/JsonEnumMemberConverter.cs
DynamicallyAccessedMembersattribute for public fields.TrimmingAttributes.cs
Add custom trimming attributes for AOT supportdotnet/src/webdriver/Internal/TrimmingAttributes.cs
DynamicallyAccessedMembersand related attributes.WebDriver.csproj
Update project file for potential AOT compatibilitydotnet/src/webdriver/WebDriver.csproj