-
Notifications
You must be signed in to change notification settings - Fork 517
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
NativeAOT support for GarnetServer #74
Conversation
…m binary-only GarnetServer and address low-hanging fruit AOT/Trim warnings
@microsoft-github-policy-service agree |
Hey @neon-sunset! Thanks for your willingness to contribute to Garnet! I'm not sure if what you're suggesting here is possible to support, as we do support custom commands that are dynamically loaded from local dlls on the server (See RespServerSession.RegisterCustomCommands in Garnet.server/Resp/ArrayCommands.cs). Let me know what you think! Tal. |
edit: Nevermind, above would be approach for any features in the NuGet libraries that are hard to trim. For the Garnet.Server, we could introduce the option to disable custom command as command-line switch (again opt-in presumably) and guard the custom command logic with |
…es to resolve build failure
@TalZaccai @PaulusParssinen Indeed, I was mostly going over the list of trim and AOT warnings, and either addressing them or writing down for future work. Yes, it makes sense to guard the dependent loading with a check and add an informative error else clause when NAOT is targeted. Once NAOT binaries are published and released, there could simply be a notice regarding JIT-dependent feature(s). I don't think it makes sense to add a toggle to explicitly disable this feature for JIT deployment too, or at least, if that is still desired, it can be done separately. I will continue to work on this a little bit later, thank you for the assistance :) |
The PR is rather out of date, so we will close it for now. When you get back to this, it would be great to re-open a new PR from the latest. Thanks all! |
This PR makes progress towards supporting NativeAOT publish of
GarnetServer
. For now, NativeAOT support for the nuget itself is out of scope as I suspect the users first and foremost care about the application itself.If the size of PR gets too large, it may be split into multiple as there are a few areas that need to be refactored to be AOT-compatible:
Options
andRedisOptions
Ideally, it should overall improve the state of codebase as there are existing tools like
System.CommandLine
orM.E.C.ConfigurationBinder
(or similar) which provide the features required by Garnet in a more robust, trim and AOT compatible way.