Conversation
|
Derivative of what we've done on TurboMqtt: petabridge/TurboMqtt#231 |
Aaronontheweb
left a comment
There was a problem hiding this comment.
Detailed my changes and how the canary works
build-system/azure.aot.template.yaml
Outdated
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| ./tools/test-aot-compatibility.ps1 net8.0 |
There was a problem hiding this comment.
This uses a PowerShell script to tabulate the total number of AOT trim warnings and throw an exception if they're above 0 - taken from one of Microsoft's blogs on AOT support for library authors
| outputDirectory: "bin/nuget" | ||
| artifactName: "nuget_pack-$(Build.BuildId)" | ||
|
|
||
| - template: azure.aot.template.yaml |
There was a problem hiding this comment.
We do AOT on both Windows and Linux just in-case there are platform-specific issues. Should never happen, but you never know.
| { | ||
| public AotReceiveActor() | ||
| { | ||
| ReceiveAny(o => Sender.Tell(o)); |
There was a problem hiding this comment.
We know ReceiveActors use the ExpressionCompiler in v1.5 and earlier, which should trip AOT warnings. I might need to add a stricter Receive<string> with a predicate prior to this one just to make sure that code gets exercised properly in the test,
|
|
||
| namespace Akka.AOT.App.Actors; | ||
|
|
||
| public class AotUntypedActor : UntypedActor |
There was a problem hiding this comment.
UntypedActor is already AOT-friendly, but we should still see that show up.
There was a problem hiding this comment.
We probably need to add more cases to the canary over time, such as:
IStashsupportIWithTimerssupport- Custom dispatchers
- Custom mailboxes
- Routers
Just to gradually add full trim coverage to everything in the default Akka library, minus default serialization (which we know will not work)
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Label="AotSettings"> |
There was a problem hiding this comment.
These are all the MSBUILD settings needed to get the compiler to produce the AOT warnings we're looking for
| { | ||
| static async Task Main(string[] args) | ||
| { | ||
| var system = ActorSystem.Create("MySystem"); |
There was a problem hiding this comment.
Does some end to end messaging and uses the default configuration loading, which currently triggers a number of AOT warnings due to how we load Types from HOCON strings - those are all issues on the #7246 epic we will have to gradually fix before this spec can pass.
|
Not going to be able to merge this until we make significant progress on #7246 |
|
We could, in theory, merge this and just remove it from the CI/CD pipeline so we can get incremental validation locally while we're implementing the AOT epic - would that be a good idea? cc @akkadotnet/core |
|
After #7456 was merged in, we are down from 65 warnings to 56. |
3d1f43c to
a100932
Compare
Changes
AOT Canary for the Core
Akkamodule - we'll have to gradually expand our AOT support as we're able to, but everything starts with this.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):