Make the iOS target framework opt-in, and put macOS back in the test matrix - #349
Merged
Conversation
…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
|
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #327.
The cause
ImGui.App/ImGui.App.csprojwidened its target frameworks to includenet10.0-ioson any macOS host. Every test project referencesImGui.App, so every macOS cell of the test matrix tried to build the iOS head and failed withNETSDK1147before running a single test —dotnet workload install ioshappens inios.ymland 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
IncludeIosTargetsproperty, defaulting tofalse:ImGuiAppDemo.iOSandImGui.App.iOS.SmokeTesthad the same host-OS test and get the same gate, so they degrade to a plainnet10.0console exe on a macOS host that has not opted in — the behaviour they already had on Linux and Windows.ios.ymlopts in at job level on both of its jobs: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 restoretakes no-p:; and the smoke and demo builds reachImGui.Appthrough aProjectReference, where the flag has to propagate ornet10.0-ioswould silently resolveImGui.App'snet10.0head 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:neutralnow expands toubuntu-latest,windows-latest,macos-latest; amacosplatform maps tomacos-latest.Testing
dotnet build ImGui.sln— succeeded, 0 warnings, 0 errors.ImGui.App.Tests— 343 passed, 0 failed.dotnet msbuild -getProperty:TargetFrameworksreturnsnet10.0;net9.0;net8.0by default, and the job-level environment variable does arrive asIncludeIosTargets=true(the TFM list is unchanged on Linux because theIsOSPlatform('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.Analyzers2.28.0's Roslyn 5.9 requirement, so the builds above were run with that one analyzer package dropped (CSC : error CS9057otherwise); 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