-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make NCronJob native AOT ready #54
Comments
In the past have added AOT support to a few apps so I checked what I could do to help. There are 3 incompatible parts:
Those are my two cents, and seeing this issue I thought on discussing it and see how can I help. |
Just adding, the updated documentation says to use IsTrimmable instead of IsAotCompatible in libraries |
@pablopioli Interesting - I can't find where
Yeah - this kind of a fallback or convenient method if you forgot to register a job. We could also just "fail" in those moments.
Yes - could we "ignore" that somehow and tell the compiler that we never run into the issue that the type might be trimmed out at this point in time? If the user didn't register |
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot The important one for a library is the trim analyzer. The trim process is very agressive and if unsure it will default to remove the member. With properties there is not much of a problem, you use it or not. But for a library like this the constructors are very problematic. NCronJob could just not find any constructor at all. The other analyzers are for single file deployment (that is a decision for the consuming app) and the AOT analyzer (if your library can support trimming the tooling will simply convert the bytecode to native code.)
Yes, it is more a design decision than a technical one.
No, you can't suppress trimming warning. You can ignore them if you are sure that it will not fail anyway. The compilation process will warn you but the program will run without problems. Unless you are treating warning as errors and then you are toasted. |
We can live with the current state. Given that this was just an idea and not a real "need", we can keep it in the backlog. That said I appreciated your input a lot @pablopioli! Let me know if you have other ideas! |
@linkdotnet Do we want to pave the way for this in v4? As identified in #106, we could
And then drop the call to |
I have to check some issues and prs - I can vaguely remember why the code is there, but have to dig a bit deeper. |
Currently, NCronJob is not native AOT ready. That might be a less ideal choice for folks who run this library in the cloud and try to minimize the footprint.
There is a nice article from Microsoft itself: https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries/
Basically what we want is:
The text was updated successfully, but these errors were encountered: