Skip to content

Enable Native AOT for Pong.Desktop#47

Draft
yesseruser wants to merge 17 commits into
mainfrom
native-aot
Draft

Enable Native AOT for Pong.Desktop#47
yesseruser wants to merge 17 commits into
mainfrom
native-aot

Conversation

@yesseruser

@yesseruser yesseruser commented Dec 6, 2025

Copy link
Copy Markdown
Member

TODO:

  • Before publishing, we need to wait for MonoGame release 3.8.5
  • Bump MonoGame to 3.8.5
  • Bump MGCB tools to 3.8.5
  • Enable butler pushing in pipeline
  • Fill out size of shrink caused by this PR into changelog
  • Fill out release date in metainfo correctly

Description

  • Bumps MGCB tools and MonoGame to 3.8.5
  • Excludes debug info from CD pipeline builds
  • Enables PublishAOT for Windows and Linux x64 builds. Mac and arm64 are excluded because:
    • There's dependency hell that needs to be resolved on MacOS runners, so we are building for MacOS on a Linux runner, that means NativeAOT cannot be build
    • MGCB doesn't work properly on Arm64 on Linux and Windows

Summary by CodeRabbit

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 6, 2025

Copy link
Copy Markdown

Walkthrough

These changes update the project's build infrastructure to enable NativeAOT compilation, upgrade MonoGame framework dependencies to a develop version, refine CI/CD publishing workflows with artifact cleanup steps, and document a new 1.3.0 release with feature notes.

Changes

Cohort / File(s) Summary
CI/CD Workflow Publishing
.github/workflows/publish.yml
Enhanced platform-specific packaging and publishing: Linux adds debug artifact removal, tarball creation (linux-x64, linux-universal), and configures PublishAot=False for universal builds; Windows removes pdb files before packaging and comments out butler push; macOS adds PublishAot=False flag, removes dsym files, and comments out butler push.
Project Build Configuration
Pong.Desktop/Pong.Desktop.csproj, .config/dotnet-tools.json
Added PublishAot property set to true; upgraded MonoGame.Framework.DesktopGL and MonoGame.Content.Builder.Task from 3.8.4 to 3.8.5-develop.13; updated dotnet-tools versions to 3.8.5-develop.13.
Release Documentation
flatpak/io.github.yesser_studios.Pong.metainfo.xml
Added new version 1.3.0 release entry with changelog noting bot mode keybind enablement between rounds and NativeAOT support; reordered releases with 1.3.0 positioned above 1.2.4 and 1.2.3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Configuration and version updates follow consistent patterns across files
  • Workflow changes are repetitive across platforms (similar artifact cleanup and packaging steps)
  • Documentation addition is straightforward

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Enable Native AOT for Pong.Desktop' directly and clearly reflects the main objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch native-aot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/publish.yml (1)

29-35: Fix YAML syntax error in Linux build tar.gz step.

Lines 32–35 have a malformed run: block. Line 33 declares a nested run: command which is invalid YAML. The rm and tar commands should be in a single multi-line run: block.

   - name: Create tar.gz package
      run: |
