Skip to content

Make order of generated logger items stable.#123428

Merged
cincuranet merged 8 commits intodotnet:mainfrom
cincuranet:stable-gen-logging
Jan 23, 2026
Merged

Make order of generated logger items stable.#123428
cincuranet merged 8 commits intodotnet:mainfrom
cincuranet:stable-gen-logging

Conversation

@cincuranet
Copy link
Contributor

Emits generated classes for logging ordered for stable/deterministic build output.

Fixes #119587.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-logging
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses non-deterministic code generation in the Logger Message Generator by sorting logger classes before emitting them. The change ensures that generated code output is stable across different builds.

Changes:

  • Modified the Emit method to sort logger classes by namespace and then by name before generating code

@tarekgh tarekgh added this to the 11.0.0 milestone Jan 21, 2026
@tarekgh tarekgh added the source-generator Indicates an issue with a source generator feature label Jan 21, 2026
@cincuranet cincuranet marked this pull request as draft January 21, 2026 18:50
@tarekgh
Copy link
Member

tarekgh commented Jan 21, 2026

@cincuranet by the way, thanks for fixing this issue 😄

@cincuranet cincuranet marked this pull request as ready for review January 22, 2026 12:25
@cincuranet
Copy link
Contributor Author

@tarekgh PTAL

cincuranet added a commit to dotnet/extensions that referenced this pull request Jan 22, 2026
Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @cincuranet!

cincuranet added a commit to dotnet/extensions that referenced this pull request Jan 23, 2026
@cincuranet cincuranet merged commit 531dd27 into dotnet:main Jan 23, 2026
92 checks passed
@cincuranet cincuranet deleted the stable-gen-logging branch January 23, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Extensions-Logging source-generator Indicates an issue with a source generator feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LoggerMessageGenerator output order is unstable/non-deterministic

4 participants