Skip to content

Make the iOS target framework opt-in, and put macOS back in the test matrix - #349

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/github-issues-b0eba5
Sep 7, 2026
Merged

Make the iOS target framework opt-in, and put macOS back in the test matrix#349
matt-edmondson merged 2 commits into
mainfrom
claude/github-issues-b0eba5

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Closes #327.

The cause

ImGui.App/ImGui.App.csproj widened its target frameworks to include net10.0-ios on any macOS host. Every test project references ImGui.App, so every macOS cell of the test matrix tried to build the iOS head and failed with NETSDK1147 before running a single test — dotnet workload install ios happens in ios.yml and nowhere else. macOS was then excluded from the matrix, which left the symptom hidden rather than fixed.

The change — option 2 from the issue

The widening is gated behind a new IncludeIosTargets property, defaulting to false:

<IncludeIosTargets Condition="'$(IncludeIosTargets)' == ''">false</IncludeIosTargets>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(IncludeIosTargets)' == 'true' and $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios</TargetFrameworks>

ImGuiAppDemo.iOS and ImGui.App.iOS.SmokeTest had the same host-OS test and get the same gate, so they degrade to a plain net10.0 console exe on a macOS host that has not opted in — the behaviour they already had on Linux and Windows.

ios.yml opts in at job level on both of its jobs:

env:
  IncludeIosTargets: "true"

An environment variable rather than -p: on each step, for three reasons: MSBuild reads it as a property, so it reaches every invocation in the job; dotnet workload restore takes no -p:; and the smoke and demo builds reach ImGui.App through a ProjectReference, where the flag has to propagate or net10.0-ios would silently resolve ImGui.App's net10.0 head instead. A step added later inherits it rather than needing to remember it.

macOS returns to the matrix

That is the payoff, and without it nothing observable changes. In dotnet.yml:

  • neutral now expands to ubuntu-latest, windows-latest, macos-latest; a macos platform maps to macos-latest.
  • The discovery guard still stops the run on an unhandled platform, but its message no longer blames the matrix for an ios-tied project — the missing workload is the actual constraint, and the iOS workflow is where iOS builds belong.
  • The UI-suite exclusion now tests for Linux rather than against Windows. Those five suites are effectively the whole cost of the job (~18 min against ~34 s for everything else), and the rationale for pinning them to Linux was never Windows-specific. Testing for Linux means macOS gets the cheap treatment, and so does any platform added later. That matters: macOS runner minutes bill at roughly ten times Linux.
  • Two coverage comments updated, since they were written when the matrix had exactly two platforms.

Testing

  • dotnet build ImGui.slnsucceeded, 0 warnings, 0 errors.
  • ImGui.App.Tests343 passed, 0 failed.
  • Property evaluation checked directly: dotnet msbuild -getProperty:TargetFrameworks returns net10.0;net9.0;net8.0 by default, and the job-level environment variable does arrive as IncludeIosTargets=true (the TFM list is unchanged on Linux because the IsOSPlatform('OSX') half of the condition is false, which is the intended behaviour).

What this cannot verify from here: the gate's macOS branch, and whether the macOS cells now go green. This sandbox is Linux, and there is no macOS host to run against — the matrix cells on this PR are the first real test of both. The repo has never tested on macOS, so if something unrelated to the iOS workload is broken there, this PR is where it surfaces; I'll follow the CI here and fix what turns up.

Two smaller notes: the sandbox has .NET SDK 10.0.111 (Roslyn 5.0) against ktsu.Sdk.Analyzers 2.28.0's Roslyn 5.9 requirement, so the builds above were run with that one analyzer package dropped (CSC : error CS9057 otherwise); and this PR does not touch #324's repo rename, which is independent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N1cVfacJWw1uM42DUmPfUg


Generated by Claude Code

…trix [patch]

Closes #327.

`ImGui.App` widened its target frameworks to include `net10.0-ios` on any macOS
host. Every test project references it, so every macOS cell of the test matrix
tried to build the iOS head and failed with NETSDK1147 before running a single
test — the iOS workload is installed by `ios.yml` and by nothing else. That is
why 7 of 42 cells failed on the matrix's first run, all of them macOS, and why
macOS was then excluded.

This takes option 2 from the issue and fixes the cause rather than compensating
for it in CI. The widening is now gated behind `IncludeIosTargets`, which
defaults to false, so a macOS host builds exactly what Linux and Windows build.
The same gate replaces the host-OS test in `ImGuiAppDemo.iOS` and
`ImGui.App.iOS.SmokeTest`, which had the same shape.

`ios.yml` opts in at job level on both of its jobs. An environment variable is
the mechanism because MSBuild reads it as a property, so it reaches every
invocation in the job, including `dotnet workload restore` (which takes no
`-p:`) and the smoke and demo builds, which reach `ImGui.App` through a
ProjectReference and would otherwise have silently resolved its net10.0 head.

macOS returns to the test matrix: `neutral` now expands to Linux, Windows and
macOS, and a `macos` platform maps to `macos-latest`. The discovery guard still
stops the run on an unhandled platform; its message no longer blames the matrix
for an ios-tied project, since the workload is the actual constraint.

The UI-suite exclusion now tests for Linux rather than against Windows, so macOS
inherits the cheap treatment rather than the 18-minute one — which matters, as
macOS runner minutes bill at roughly ten times Linux.

Verified: solution builds clean, and `ImGui.App.Tests` passes 343/343. The
gate's macOS branch cannot be exercised from a Linux sandbox; property
evaluation was checked directly with `dotnet msbuild -getProperty`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1cVfacJWw1uM42DUmPfUg
The macOS test cell this PR re-enabled found a real platform difference:
`Keyboard_PressWithCtrl_ReportsTheModifier` failed on macOS only.

Dear ImGui defaults `ConfigMacOSXBehaviors` to true on Apple platforms, and one
of those behaviours swaps Ctrl and Super so Cmd drives shortcuts. The harness
injects `ImGuiKey.ModCtrl`, which therefore reaches the application as
`KeySuper` on macOS and `KeyCtrl` everywhere else, so the same assertion means
different things depending on the host.

Reproduced on Linux by setting the flag by hand: `ctrl=False super=True`, the
exact shape of the macOS failure. Clearing it again in the same session restored
`ctrl=True`, which confirms the flag is read per frame and that setting it in
`Start` takes effect on a macOS runner.

The harness exists to inject input deterministically, so it now pins the
behaviour off before the first frame and Ctrl means Ctrl on every platform. A
test that wants the macOS mapping can set the flag itself.

Adds `Keyboard_PressWithCtrl_DoesNotArriveAsSuper`, which fails if the swap ever
comes back — on any platform, not just the one that has it by default.

ImGui.App.Testing.Tests: 82 passed. Solution builds clean in Release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1cVfacJWw1uM42DUmPfUg
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

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.

CI: macOS test cells fail on the iOS workload

2 participants