-       run: rm ./release/*.dbg
+       rm ./release/*.dbg
         tar -czvf linux-x64.tar.gz ./release
         # butler push linux-x64.tar.gz yesseruser/pong:linux-x64
🧹 Nitpick comments (1)
flatpak/io.github.yesser_studios.Pong.metainfo.xml (1)

58-64: Inconsistent release block structure.

The 1.3.0 release block omits the <description> wrapper used by all other releases (1.2.4 and earlier). For consistency and potential parser compatibility, wrap the content in a <description> element.

-      <release version="1.3.0" date="YYYY-MM-DD">
-          <p>Changes in 1.3.0:</p>
-          <ul>
-              <li>The bot mode keybind is now enabled in-between rounds.</li>
-              <li>Enabled NativeAOT support, shrinking the file size to <X%> or <XMB>.</li>
-          </ul>
-      </release>
+      <release version="1.3.0" date="YYYY-MM-DD">
+          <description>
+              <p>Changes in 1.3.0:</p>
+              <ul>
+                  <li>The bot mode keybind is now enabled in-between rounds.</li>
+                  <li>Enabled NativeAOT support, shrinking the file size to <X%> or <XMB>.</li>
+              </ul>
+          </description>
+      </release>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8785fe6 and 3fe2a70.

📒 Files selected for processing (4)
  • .github/workflows/publish.yml (4 hunks)
  • Pong.Desktop/.config/dotnet-tools.json (1 hunks)
  • Pong.Desktop/Pong.Desktop.csproj (2 hunks)
  • flatpak/io.github.yesser_studios.Pong.metainfo.xml (1 hunks)
🔇 Additional comments (6)
Pong.Desktop/.config/dotnet-tools.json (1)

6-6: Verify approval for pre-release toolchain versions.

The dotnet tools are pinned to 3.8.5-develop.13, a pre-release version. Confirm that this develop version is approved for your build pipeline, as pre-release versions may lack stability guarantees or receive breaking changes. Per the PR objectives, you note waiting for MonoGame 3.8.5 release—clarify whether 3.8.5-develop.13 is acceptable or if this should wait for a stable 3.8.5 release.

Also applies to: 12-12, 18-18, 24-24, 30-30

Pong.Desktop/Pong.Desktop.csproj (2)

10-10: Confirm PublishAot global setting vs. per-build overrides.

PublishAot is set globally to true, but the CI/CD workflow (publish.yml) explicitly disables it for macOS and the universal Linux build using -p:PublishAot=False. This is a valid pattern—global setting with per-build CLI overrides—but confirm this is your intended design:

  • Is PublishAot=true appropriate as the project default?
  • Are the per-build overrides in the workflow sufficient to prevent AOT builds where not supported?

31-32: Verify pre-release MonoGame version for production readiness.

Both MonoGame.Framework.DesktopGL and MonoGame.Content.Builder.Task are pinned to 3.8.5-develop.13, matching the dotnet-tools.json. Confirm this pre-release version is acceptable for your release pipeline and aligns with your note to wait for MonoGame 3.8.5 stable release.

.github/workflows/publish.yml (3)

40-51: Clarify intent of dual Linux builds (x64 AOT + universal non-AOT).

The Linux job now publishes two separate artifacts:

  1. linux-x64.tar.gz — built with PublishAot=true (from csproj)
  2. linux-universal.tar.gz — rebuilt with PublishAot=False

This double-build strategy increases CI time and storage. Confirm this is intentional (e.g., to offer both AOT and non-AOT options to users) and document the rationale in the workflow comments.


69-70: Clarify intent of commented butler push commands.

Several butler push commands are commented out across the workflow (lines 35, 74, 107). Confirm whether:

  1. Push is intentionally disabled (e.g., pending manual review or a later step)?
  2. Butler credentials/configuration is incomplete?
  3. These are placeholders for future Itch.io integration?

If push is intentionally disabled, document the reason in a comment for future maintainers.

Also applies to: 74-74


95-97: Verify macOS PublishAot=False and dsym cleanup strategy.

The macOS job correctly disables PublishAot with -p:PublishAot=False (line 95, aligned with PR objectives), and removes .dsym debug symbols (line 96–97). This is appropriate since macOS builds run on a Linux runner and cannot generate native macOS AOT binaries. No issues here.

Comment on lines +58 to +64
<release version="1.3.0">
<p>Changes in 1.3.0:</p>
<ul>
<li>The bot mode keybind is now enabled in-between rounds.</li>
<li>Enabled NativeAOT support, shrinking the file size to </li>
</ul>
</release>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incomplete release description and missing date.

Line 62 is incomplete: <li>Enabled NativeAOT support, shrinking the file size to </li> ends abruptly. Complete the sentence with the actual file size reduction metric or percentage.

Additionally, the 1.3.0 release entry lacks a date attribute (present on all other releases). Add the release date or expected release date.

-      <release version="1.3.0">
+      <release version="1.3.0" date="YYYY-MM-DD">
           <p>Changes in 1.3.0:</p>
           <ul>
               <li>The bot mode keybind is now enabled in-between rounds.</li>
-              <li>Enabled NativeAOT support, shrinking the file size to </li>
+              <li>Enabled NativeAOT support, shrinking the file size to <X%> or <XMB>.</li>
           </ul>
       </release>
🤖 Prompt for AI Agents
In flatpak/io.github.yesser_studios.Pong.metainfo.xml around lines 58 to 64, the
1.3.0 <release> entry is missing a date attribute and the second list item is
truncated; update the <release> tag to include the actual release date in the
date="YYYY-MM-DD" attribute, and complete the list item by inserting the actual
file-size reduction metric or percentage (e.g. "shrinking the file size by 30%
(or X MB)") so the sentence reads fully and clearly.

@yesseruser yesseruser marked this pull request as draft December 6, 2025 11:37
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.

1 participant