Skip to content

Make NativeAOT the default for UniGetUI release packages on all targets#5062

Merged
Gabriel Dufresne (GabrielDuf) merged 10 commits into
mainfrom
curly-spork
Jul 8, 2026
Merged

Make NativeAOT the default for UniGetUI release packages on all targets#5062
Gabriel Dufresne (GabrielDuf) merged 10 commits into
mainfrom
curly-spork

Conversation

@mamoreau-devolutions

@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This change promotes the opt-in NativeAOT path added in #5057 to the default release packaging path for every UniGetUI target: Windows, macOS, and Linux on x64 and arm64.

What changed

  • Release defaults: PublishAot=true is now enabled for Release publishes in UniGetUI.Avalonia.csproj, while Debug/local development builds remain non-AOT by default.
  • ReadyToRun conflict handling: PublishReadyToRun is disabled whenever NativeAOT is active.
  • Publish profiles: added NativeAOT publish profiles for Windows arm64, macOS x64/arm64, and Linux x64/arm64.
  • Release workflow: build-release.yml now publishes NativeAOT packages for all release targets.
  • Linux arm64 cross-compilation: the Ubuntu x64 runner installs the arm64 target toolchain (clang/LLVM, gcc-aarch64-linux-gnu, binutils-aarch64-linux-gnu, zlib1g-dev:arm64) before publishing linux-arm64-NativeAot.
  • Linux package size fix: oversized .dbg/.pdb files are removed from Linux release payloads before packaging, matching the existing Windows oversized-PDB pruning behavior.
  • Linux launcher fix: Linux package launchers now point to the actual app host, /opt/unigetui/UniGetUI, and package staging validates that the executable exists.
  • Windows CI hardening: Windows NativeAOT publish disables shared compilation and project parallelism to avoid intermittent intermediate-output file locks in CI.
  • CI hardening: the NativeAOT publish warning report in dotnet-test.yml no longer uses continue-on-error, so publish failures block CI.
  • Size reporting: release dry runs now upload a consolidated UniGetUI-size-report artifact.
  • E2E coverage: headless CLI E2E now includes Windows NativeAOT and Linux NativeAOT variants; the runner supports the avalonia-native daemon kind for Linux NativeAOT executables.
  • Docs/scripts: publish-nativeaot.ps1 supports arm64 and the README documents NativeAOT as the release default.

Validation

  • .NET Tests passed.
  • CLI Headless E2E passed for:
    • Windows Avalonia
    • Windows NativeAOT
    • Linux Avalonia
    • Linux NativeAOT
  • build-release.yml dry-run passed for all release targets:
    • Windows x64/arm64 NativeAOT
    • macOS x64/arm64 NativeAOT
    • Linux x64/arm64 NativeAOT
  • ✅ Verified the CI-produced Linux .deb launcher points to /opt/unigetui/UniGetUI, matching the packaged app host.

Latest successful release dry run: https://github.com/Devolutions/UniGetUI/actions/runs/28967170760

Final dry-run package sizes

Target Uncompressed Compressed artifact(s)
Windows x64 95.1 MiB 28.6 MiB installer / 39.5 MiB zip
Windows arm64 93.3 MiB 27.4 MiB installer / 37.5 MiB zip
macOS x64 216.9 MiB 48.9 MiB dmg / 49.1 MiB tar.gz
macOS arm64 207.7 MiB 45.1 MiB dmg / 45.2 MiB tar.gz
Linux x64 66.2 MiB 27.8 MiB deb / 27.7 MiB rpm / 27.8 MiB tar.gz
Linux arm64 66.5 MiB 26.4 MiB deb / 26.3 MiB rpm / 26.4 MiB tar.gz

Same-branch Linux comparison

The initial Linux size increase came from shipping the NativeAOT debug-symbol file (UniGetUI.dbg, about 105.8 MiB). After pruning oversized symbols, NativeAOT is smaller than the same-branch non-AOT/R2R Linux publish:

Linux x64 build Uncompressed tar.gz
Non-AOT/R2R (PublishAot=false, PublishReadyToRun=true) 92.0 MiB 38.1 MiB
NativeAOT before symbol pruning 171.9 MiB 54.6 MiB
NativeAOT after symbol pruning 66.2 MiB 27.8 MiB

Notes

  • Avalonia DataGrid still produces known third-party trim/AOT warnings; no new UniGetUI-specific warnings were introduced.
  • One Linux E2E run hit the known transient Collection was modified package-download error; the rerun passed.

…orms

- Enable PublishAot=true for Release builds in Avalonia csproj and disable
  conflicting PublishReadyToRun when NativeAOT is active.
- Add NativeAOT publish profiles for win-arm64, osx-x64, osx-arm64,
  linux-x64 and linux-arm64.
- Update build-release.yml to publish every platform with NativeAOT profiles.
- Harden dotnet-test.yml NativeAOT publish report (no longer ignored).
- Capture per-platform uncompressed and compressed artifact sizes in CI.
- Add NativeAOT variants to CLI headless E2E workflow.
- Support avalonia-native daemon kind in E2E runner for NativeAOT Linux.
- Update publish-nativeaot.ps1 to support arm64 and README documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The default ubuntu-latest runner does not include the aarch64 cross-
compilation toolchain required for linux-arm64 NativeAOT. Keep NativeAOT
for linux-x64 and fall back to the existing ReadyToRun/full-trim path for
linux-arm64 until cross-compilation is available.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The publish step now uses PowerShell syntax for profile selection and
NativeAOT fallback handling, so it must run under pwsh on macOS/Linux.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The per-platform size JSONs are already captured during packaging. Add a
standalone size-report job that downloads all artifacts, consolidates the
sizes into a markdown table, and uploads it. This runs even in dry-run
mode so size comparisons are available before a real release.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The fallback disables NativeAOT because the hosted x64 runner cannot
cross-compile NativeAOT for linux-arm64. The resulting build is the
previous non-NativeAOT self-contained path; update the comment so it
is not misread as a guaranteed ReadyToRun fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Install the Linux arm64 cross toolchain on the x64 Ubuntu release runner and use the linux-arm64 NativeAOT publish profile instead of falling back to the non-AOT self-contained path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove large .dbg/.pdb files from Linux release payloads before packaging, matching the existing Windows behavior of not shipping oversized debug symbols in release artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the actual UniGetUI app host as the default Linux package executable and validate that the staged package payload contains it before creating launcher integration files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pass UseSharedCompilation=false directly to the Windows NativeAOT publish command so referenced project compiles do not use VBCSCompiler and intermittently lock intermediate outputs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Disable MSBuild project parallelism for the Windows NativeAOT release publish to avoid intermittent intermediate output races in referenced projects.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 200feea into main Jul 8, 2026
14 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the curly-spork branch July 8, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants