Make structured logging libraries Native AOT compatible - #963
Draft
baronfel wants to merge 2 commits into
Draft
Conversation
Enable AOT analysis for the core libraries and replace trim-unsafe reflection and dynamic node construction with statically analyzable code. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c4e0c6d3-54cb-41fb-9c49-c73675669ee2
Publish and run a trimmed Native AOT executable in CI. Exercise node construction, reflection-sensitive accessors, utility XML parsing, and real binlog parsing with a deterministic fixture or an external binlog path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c4e0c6d3-54cb-41fb-9c49-c73675669ee2
Collaborator
Author
|
@KirillOsenkov this is mostly vibe-coded nonsense, but I think it could be really interesting to consider making the library trimmable to enable smaller/faster CLI apps! |
Collaborator
Author
|
(and by that I mean that I think that the core changes are maybe ok but if you were interested in taking it I'd make a proper harness and other niceties) |
slang25
added a commit
to slang25/MSBuildStructuredLog
that referenced
this pull request
Sep 6, 2026
…otations Chet Husk's DynamicallyAccessedMembers annotations on the Reflector accessors (upstream PR KirillOsenkov#963) keep the event-args fields alive under trimming, so the bridge and the browser-wasm engine no longer need to root the whole types. Verified: the dylib smoke test reads 113,564 nodes and the engine test page reads 357,856 in Chrome. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MSBuild.StructuredLoggerandMSBuild.StructuredLogger.Utilsas AOT-compatible on modern target frameworksActivator-based object-model construction with statically analyzable codeItemDictionary<T>reflection path with precise linker rootingValidation