Repository navigation
Don't set UseInterpreter for iOS or Mac Catalyst. - #39032
Conversation
…otnet#37674) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Detail On Mac Catalyst, VoiceOver announces selectable task items in a CollectionView only by name, without an actionable role. Although users can activate the item with Control + Option + Space, they are not informed that it is interactive. VoiceOver should announce an appropriate role, such as “button,” for selectable items. ### Root Cause - On iOS/MacCatalyst, VoiceOver announced only a CollectionView item's text and did not announce its role/interactivity (for example, "Button"), even when SelectionMode made the item selectable. - UpdateAccessibilityTraits unconditionally applied UIAccessibilityTrait.Button to the cell's first templated child view. When that child was a non-accessible container, such as a Grid or Border wrapping a Label, the trait was applied to a view that VoiceOver did not use as the accessibility element. - The nested descendant that was actually exposed to VoiceOver (IsAccessibilityElement == true) never received the trait, so VoiceOver announced only the item's text without indicating that it was selectable/interactable. ### Description of Change - The fix changes the trait assignment to recursively search the first templated child’s view hierarchy for the first view with IsAccessibilityElement == true. The UIAccessibilityTrait.Button trait is then applied directly to that accessibility element. - The search intentionally does not descend into UIControl subtrees. This preserves the native accessibility roles of controls such as UIButton, UITextField, and UISwitch, rather than overriding their existing accessibility behavior. - For selectable items, the button trait is added to the discovered accessibility element. When SelectionMode.None is used, the trait is removed. - This ensures that the trait is applied to the same native view that VoiceOver uses as the accessibility target. Consequently, VoiceOver correctly announces both the item's content and its interactive role, for example, “Survey Employees, Button.” ### Validated the behaviour in the following platforms - [ ] Android - [ ] Windows - [ ] iOS - [x] Mac ### Issues Fixed: Fixes dotnet#37140 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/9b00bcc3-bb31-49f6-9f97-1fd0f3891d5a"> | <video src="https://github.com/user-attachments/assets/93426da3-564b-46dd-b5f8-60adfedb195d"> |
Setting UseInterpreter=true for iOS or Mac Catalyst raises a warning in .NET 11: > The property 'UseInterpreter' has no effect when not using the Mono runtime (for instance when using CoreCLR). so don't set UseInterpreter for iOS or Mac Catalyst (as the warning says, it has no effect).
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39032Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39032" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The unconditional removal regresses interpreter and Hot Reload behavior for supported pre-.NET 11 iOS and Mac Catalyst targets.
Review effort: Balanced
Findings: 1
What changed in this PR
Removes automatic UseInterpreter configuration for iOS and Mac Catalyst to avoid .NET 11 CoreCLR warnings.
Changes:
- Limits the Debug interpreter default to Android, Windows, and Tizen.
- However, this also removes the required Mono default from pre-.NET 11 Apple TFMs.
| File | Description |
|---|---|
Microsoft.Maui.Controls.Common.targets |
Removes iOS and Mac Catalyst from the UseInterpreter condition. |
|
Should this be net11 only? |
kubaflo
left a comment
There was a problem hiding this comment.
Should this be net11 only?
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Note 🔍
|
Yes, .NET 11 only. I've updated the PR to fix this. |
| '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' or | ||
| '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'tizen')">True</UseInterpreter> | ||
| <UseInterpreter Condition="'$(UseInterpreter)' == '' and '$(Configuration)' == 'Debug' and | ||
| $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), 11.0)) and |
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Note 🔍
|
AI Review Summary
🗂️ Review Sessions — click to expand🚦 Gate — Test Before & After FixGate Result:
|
…on (refs #39223) (#39242) > [!WARNING] > **Threat Detection Engine Failure** — The analysis engine could not complete. This is a tooling failure, not a security finding. > <!-- gh-aw-threat-engine-error --> > > <details> > <summary>What happened</summary> > > The threat detection results could not be parsed. > > Review the [workflow run logs](https://github.com/dotnet/maui/actions/runs/37711508022) for details. > </details> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! Workflow artifact: ci-fix Artifact kind: help Refs: #39223 Target branch: net11.0 Attempt: 1/10 ## Attempt 1 of 10 Derive the interpreter version check from the target framework and evaluate it only for Apple target frameworks. ### Previous attempts (prior commits on this PR) None; this is the first attempt for this tracking issue. This attempt differs by: correcting the evaluation inputs and condition ordering, rather than reverting the .NET 11 interpreter policy or merely suppressing evaluation when an SDK property is missing. ## Root cause `src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets` is copied into `.buildtasks` and imported by consumers. Its Debug interpreter condition calls `VersionLessThan` on `TargetFrameworkVersion` before checking the platform. That property can still be empty during import, including cross-targeting evaluation. The latest completed `maui-pr` build, 1626245, fails on both Windows and macOS with `MSB4184` evaluating `VersionLessThan('', 11.0)`. The condition was introduced by #39032. Importing the unchanged target into an SDK-free MSBuild project reproduces the same diagnostic locally. ## Fix Check for iOS or Mac Catalyst before performing the version comparison, and obtain the framework version directly from `TargetFramework` with MSBuild's `GetTargetFrameworkVersion`. This preserves automatic interpreter selection for pre-.NET 11 Apple Debug targets, leaves .NET 11 Apple targets unchanged, preserves explicit `UseInterpreter` values, and leaves the existing Android/Windows/Tizen Mono condition untouched. Empty outer-build target frameworks do not enter the Apple version comparison. No test, assertion, timeout, exclusion, analyzer setting, or public API is changed. ## What is unverified / where I need help - The affected project could not build locally because the required Arcade SDK package could not be downloaded under the runner's network restrictions. The runner has .NET 10 SDKs, not the repository's requested .NET 11 SDK. - Solution formatting was attempted with `--no-restore` but did not complete within the bounded wait and was canceled. This patch changes only an MSBuild condition, not C# formatting. - Please confirm the automatically queued `maui-pr` Windows and macOS builds clear MSB4184 and preserve the intended interpreter defaults in real SDK imports. ## Validation - Command: `pwsh /tmp/gh-aw/agent/validate-controls.ps1` - Result: passed 19 isolated MSBuild evaluation cases against the actual changed target using the installed .NET 10 SDK. Cases cover empty outer-build TFM, .NET 9/10/11 Apple TFMs (including platform versions), non-Apple TFMs, Mono defaults, Release configuration, explicit interpreter values, and populated or empty `TargetFrameworkVersion`. - Baseline command: `dotnet msbuild eval-controls.proj -t:Validate -p:TargetFramework=net11.0-ios -p:ExpectedUseInterpreter= -v:minimal -nologo`, from the temporary validation directory. The unchanged target fails with the original MSB4184 diagnostic. - Command: `dotnet build src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj --no-restore -v:minimal -nologo` - Result: not validated; blocked before compilation by Arcade SDK resolution (MSB4236). - Command: `git diff --check` - Result: passed. ## Evidence - Original failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626241 - Latest verified-failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626245 - Latest Windows build log: https://dev.azure.com/dnceng-public/public/_apis/build/builds/1626245/logs/114?api-version=7.1 - Latest macOS build log: https://dev.azure.com/dnceng-public/public/_apis/build/builds/1626245/logs/179?api-version=7.1 --- Filed by [`ci-status-fix-net11`](https://github.com/dotnet/maui/blob/main/.github/workflows/ci-status-fix-net11.md). This is the single PR for #39223: the workflow watches its own CI and pushes up to **10 attempts on this same PR** (it never opens a second PR). It advances only when the fix's own build settles red and that red is caused by the fix. Comments, reviews, and commits do not transfer ownership; the loop remains autonomous until this PR is closed. Eligible `CHANGES_REQUESTED` reviews are handled through Track C. After 10 attempts it stops and defers to humans. The trusted CI-fix validator automatically queues maui-pr, uitests, and devicetests for every new PR head. > [!WARNING] > <details> > <summary>Firewall blocked 2 domains</summary> > > The following domains were blocked by the firewall during workflow execution: > > - `ajhvsblobprodcus363.vsblob.vsassets.io` > - `dc.services.visualstudio.com` > > To allow these domains, add them to the `network.allowed` list in your workflow frontmatter: > > ```yaml > network: > allowed: > - defaults > - "ajhvsblobprodcus363.vsblob.vsassets.io" > - "dc.services.visualstudio.com" > ``` > > See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information. > > </details> > Generated by [CI Failure Fixer (net11.0)](https://github.com/dotnet/maui/actions/runs/37711508022) · ⊞ 29.2K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+ci-status-fix-net11%22&type=pullrequests) <!-- gh-aw-agentic-workflow: CI Failure Fixer (net11.0), engine: copilot, model: gpt-6.1-sol, id: 37711508022, workflow_id: ci-status-fix-net11, run: https://github.com/dotnet/maui/actions/runs/37711508022 --> <!-- gh-aw-workflow-id: ci-status-fix-net11 --> <!-- gh-aw-workflow-call-id: dotnet/maui/ci-status-fix-net11 --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>


Description of Change
Setting UseInterpreter=true for iOS or Mac Catalyst raises a warning in .NET 11:
so don't set UseInterpreter for iOS or Mac Catalyst (as the warning says, it has no effect) when running on .NET 11+.