Skip to content

Reduce Windows publish payload#4981

Open
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
mainfrom
mamoreau-devolutions-windowsdesktop-runtime-audit
Open

Reduce Windows publish payload#4981
Marc-André Moreau (mamoreau-devolutions) wants to merge 1 commit into
mainfrom
mamoreau-devolutions-windowsdesktop-runtime-audit

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Summary

  • Condition the Devolutions macOS and Linux Avalonia theme packages so they are only restored on their target OSes.
  • Prevent Windows builds from importing Devolutions.AvaloniaControls and its transitive System.Reactive dependency, which selected a WindowsDesktop asset and pulled WPF/WinForms runtime files into the self-contained publish.
  • Add a small local SubscribeValue helper for the app's Avalonia observable callbacks so Windows no longer depends on System.Reactive for Subscribe(Action<T>) extension methods.
  • Keep PublishReadyToRun enabled.

Impact

Windows win-x64 Release publish no longer contains the WPF/WinForms marker payload (PresentationFramework.dll, PresentationCore.dll, System.Windows.Forms*.dll, WindowsBase.dll, System.Xaml.dll, ReachFramework.dll, wpfgfx_cor3.dll).

Measured against the original baseline:

Metric Baseline After Delta
Files 925 610 -315
Raw publish size 317.65 MiB 216.17 MiB -101.48 MiB
ZIP size 130.45 MiB 90.48 MiB -39.97 MiB
WPF/WinForms marker files 126 0 -126

Validation

  • dotnet publish src\UniGetUI.Avalonia\UniGetUI.Avalonia.csproj /noLogo /p:Configuration=Release /p:Platform=x64 -p:RuntimeIdentifier=win-x64 -v m /m:1
  • dotnet test src\UniGetUI.Windows.slnx --verbosity q --nologo /p:Platform=x64 /m:1

Condition platform-specific Devolutions Avalonia theme packages so Windows builds no longer restore the macOS/Linux themes and their transitive controls dependency. Replace the small app-side Rx subscription usage with a local observer helper to avoid importing System.Reactive on Windows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant