Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Aug 8, 2025

Adds AOT annotations for all published projects and ensures they are advertised as AOT compatible.

Create a smoke test binary that writes to an in memory elasticsearch endpoint for our NLog and Extensions loggers.

Serilog is currently failing with:

ecs-aot-smoketest failed with 2 error(s) (58.2s) → examples/ecs-aot-smoketest/bin/release/net9.0/osx-arm64/ecs-aot-smoketest.dll
    ILC : Trim analysis error IL2067: Serilog.Capturing.PropertyValueConverter.TryConvertStructure(Object,Type,Destructuring,StructureValue&): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'Serilog.Capturing.PropertyValueConverter.CreateStructureValue(Object,Type,Boolean)'. The parameter 'type' of method 'Serilog.Capturing.PropertyValueConverter.TryConvertStructure(Object,Type,Destructuring,StructureValue&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
    /Users/mpdreamz/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.7/build/Microsoft.NETCore.Native.targets(317,5): error MSB3073: The command ""/Users/mpdreamz/.nuget/packages/runtime.osx-arm64.microsoft.dotnet.ilcompiler/9.0.7/tools/ilc" @"obj/release/net9.0/osx-arm64/native/ecs-aot-smoketest.ilc.rsp"" exited with code -1.

Will create an issue with Serilog to see if it can be resolved.

This removes https://github.com/benaadams/Ben.Demystifier as its not AOT compatible. AOT compatibility beats nicer stacktrace strings as a feature to keep supporting IMO.

This bumps NLog to 6.0.0 to take benefit of its work to be AOT compatible (cc @snakefoot)

Also be aware wuth this backport we bump NLog to 6.0.0 for our 8.x releases.

We typically do not require major version bumps in our deps to force a bump in our major version. cc @snakefoot

(cherry picked from commit de9b962)
…ons loggers Elasticsearch

(cherry picked from commit 46bf540)
(cherry picked from commit 207eebf)
(cherry picked from commit 804ffca)
(cherry picked from commit 800029d)
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@Mpdreamz Mpdreamz changed the title backport/aot annotation [backport] AOT Annotations and CI smoke tests for AOT publishes Aug 8, 2025
@snakefoot
Copy link
Contributor

snakefoot commented Aug 8, 2025

This bumps NLog to 6.0.0 to take benefit of its work to be AOT compatible

I was thinking to update the AOT-verification-app to use NLog v6. But keep using NLog v5 for the library ? This will provide the highest level of compatibility (Since not everyone develops AOT-applications)

@Mpdreamz Mpdreamz merged commit 9d66dba into 8.18 Aug 13, 2025
8 checks passed
@Mpdreamz Mpdreamz deleted the backport/aot-annotation branch August 13, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants