-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
WIP Initial Trimming Support #1508
base: main
Are you sure you want to change the base?
Commits on Apr 18, 2024
-
* Marked Spectre.Console and Spectre.Console.Cli as trimmable to enable warnings * Marked Demo.cspoj to be PublishedAOT and to include all trim warnings Spectre.Console * Marked Spectre.Console methods that used TypeConverter with suppressed messages * Marked ExceptionFormatter as requiring dynamic code, and added a fallback for AOT scenarios. Spectre.Console.Cli * Settings were discovered automatically with reflection. Added a new method for adding commands that allows explicit configuration of the settings to prevent them from being trimmed. Marked the old method as requiring dynamic code and pointed users to the new overload * Added attributes to the default TypeRegister to mark the types as being instantiated dynamically. * Suppressed a whole slew of warnings with command bulding and running the commands. With the commands and their settings being marked as having DynamicallyAccessedMembers this, theoretically, should work without error. Biggest worry is in CommandParameterComparer. The MetadataToken is stripped when published as AOT so it can't be used. A simple equals seems to work the same, but I'm not sure the historical reason MetadataToken is used here.
Configuration menu - View commit details
-
Copy full SHA for 32226aa - Browse repository at this point
Copy the full SHA 32226aaView commit details -
Add work around for NativeAOT bug with enums and DefaultValues
Enums are converted to integers with NativeAOT on attribute constructors. This work around is needed until that bug is fixed. See dotnet/runtime#100688
Configuration menu - View commit details
-
Copy full SHA for 714a09d - Browse repository at this point
Copy the full SHA 714a09dView commit details -
Improves trim support for Commands with no settings
Commands with no settings, such as those using the Data, have a better warning pushing users to use EmptyCommandSettings. EmptyCommandSettings is never instantiated directly, so it is marked as a DynamicDependency
Configuration menu - View commit details
-
Copy full SHA for 5d79833 - Browse repository at this point
Copy the full SHA 5d79833View commit details -
Uses Polysharp for AOT related attributes
Adds polysharp for AOT attributes to reduce #IF statements. Also removes Nullable polyfill as polysharp provides that functionality too.
Configuration menu - View commit details
-
Copy full SHA for b4df56d - Browse repository at this point
Copy the full SHA b4df56dView commit details -
Better use of DynamicallyAccessedMemberTypes and UnconditionalSuppres…
…sMessage Tried to rip out UnconditionalSuppressMessage where types could be annotated properly. Also tried to get DynamicallyAccessedMemberTypes to better represent what members were being accessed - almost always it is a public constructor and public properties. Part of this exercise showed the need for a new CommandApp for DefaultCommands that accepts a parameter. Right now it lives side-by-side with the original CommandApp<T>
Configuration menu - View commit details
-
Copy full SHA for 99412b9 - Browse repository at this point
Copy the full SHA 99412b9View commit details -
Adding dedicated NativeAOT project
Adding a nativeAot version of the demo application. While I was in here I fixed a few bugs in the original Demo though.
Configuration menu - View commit details
-
Copy full SHA for db3ce54 - Browse repository at this point
Copy the full SHA db3ce54View commit details -
Marking UnsafeConfig unsafe for AOT, and adding more robust TypeConve…
…rterHelper, testing DI
Configuration menu - View commit details
-
Copy full SHA for 602f7de - Browse repository at this point
Copy the full SHA 602f7deView commit details