Repository navigation
Add IsAotCompatible for net8.0 and later targets - #963
Conversation
* Enable the trim, AOT and single-file analyzers in Markdig's own build, so CI catches an AOT regression before it ships to consumers * Limit the property to net8.0+, since the analyzers do not run on netstandard and net462 targets * Test the assembly metadata, asserting IsAotCompatible only on net10.0, because the ILLink 8 build tasks used for net8.0 emit just IsTrimmable Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. |
|
I am looking into this, and check how other project verify project settings reliably. |
* Replace the assembly metadata unit tests, which failed in the netstandard workflow because it builds Markdig for netstandard2.x only * Add Markdig.AotTests with VerifyReferenceAotCompatibility and IL3058 as an error, so the CI solution build fails if Markdig loses the AOT marking * Leave PublishAot unset, so the check restores no package beyond the ILLink.Tasks package the IsAotCompatible property already requires Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Rather than asserting that a project setting is correctly configured, I opted for a small The unit tests introduced in the first commit would have been slightly harder to maintain, because they would have had to account for which Markdig build a test run loads, and for |
|
Thanks @StefanGreve, this is a welcome change! 🙏 I checked it locally: Markdig builds on all targets with no IL2xxx/IL3xxx warnings. I also removed the Review done via CodeAlta / Opus 5.5. |
AGENTS.mdasks for Markdig to stay AOT- and trimmer-friendly, but nothing in the build checks it today: the trim, AOT and single-file analyzers only run in a library that opts in. SettingIsAotCompatibleturns them on for everynet8.0+ build, so a change that introduces reflection shows up as a warning in Markdig's own CI instead of in a consumer'sPublishAotoutput, and apps that setVerifyReferenceAotCompatibilityno longer get IL3058 for Markdig.The property goes into
Markdig.targets, soMarkdig.Signedgets it too, and it is limited tonet8.0+ with the condition from the Native AOT docs. No source changes were needed: both targets build with no IL2xxx/IL3xxx warnings, and aPublishAotapp against this branch builds without IL3058 and renders correctly. The new tests check the emitted assembly metadata;IsAotCompatibleis only asserted onnet10.0, because the ILLink version the SDK uses fornet8.0only emitsIsTrimmable.