Skip to content

Convert genRuntimeEventSources to a C# source generator #114810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jkoritzinsky
Copy link
Member

Convert this script to C# to remove the only direct python usage from within our managed build.

I primarily converted this script with VSCode's Copilot's Agent mode with ChatGPT 4.1, with a few logic adjustments as necessary to match the python script's codegen.

@Copilot Copilot AI review requested due to automatic review settings April 17, 2025 23:31
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 17, 2025
Copy link
Contributor

@Copilot 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 PR converts a Python-based code generation script into a C# source generator to remove a direct Python dependency from our managed build.

  • Converts the logic for manifest file processing and event method generation from Python to C#.
  • Adopts Roslyn incremental generator APIs, new string interpolation with raw strings, and modern collection initialization.
Files not reviewed (5)
  • eng/python.targets: Language not supported
  • src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj: Language not supported
  • src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj: Language not supported
  • src/libraries/System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj: Language not supported
  • src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj: Language not supported

@jkoritzinsky jkoritzinsky force-pushed the gen-runtime-event-source-csharp branch from c1d8876 to 8a2bbb0 Compare April 17, 2025 23:35
@am11
Copy link
Member

am11 commented Apr 18, 2025

Nice! genLttngProvider etc. can also be converted to src/native/minipal/UnicodeDataGenerator type of a generator with output native code checked in, as the output unicodedata.c rarely changes (and when they do,Updating-Unicode-Versions.md has steps how to update).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants