Skip to content
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

Invalid CI packaging setup, race condition / missing multitarget matrix #250

Open
2 tasks
Arlodotexe opened this issue Jan 27, 2025 · 0 comments · May be fixed by #258
Open
2 tasks

Invalid CI packaging setup, race condition / missing multitarget matrix #250

Arlodotexe opened this issue Jan 27, 2025 · 0 comments · May be fixed by #258
Assignees
Labels
bug 🐛 Something isn't working

Comments

@Arlodotexe
Copy link
Member

Background

MultiTargets & WinUI support

The toolkit supports the following targets, each supporting a specific WinUI version:

MultiTarget WinUI
uwp 2
wasdk 3
wasm 2, 3
android 2, 3
ios 2, 3
macos 2, 3
linuxgtk 2, 3
wpf 2, 3
netstandard n/a

Intended Behaviors

Packaging should "just work" regardless of combination of supported targets, such as:

  • uwp
  • wasdk
  • netstandard
  • uwp,netstandard
  • wasdk,netstandard
  • uwp,wasdk
  • uwp,netstandard,wasdk

The CI currently builds WinUI 2 and 3 simultaneously, creating package variants for both:

  • CommunityToolkit.Uwp.* (uwp multitarget)
  • CommunityToolkit.WinUI.* (wasdk multitarget)

Problems

Some components support only one of uwp or wasdk, plus a non-winui target like netstandard, such as uwp,netstandard or wasdk,netstandard. This creates a race condition:

  1. Building wasdk first can produce a package with netstandard but without uwp.
  2. Building uwp first can produce a package with netstandard but without wasdk.

Further, packages with neither uwp nor wasdk (e.g. targeting netstandard only) won't be built via CI at all, since our "packaging step" only targets WinUI 2 and 3 with its matrix.

Solutions

One of the listed problems could be patched by deciding to build either UWP or WinUI first instead of doing it simultaneously, but there's a few reasons we don't. To understand why, consider:

  • A component supporting uwp,netstandard could be fixed by not allowing wasdk to build first.
  • A component supporting wasdk,netstandard could be fixed by not allowing uwp to build first.

Both cannot be done, meaning we must fix the issues with concurrent builds directly.

We'll need two things:

  • An added CI matrix for packaging netstandard-only components properly.
  • When building WinUI 2 or 3, skip unsupported components.
    • Skip building any component that targets only netstandard.
    • Skip building uwp,netstandard components if packaging for wasdk.
    • Don't skip building wasdk,netstandard components if packaging for wasdk.
    • Skip building wasdk,netstandard components if packaging for uwp.
    • Don't skip building uwp,netstandard components if packaging for uwp.

These can be split into two tickets, only the latter is high priority right now as it unblocks AppServices in Labs.

@Arlodotexe Arlodotexe added the bug 🐛 Something isn't working label Jan 27, 2025
@Arlodotexe Arlodotexe self-assigned this Jan 27, 2025
@Arlodotexe Arlodotexe changed the title Invalid CI packaging setup, race condition in multitarget matrix Invalid CI packaging setup, race condition / missing multitarget matrix Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
1 participant