Skip to content

[net11] Forward-port CI provisioning and raster cleanup fixes - #38806

Merged
kubaflo merged 2 commits into
net11.0from
kubaflo-net11-ci-fixes
Sep 23, 2026
Merged

kubaflo merged 2 commits into
net11.0from
kubaflo-net11-ci-fixes

Conversation

@kubaflo

@kubaflo kubaflo commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

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 from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Forward-port the applicable fixes from #38788 (source head 7c8e9a5d710c2552ed3901caed84bfd87cfcb47f) to net11.0, based on 9c0b29fed261f87ea77b84268768ac9e3d453609. This is a separate, adapted port, not a merge of the RC2 branch. The original RC2 PR remains open and unchanged.

Ported

  • Fail explicitly when the required Xcode is absent instead of silently choosing an unrelated installed version.
  • Request ARM64 simulator runtimes on Apple Silicon and retain universal downloads on Intel. Keep initial and recovery downloads pinned to the selected Xcode version.
  • Detect unavailable runtime downloads before destructive CoreSimulator recovery, even when Xcode returns exit code 70. Preserve recovery for actual simulator connection failures.
  • Run the Helix monitor in the authorized submission pool while preserving its public/internal Linux image demands.
  • Reuse BaseTest's existing bounded, logged cleanup retries for raster fixtures and dispose every raster tool deterministically. Preserve all 23 test cases and their assertions; exhausted cleanup retries still fail.
  • Port CI troubleshooting documentation and regression coverage. Adapt SDK/TFM alignment checks to the actual selected versions and exercise both 26.5 and 27.0 simulator-download scenarios.
  • Wire eng/pipelines/ci.Tests.ps1 into the existing GitHub Pester gate, including path triggers for its coupled inputs. Preserve read-only pull_request execution and disabled checkout credential persistence. This wiring was missing from the source PR.

Target-specific adaptations and omissions

Source change net11.0 decision
Coordinated SkiaSharp/HarfBuzz/SVG/ExCSS/System.Memory/System.Buffers pins Already present unchanged, including SkiaSharp 4.150.1, HarfBuzzSharp 14.2.1.1 and Svg.Skia 5.1.1.
SDK bootstrap/provisioning/provenance update Already aligned at 11.0.100-rc.2.26470.103; preserve these and the target's newer product/Arcade dependencies. Retain a version-independent alignment assertion rather than the Apple-27-only minimum-runtime assertion.
Apple 27 TFMs and raised native/managed iOS minimums Not applicable: this target uses Apple 26.5.12253-net11-rc.2. Preserve 26.5 TFMs, existing deployment minimums, and previous-.NET compatibility targets. Omit the Xcode-27-only deployment-minimum test.
RC2 .NET 10 Apple compatibility feed Not copied: net11.0 uses compatibility packs 26.5.10320, not RC2's 26.5.10322; preserve the target's existing feeds.
Switch public macOS jobs to MAUI Xcode 27 RC agents Not applicable: retain Aces/Xcode 26.5. Baseline build 1607497 logs 14 and 577 confirm successful selection of /Applications/Xcode_26.5.app for build and iOS integration jobs. Do not transplant the RC2 pool assertion.

No Provisionator enablement, SDK/TFM downgrades, test skips, weakened assertions, warning suppression, pool-permission changes, or shared-capacity changes.

Validation on this forward port

  • Pester 5.9.0: 104 passed, zero failed/skipped, across eng/pipelines/ci.Tests.ps1 and .github/scripts/Review-PR.Tests.ps1, including after the workflow wiring update.
  • The same tests against an isolated copy of the unchanged target baseline produced 11 expected regression failures and 93 passes; all 104 pass with this port.
  • Resizetizer raster tests: 23 passed in Debug and 23 passed in Release, zero failures/skips, on macOS with locally installed SDK 11.0.100-preview.6.26359.118, targeting net11.0. These runs do not substitute for Windows Helix validation or the pinned RC2 CI SDK.
  • Both changed YAML templates parse; all 12 embedded Bash/script blocks pass bash -n. Scoped C# whitespace formatting and git diff --check pass.
  • Pester workflow parsing verifies the new suite and all input path triggers, with its read-only PR isolation intact.
  • SDK/dependency/feed/TFM/native project files and ci.yml are unchanged from the target baseline.

New-PR CI results are pending. The green RC2 source build is not claimed as validation of this PR. Full Windows/macOS build, packaging, and device/integration execution remain for this PR's CI.

Port the branch-independent fixes from #38788 while preserving net11's Apple 26.5 configuration and existing dependency pins.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 23, 2026 10:45
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38806

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38806"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

/azp run maui-pr

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@github-actions github-actions Bot added area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions platform/ios platform/macos macOS / Mac Catalyst labels Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The workflow omits eng/pipelines/ci.yml from its coverage, and provisioning still permits a major-only Xcode fallback.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Forward-ports CI provisioning, Helix monitoring, raster cleanup, regression coverage, and troubleshooting updates to net11.0.

Changes:

  • Adds version- and architecture-aware simulator provisioning.
  • Improves raster cleanup and deterministic resource disposal.
  • Adds CI regression tests and workflow integration.
  • Updates Helix pool selection and troubleshooting documentation.
File Summary
src/​SingleProject/​Resizetizer/​test/​UnitTests/​SkiaSharpRasterToolsTests.cs Improves raster cleanup and disposal.
eng/​pipelines/​common/​provision.yml Updates Xcode and simulator provisioning.
eng/​pipelines/​ci.Tests.ps1 Adds CI provisioning regression tests.
eng/​pipelines/​arcade/​stage-helix-tests.yml Updates Helix monitor pool selection.
.github/​workflows/​powershell-script-tests.yml Wires Pester tests and workflow triggers.
.github/​scripts/​Review-PR.Tests.ps1 Adds simulator provisioning coverage.
.github/​docs/​maui-ci-facts.md Adds CI troubleshooting guidance.

Comment on lines +172 to +175
echo "##vso[task.logissue type=error]Required Xcode ${ORIGINAL_VERSION} is not installed on this agent. Update the macOS agent image before building with the pinned Apple SDK."
echo "Tried: ${VERSIONS_TO_TRY[*]}"
echo "Falling back to latest available Xcode on this agent..."
# Find the latest Xcode by sorting version numbers
LATEST_XCODE=$(ls -1d /Applications/Xcode_*.app 2>/dev/null | sed 's|/Applications/Xcode_||;s|\.app||' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)
if [[ -n "$LATEST_XCODE" ]]; then
XCODE_VERSION="$LATEST_XCODE"
XCODE_PATH="/Applications/Xcode_${LATEST_XCODE}.app"
echo "Using latest available Xcode: ${XCODE_VERSION} at ${XCODE_PATH}"
else
echo "ERROR: No Xcode installations found in /Applications"
exit 1
fi
echo "Installed Xcode versions: ${XCODE_LIST[*]}"
exit 1
@kubaflo

kubaflo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@kubaflo
kubaflo merged commit 7ca71f4 into net11.0 Sep 23, 2026
34 of 38 checks passed
@kubaflo
kubaflo deleted the kubaflo-net11-ci-fixes branch September 23, 2026 16:12
@github-actions github-actions Bot added this to the .NET 11.0-rc2 milestone Sep 23, 2026
kubaflo added a commit that referenced this pull request Sep 25, 2026
<!-- 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!

### Description of Change

Fix the missing Helix unit-test fixture and the independent device-test
failures uncovered while validating this PR on `net11.0`.

#### Helix correlation payload

The Aspire feature-switch tests added by #38616 import
`src/Core/src/nuget/buildTransitive/Microsoft.Maui.Core.Before.targets`,
but `PrepareMauiHelixPayload` did not stage that file. Both test methods
fail before their assertions run: three cases of
`MauiAspireFeatureSwitchMatchesOptimization` and two cases of
`ExplicitMauiAspireFeatureSwitchWarnsInOptimizedBuild`, in Windows/macOS
Debug and Release.

- Copy the required Core targets file into the existing source
correlation payload, preserving its source-relative path.
- Add Pester regression coverage that executes the actual staging target
in an isolated temporary directory, checks the correlation payload
destination, and compares staged file hashes with their sources.
- Add `eng/helix.proj` to the existing PowerShell test workflow's path
triggers.

#### Device-test trimming and synchronization

- Move the handler constructor API-shape check from trimmed device
applications to untrimmed Core unit tests. Unused constructor overloads
may legitimately disappear from a deployed application. The new theory
checks public concrete Core view handlers, excluding
`SwipeItemViewHandler`, whose mapper constructors are intentionally
protected.
- Preserve the `AbsoluteLayout` parameterless constructor used
indirectly by `HandlerDoesNotLeak`. The CI-linked Mono assembly
contained the type but no constructor, so the test failed before its
leak assertions.
- Preserve the protected `RequestManager.Glide` property used by
`GlideStaticEqualsGlideGet`, look it up on its declaring type, and
assert that reflection found it before invoking it. The CI APK had
trimmed the property. The singleton comparison is unchanged.
- Wait for the iOS flyout header to reach its minimum height using the
bounded `AssertEventually` helper. The previous assertion assumed UIKit
completed the header layout within the scroll helper's 10 ms delay. The
expected height (100 px) and tolerance (0.3 px) are unchanged; no
product layout code changes.
- Declare the existing Windows
`MapHandler.DisconnectHandler(FrameworkElement)` override in
`PublicAPI.Unshipped.txt`. While this PR was being validated, #38844
restored the Windows map implementation on `net11.0` but omitted that
declaration, causing RS0016 in both target-branch build 1611088 and this
PR's build 1611131. The updated base is incorporated by a normal merge,
and **both Windows map lifecycle tests remain enabled**. The earlier
temporary skips have been removed.
- Wait for the native Windows Map's embedded document to create its
layers and pin before the lifecycle tests close their temporary window.
The exact crash dump identifies `MapControl::OnLayerAdded` awaiting
`addSymbolLayer()` after `InitializeWebMap`; `NavigationCompleted` fires
before those continuations finish. The bounded waits observe local
script state, not authenticated map tiles, and preserve the existing
native-layer ownership assertions.

#### Android intent isolation and Windows execution reporting

- Scope Android explicit-component navigation fixtures to the test
package and a custom, unhandled action. After production correctly
removes the explicit component, the old broad implicit intent could open
the system resolver or Google Backup settings and leave the test
activity stopped. Subsequent layout and lifecycle-bound back-callback
tests then failed. Preserve the explicit-target launch monitor and
assert that the original `ComponentActivity` is `RESUMED` before and
after navigation, on the UI thread. Do not use `HasWindowFocus` as a
lifecycle check: system overlays can take focus without pausing the
activity.
- Select Windows MSIX dependencies by their actual `Dependencies/x64`
directory rather than matching `x64` anywhere in the full path. The
parent package directory already contains `x64`, so the old filter also
selected arm64, win32, and x86 dependencies. Install the app with the
selected dependency paths and emit deployment logs on failure.
- Fail Windows work items for abnormal packaged/unpackaged process exits
or empty/malformed xUnit files. The old Map category crashed with an
empty XML file, but the runner ignored it and reported a false green.
Valid category results are still merged and uploaded; ordinary WinUI
exit codes `0` and `-1` remain supported.
- Retain the packaged process handle before waiting and read its exit
code through the explicit getter, then dispose the handle. On Windows
PowerShell's .NET Framework, `WaitForExit` alone does not retain the
handle that `ExitCode` requires. The initial reporting change therefore
read an empty property and incorrectly failed otherwise passing packaged
suites. Unreadable exit codes still fail explicitly rather than being
treated as success.

The final diff introduces **no test skips or product behavior changes**.
Trimming remains enabled; only the exact indirectly used members are
rooted. The Windows API entry records an implementation already present
on the target branch rather than introducing a new API. No new pipeline
tests were added for these follow-ups; runner changes use syntax checks
and actual CI.

### Issues Fixed

Resolves the Helix payload failure observed on #38806 in [build
1608731](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1608731).
The same missing-file failures occur on the `net11.0` baseline in [build
1607883](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1607883).

Also addresses the independent failures in this PR's [device build
1609895](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1609895),
which also affected target-branch [build
1609516](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1609516).
The recurring Glide failure is tracked in #38240.

The subsequent Windows compile error is reproduced in target-branch
[build
1611088](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611088)
and PR [build
1611131](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611131).
Android isolation, Windows execution-reporting problems, and the native
Map initialization race were uncovered in [device build
1611162](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611162).

### Validation

- Original staging regression failed before the payload fix; all **109**
Pester tests passed afterward. Debug and Release staging produced
byte-identical Core targets files.
- Main [build
1609883](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1609883)
succeeded. Actual XAML results confirmed all **20 affected executions**
passed across Windows/macOS and Debug/Release.
- Pinned RC2 SDK: **41 focused Core unit tests passed**, including the
migrated constructor contracts. Earlier main build 1611161 also confirms
all **32 constructor theory cases** in the inspected macOS unit leg.
- Android 13, CoreCLR Release with partial trimming: **49 image-source
tests passed**, including `GlideStaticEqualsGlideGet`. Linked metadata
confirms the protected property/getter is preserved. Device build
1611162 confirms the Glide case passes on **both Mono and CoreCLR**.
- iOS 18.5, Mono Release with partial trimming: the exact CI app and the
pre-change local app reproduced collapsed-header failures. With the
condition-based assertion, **442 Shell tests passed in each of three
consecutive local runs**. Device build 1611162 confirms **442/442 Shell
cases on each of Mono and CoreCLR iOS 18**, including all flyout-header
cases.
- The same trimmed local iOS app passed **190 memory tests**, with 3
existing skips. All inherited `AbsoluteLayout` leak cases passed; linked
metadata confirms the constructor is preserved. Device build 1611162
also confirms all three inherited cases in Mono iOS general tests.
- The earlier Android window-focus guard failed both old broad-intent
cases. With the isolated fixtures, the complete Release Mono API 33
Blazor suite passed **62 tests with 4 existing skips**, including all
seven cases that failed in CI. The subsequent lifecycle-check correction
and its additional positive/negative evidence are described below.
- Windows [device build
1611496](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611496),
Helix job `073cf090-5d99-4ee4-acf8-afaf7066d8bb`, confirms **both Map
facts pass in both packaged and unpackaged execution**: 2/2 in each
mode, no skips. The disconnect test takes 1.89s/2.01s and the
remove/re-add test 2.31s/2.46s. All five unpackaged applications pass.
- The same Windows run successfully installs and executes all five
packaged applications. Complete result XML contains **3,249 passed, 160
existing skips, zero failed tests, and zero errors**. The packaged work
items were incorrectly red only because the launcher could not read
`ExitCode`; commit `8768da7c59` fixes the retained-handle requirement.
- Packaged runner and embedded PowerShell syntax checks pass. Changed C#
files are formatted; `git diff --check` passes. The Map follow-up also
compiles against the 245 managed assemblies extracted from the exact
failing CI payload.
- Before the latest push, [device build
1611589](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611589),
head `8768da7c59`, produced **42 complete Apple XML files**, correlated
through its own submission logs and fully audited: **26,480 passed, 720
existing skips, zero failures/errors**, across Mono/CoreCLR iOS 18/26
and CoreCLR Mac 15/26.
- All **10 Android XML files** from that run were also correlated and
audited. Core, Controls, Essentials and Graphics passed on both
runtimes. Blazor Mono was **62 passed, 4 skipped**. Blazor CoreCLR was
**60 passed, 2 failed, 4 skipped**: only the old window-focus guards
failed; all seven original cascading cases passed.
- Commit `065fe7c97a` replaces those false-positive guards with
lifecycle assertions. Opening the notification shade locally reproduces
exactly the two old failures: the activity lacks window focus but
remains `RESUMED` before and after navigation. With the correction, the
complete Release API 33 suite passes with the shade open on **both Mono
and CoreCLR: 62 passed, 4 existing skips each**. A separate controlled
run opens Settings only after the navigation request; the corrected
guard rejects real backgrounding (`RESUMED` expected, `CREATED` actual),
and all seven original cascading failures return. A final normal CoreCLR
run again passes **62 tests with 4 existing skips**.
- Current-head [device build
1611714](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611714),
own submission log 149, confirms Windows job
`f6501433-8b24-401b-ae86-311a339062ab`: **all ten real
packaged/unpackaged application work items passed**. All ten complete
XML files total **6,498 passed, 320 existing skips, zero
failures/errors** (3,249 passed/160 skipped per mode). Both Map facts
pass in each mode. All **52 packaged process launches** correctly report
native exit code `-1` and launcher exit code `0`, providing runtime
proof of the retained-handle correction.
- The same current-head build's full Apple matrix also passed: **42
complete XML files, 26,480 passed, 720 existing skips, zero
failures/errors**. All six jobs are correlated through this build's own
submission logs 125, 133 and 141.
- Current-head Android CI also passes on **both Mono and CoreCLR**. Each
full Blazor suite is **62 passed, 4 existing skips**, including both
formerly failing explicit-component theory rows and all seven original
cascading cases. All ten Android result files are complete and total
**9,238 passed, 176 existing skips, zero failures/errors**, correlated
through this build's own submission logs 157 and 165.

**Device verification complete:** [Device build
1611714](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611714)
succeeded on published head `065fe7c97a` at 2026-09-25 03:25:54 UTC. All
**62 real work items** across nine Helix jobs passed. All **62 complete
XML files** were audited: **42,216 passed, 1,216 existing skips, zero
failures and zero assembly errors**. Counts are test executions across
lanes, not unique tests. The successful run was requested in [comment
5825614265](#38827 (comment)).

**Main verification complete:** [Main build
1611713](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1611713)
succeeded on the same published head at 2026-09-25 04:47:55 UTC. All
four platform/configuration build legs and the integration matrix
passed. Its four unit-test Helix jobs are correlated through own
submission logs 200 and 208; all **44 real test work items** and four
controllers passed. The final Windows Build integration leg reports
**108 passed, 2 existing skips, zero failures**. The PowerShell Script
Tests workflow, Build Analysis and Build Insights also succeeded. Both
pipelines are now verified green; no further rerun is needed on this
unchanged head.

The previous run's ten Windows work items remained unstarted for more
than 90 minutes and were canceled after the push; their artificial
`-1234` results are not application crashes or test execution. All
completed results were preserved before publishing the Android
correction. The replacement run above now provides actual Windows proof;
no queue outage is claimed for the earlier wait.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Oct 9, 2026
<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Intentionally targets **net11.0**, based on
`8d04ca676fc51a8f940f65dfbec9a8085fa13615`, rather than main or RC2.
Ports the Apple-specific Xcode 27 adoption from `release/11.0.1xx-rc2`
without changing net11's SDK, runtime, Android, Extensions, or Arcade
pins.

- Pin all four .NET 11 Apple SDKs to **27.0.12211-net11-rc.2** from
macios commit `35d8bf5a42cd71edf4e2700b1e45f6c4b65f3fbe` (BAR 334217,
RC2 channel), and update current/default iOS, tvOS, Mac Catalyst and
macOS platform TFMs to 27.0.
- Align the .NET 10 Apple compatibility SDKs to **26.5.10322**, required
by all four selected .NET 11 workload manifests; update their
coherent-parent names and public feed. This is required manifest
alignment, not an unrelated .NET 10 upgrade.
- Raise managed and native iOS deployment minimums to **15.0**. Native
iOS 12 / Catalyst's mapped macOS 10.15 targets are rejected by Xcode 27.
The managed Catalyst minimum remains 17.0; templates already use iOS 15
/ Catalyst 17.
- Select **GoldenGate / Xcode 27** for public and internal Apple
framework, pack, integration, UI-app, device-app and official
compilation. Continue executing prebuilt iOS UI-test apps on **Tahoe /
Xcode 26.5**, and Catalyst UI tests on **macOS 14**.
- Remove the obsolete repository-wide Xcode 26.2/26.3 validation bypass
and unconditional `eng/Build.props` overrides. Normal builds now let the
workload validate Xcode; explicit test/review-runner overrides remain
available.
- Document build requirements and remaining image limitations in
`docs/DevelopmentTips.md`.

**Evidence and retained workarounds**

The RC2 adoption/CI changes are in #38787, #38788, #38853, #38855 and
#38892. #38806 deliberately omitted Apple 27 / minimum-version / pool
changes when forward-porting to net11; this supplies that missing Apple
configuration. Icon Composer changes from #38984 are already on net11
and are not duplicated.

- Keep the GoldenGate compilation fallback: standard Azure hosted macOS
26 currently provides only Xcode 26.0–26.6. The Xcode 27 preview pool is
not a proven standard Azure-hosted replacement; no paid pool is
introduced. [Azure image
availability](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops),
[Xcode 27 image
discussion](actions/runner-images#14404 (comment)).
- Keep the Appium build/execution split: GoldenGate previously lacked
the required iOS 18.5 runtime / usable Simulator UI and failed Mac2
startup; corrected RC2 build 1611447 passed all 29 iOS jobs. Current RC2
UI failures occur during package restore and do not establish that
GoldenGate UI execution is fixed. macOS 14 retires November 2, 2026; its
replacement requires separate Mac2 validation.
- Keep simulator provisioning, architecture-specific downloads, bounded
recovery and explicit failure when required Xcode is missing. Do not
copy #38852's unmerged `skipXcode: true` shortcut.
- **Do not port** GoldenGate's prerelease selected-Xcode fast path: [RC2
build
1623906](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1623906),
at RC2 HEAD `d32b79928709cf53b671336dabd0caef5a679fc2`, succeeded with
`/Applications/Xcode_27.app`, which the existing named fallback already
finds. This is source-configuration evidence, not validation of this PR.
- Do not copy later RC2 internal-SDK credentials, public-SDK fallbacks,
or internal feeds. They address different SDK/runtime pins. Retain
existing `TargetsCurrent`, local runner overrides and PowerShell
startup/recovery safeguards because Xcode 27 does not prove their
underlying issues resolved. The dedicated Copilot-review pipeline
retains its own older-branch overrides; it is not the standard net11
build lane.

**Validation**

- `.dotnet/dotnet build Microsoft.Maui.BuildTasks.slnf -c Release
-p:BuildTaskOnlyBuild=true -p:CI=true --verbosity quiet` — **passed**, 0
warnings / 0 errors, using the unchanged pinned SDK
`11.0.100-rtm.26480.113` in this worktree. This validates build
prerequisites, not Apple 27 app compilation.
- `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild
-project
src/Core/AppleNative/PlatformInterop/MauiPlatformInterop.xcodeproj
-scheme MauiPlatformInterop -configuration Release -sdk iphonesimulator
-destination 'generic/platform=iOS Simulator' -derivedDataPath
artifacts/native-validation CODE_SIGNING_ALLOWED=NO build` — **passed**,
arm64 and x86_64 simulator framework compilation at iOS 15.0, using
installed **Xcode 26.6**, not Xcode 27. No simulator/app/test runner was
launched.
- `plutil -lint
src/Core/AppleNative/PlatformInterop/MauiPlatformInterop.xcodeproj/project.pbxproj`
and `git diff --check` — **passed**. Python `yaml.safe_load` / XML
parsing — **passed** for all changed pipeline and XML configuration
files. No pipeline tests were added.
- `.dotnet/dotnet msbuild Directory.Build.props -nologo
-getProperty:MauiPlatforms,MauiGraphicsPlatforms,IosTargetFrameworkVersionSdkDefault,MacCatalystTargetFrameworkVersionSdkDefault,ValidateXcodeVersion,TargetsCurrent`
— **passed**; current Apple TFMs resolve to 27.0 and the blanket
validation bypass is absent. Evaluating `eng/Versions.props` confirms
unchanged SDK/runtime/Android pins and all four Apple 27 pins.
- Downloaded and inspected all four exact Apple workload manifest
packages from the public dotnet11 feed — **passed**, confirming the .NET
10 compatibility SDK requirement is 26.5.10322.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822` — attempted but **incomplete**: missing
restored references/workloads. Stopped it and removed its unrelated
generated formatting edits; no C# source changes are included.
- Initial unrestricted build-task attempts were blocked by missing
assets / Apple workloads. Repository bootstrap installed the exact
pinned SDK; full workload provisioning was stopped in favor of the
successful CI build-task-only command above.

Remote CI results for commit `e7a941cd121fff58bcd30892bbcf29e18882ac55`
(checked October 8, 2026):

- [maui-pr
1628491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628491)
— **completed, failed overall**. Apple compilation, macOS pack and main
integration validation passed; the macOS build selected
`/Applications/Xcode_27.app`. The only failing main-pipeline task was
the Helix monitor: Windows Debug
`SkiaSharpSvgToolsTests.Resize.BasicNoScaleReturnsOriginalSize` failed
deleting a locked temporary file in `Resize.Dispose()`. This is a
**confirmed identical historical cleanup failure predating this PR**,
not evidence of an Xcode-adoption regression: September 29 [build
1616449](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1616449),
the **net11.0-targeted #38984 merge build** (`refs/pull/38984/merge`,
not a direct `refs/heads/net11.0` baseline run), failed the same test in
Windows Release with the same `IOException` and `FileSystem.DeleteFile`
→ `Resize.Dispose()` line-25 stack; only the temporary filename differs.
See its actual [Helix
console](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-maui-refs-pull-38984-merge-c211216b883342c6ae/Microsoft.Maui.Resizetizer.UnitTests.dll/1/console.30a6023e.log?helixlogtype=result)
and [test-result
XML](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-maui-refs-pull-38984-merge-c211216b883342c6ae/Microsoft.Maui.Resizetizer.UnitTests.dll/1/testResults.xml?helixlogtype=result).
The fixture is byte-identical between exact base `8d04ca676f` and PR
head `e7a941cd12` (blob `a41ebe6e87b3809f952b51f98e594bf5faf2fe25`);
Skia/runtime pins and Windows execution pools are unchanged, and the
relevant configuration changes are Apple-specific. Together, this
supports **no causal link to Xcode adoption**. The latest exact-base
[net11.0 build
1628290](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628290)
passed; that does not negate the verified earlier occurrence. No cleanup
fix or rerun is included.
- [maui-pr-devicetests
1628492](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628492)
— **completed, succeeded**, including Mono/CoreCLR device-app
compilation. Cross-checked all nine Helix jobs: 71 terminal work items,
zero failing exits and no work items still running; this is a work-item
count, not a test-case count.
- [maui-pr-uitests
1628493](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628493)
— **completed, failed overall** at 21:42 UTC. UI-app compilation and the
complete **iOS CoreCLR UI stage passed**. The five failed/canceled
execution legs are MacCatalyst Layout, Navigation and Shell; Windows
Shell; and Android SafeAreaEdges. MacCatalyst Shell was canceled after
three hours during its retry, so its complete execution coverage remains
**unverified**, not passed.
- **Baseline-matched UI failures:** MacCatalyst `Issue59172RecoveryTest`
timeout matches [net11.0 build
1625634](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1625634).
MacCatalyst `ValidateBackgroundColorDoesNotAffectInputTransparent`
timeout matches the exact-base [net11.0 build
1628291](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628291),
test run 45168562. MacCatalyst Shell
`SearchHandlerQueryIconUpdatesAtRuntime` (0.51% screenshot difference)
also matches that build, run 45168556;
`SearchHandlerClearPlaceholderIconUpdatesAtRuntime`, seen during the
interrupted retry, matches [net11.0 build
1626506](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626506),
run 45112430. Android
`SafeAreaNoWhiteSpaceAfterKeyboardDismissAndEdgeToggle` matches the same
assertion on [net11.0 build
1627873](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1627873).
- **Unmatched UI failures:** MacCatalyst Shell
`SearchHandlerResetAllRestoresDefaultIcons` has a 0.52% screenshot
mismatch (published in run 45176448); it was not among failed results in
the five sampled net11.0 Shell runs. Windows
`VerifyShellSearch_TextTransformUppercase` has a 0.70% screenshot
mismatch; the corresponding Shell runs pass in all five sampled net11.0
UI builds. Neither is established as unrelated or PR-caused. The Shell
cancellation leaves additional coverage incomplete. No screenshot
baselines were updated to hide failures.
- [PowerShell Script Tests
37821050474](https://github.com/dotnet/maui/actions/runs/37821050474) —
**failed**: the unchanged `Review-Tests` contract expects an inline
GPT-5.6 model while the unchanged target-branch workflow imports
GPT-6.1. Both the assertion and its workflow subject are identical to
net11.0; no pipeline-test changes are included in this PR.

Xcode 27 is not installed locally; the Apple 27 compilation evidence
above is from remote CI. All three PR pipelines have finished, but
**full UI validation is not green**, MacCatalyst Shell coverage is
incomplete, and **official/internal signing remains pending**. The
unmatched failures need further investigation before claiming merge
readiness. These results do not justify removing the retained
execution-image safeguards. No XCTest/XCUITest or local UI automation
was run; global Xcode selection was not changed. The CI watch has been
stopped.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

No separately filed issue; requested .NET 11 adoption of the
already-established RC2 Xcode 27 configuration.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Oct 22, 2026
<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Add setup-only recovery with **at most five total attempts per
operation**, without rerunning a test command or inferring setup failure
from missing results.

[UI-test build
1642459](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1642459)
failed before executing tests while installing Android
emulator/system-image packages (`Error on ZipFile unknown archive`,
E2105/MSB3073). Material3 and several API 30 jobs encountered the same
provisioning failure; manually retried jobs subsequently ran
successfully. These are setup failures, distinct from flaky assertions.

- Use `retryCountOnTaskFailure: 4` for shared setup-only .NET
SDK/tool/workload, JDK, Xcode, Android environment/AVD,
artifact-download, Node and Appium tasks. The shared paths serve
applicable UI, device, unit/Helix and integration jobs, including legacy
handler/template preparation.
- Retry Android common, platform and emulator-image packages
**individually** in Azure Pipelines. Each attempt has fresh Android
user/temp caches; after a failure, discover the SDK and remove the
failed package directory and SDK `.temp` staging before retrying. Stream
attempt/exit-code diagnostics and fail explicitly after attempt five. Do
not add an enclosing task retry that could multiply the package
attempts. Non-CI MSBuild installs retain their original direct CLI
invocation and do not acquire a PowerShell dependency.
- Count the initial simulator-runtime download toward the five-attempt
cap, retain existing CoreSimulator recovery and timeout limits, and fail
explicitly on exhaustion or an unusable runtime.
- Increase the existing separated Cake UI preparation/build helper to
five attempts with backoff. Wire Android APK installation and
test-project build into that helper, alongside existing iOS, MacCatalyst
and Windows preparation. Test runner invocations, executed-test retry
selection/counts, result reconciliation and publication remain
unchanged.

**Coverage limits:** this is not a whole-job retry. Android emulator
boot, independent review-gate preparation, NUnit fixture setup/teardown,
and provisioning inside Helix/XHarness workers retain their existing
policies. Existing task/job timeouts can stop recovery before five
attempts. Exact coverage is documented in
`.github/docs/maui-ci-facts.md` and the UI-testing guide.

**Upstream comparison:** #39421 already introduced category-based test
retries, and open #39509 refines retries of executed tests. This change
addresses the separate pre-test setup boundary, not either test-retry
implementation. Reviewed recent provisioning fixes #38788 and #38806;
they do not implement this bounded package recovery.

**Local validation:** all passed without running native UI automation:

- `dotnet cake eng/devices/android.cake --target=uitest --dryrun
--verbosity=minimal`
- `dotnet cake eng/devices/ios.cake --target=uitest --dryrun
--verbosity=minimal`
- `dotnet cake eng/devices/catalyst.cake --target=uitest --dryrun
--verbosity=minimal`
- `dotnet cake eng/devices/windows.cake --target=uitest --dryrun
--verbosity=minimal`
- PowerShell parser and `Invoke-ScriptAnalyzer -Path
eng/scripts/Install-AndroidSdkPackage.ps1 -Severity Error,Warning
-EnableExit`.
- Modified YAML parsing with duplicate-key rejection, shared
provisioning Bash syntax checks, and provisioning XML/MSBuild
preprocessing for CI and non-CI configuration.
- `dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src
--exclude-diagnostics CA1822 --include eng/devices/android.cake
eng/devices/uitest-retry.cake eng/devices/uitests-shared.cake
src/Provisioning/Provisioning.csproj --verbosity quiet`
- `git diff --check`.

**Isolated real-installer runtime validation (macOS arm64):**

Used the actual restored MAUI CLI, real Android command-line tools 19.0
and existing SDK licenses copied into a private SDK with no symlinks.
`ANDROID_HOME` and `ANDROID_SDK_ROOT` both pointed to that copy; `dotnet
maui android sdk check --ci --json` confirmed the private path and
status `Ok` before provisioning. Android user/cache and temporary
directories were private as well. The production script was invoked with
this environment (`PRIVATE_ROOT` denotes that private validation
directory):

```bash
env TF_BUILD=True ANDROID_HOME="$PRIVATE_ROOT/sdk" ANDROID_SDK_ROOT="$PRIVATE_ROOT/sdk" \
  ANDROID_USER_HOME="$PRIVATE_ROOT/android-user" TMPDIR="$PRIVATE_ROOT/tmp" \
  pwsh -NoLogo -NoProfile -File eng/scripts/Install-AndroidSdkPackage.ps1 -Package platform-tools
```

- **Partial-install cleanup/recovery observed:** a regular file at the
private SDK's `platform-tools/.installer` blocked the native
install-properties directory. The command above failed on **attempt
1/5** with native exit code 1 and `Failed to read or create install
properties file`. The production wrapper logged removal of the failed
`platform-tools` directory, then the actual installer succeeded on
**attempt 2/5**; wrapper exit code **0**. The installed `adb version`
reported **37.0.1-15733141**.
- **Exact exhaustion observed:** with the same environment,
`/usr/bin/time -p pwsh -NoLogo -NoProfile -File
eng/scripts/Install-AndroidSdkPackage.ps1 -Package
'platforms;android-0'` exercised a nonexistent package. The actual
installer returned **E2105 / exit code 1** on exactly **attempts 1/5
through 5/5**. The wrapper also logged removal of the SDK `.temp` left
by the preceding real install. It stopped with `failed after 5 total
attempts (exit code 1)`, process exit code **1**, and **no sixth
attempt**. Elapsed time was **43.08 seconds**.
- **Successful-package preservation observed:** repeating the valid
`-Package platform-tools` command after exhaustion succeeded on
**attempt 1/5**, exit code **0**, and the previously installed `adb`
remained usable at the same version. Failed-package cleanup did not
remove that successful package.

**Runtime evidence limit:** these were isolated **macOS arm64 CLI**
executions, not literal reproduction of `ZipFile unknown archive` and
not Windows/Linux recovery validation. Native installer failures were
real; no substitute installer or test harness was used. The shared SDK
was not targeted. Private SDK/cache copies were removed after checking
for open files; raw `recovery.log`, `exhaustion.log` and
`post-exhaustion.log` were retained in session artifacts. No code
change, new commit/push or CI dispatch was needed for this validation.

**Final hosted validation (unchanged head
`9c7ca5bd9682cc8bf3c0fea0ec661c360459a477`):**

All three builds are terminal. Overall CI is **not green**: main
succeeded, UI has three post-test failures (two unmatched), and device
tests have one confirmed main-baseline failure. No setup defect has been
identified.

| Pipeline | Final result | Observed completion |
| --- | --- | --- |
| [maui-pr
1645251](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1645251)
| **Succeeded** | 26/26 jobs succeeded; 22 published test runs Completed
|
| [UI tests
1645252](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1645252)
| **Failed** | 161 jobs: 158 succeeded, 3 failed; all 157 published test
runs Completed |
| [Device tests
1645253](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1645253)
| **Failed** | All 7 build-log-correlated Helix jobs completed; only the
Android CoreCLR assertion below failed |

Main published **18,711 passed test executions / 140 skipped / 0
failed**; its final actual failed-result endpoint was empty. UI
published **18,161 passed test executions / 342 skipped / 3 failed** and
finished at **2026-10-22T14:37:38Z**. These are reported execution
counts, not deduplicated unique tests or a count of first-attempt-only
passes.

The three final UI failures were identified from authoritative
failed-run details and raw execution logs:

- **Windows, confirmed pre-existing:**
`Microsoft.Maui.TestCases.Tests.ShellSearchHandlerFeatureTests(Windows).VerifyShellSearch_TextTransformUppercase`
(run **45735806**, result **100196**) failed the screenshot comparison
at **0.70%**. [Main build
1641906](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1641906),
run **45623126**, result **100198**, has the exact same fully qualified
test, screenshot filename, **0.70%** difference and stack. This corrects
the earlier unmatched assessment. [Current execution log
3577](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/3577)
shows exactly the existing two test attempts, no new setup/build retry
warning, and the genuine final test failure; [publisher log
3579](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/3579)
correctly remains red.
- **Android, unmatched / needs investigation:**
`VerifyIsPasswordWhenCursorPositionValueSet` (run **45736456**, result
**100129**) failed with an element timeout. No exact failed-result
baseline match was found in the sampled five completed main UI builds;
this is **not** classified as pre-existing.
- **iOS, unmatched / needs investigation:** `DropEventCoordinates` (run
**45736540**, result **100272**) failed its positive X/Y assertion. No
exact failed-result baseline match was found in the same sample.
Baseline run **45634910**, result **100259**, is a different
`DragStartEventCoordinates` teardown failure, not a match.

The sampled completed main UI builds were **1643718, 1642149, 1641906,
1640343 and 1633638**. Their compact `resultsbybuild` data returned
incorrect test titles for some run/result IDs, including all three
current failures. Classification above uses rechecked failed-run
details, class/platform identity and raw logs, not those compact titles.
Absence from this five-build sample does not establish that the two
unmatched failures are PR-caused or pre-existing.

The sole device-test failure was Android CoreCLR
`ImageWithUndefinedSizeAndWithBackgroundSetRenders`, a red-color
assertion. The same exact test/platform/reason is present on [main build
1641907](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1641907),
run **45621312**, result **100999**. The other correlated Helix jobs
passed. Existing test retries preserved the final UI and device
failures; this PR does not rerun or hide them through the setup loop.

**Setup evidence and completed archive audits:**

- Azure Pipelines server-side preview succeeded for all three
definitions: `maui-pr` (32 expanded jobs), `maui-pr-uitests` (28), and
`maui-pr-devicetests` (8). These are expanded configuration counts,
separate from actual final job/run counts above.
- The new Android common-package installer ran successfully on Windows
in [main build log
48](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645251/logs/48),
and on macOS in the Material3 sample-build job in [UI build log
24](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/24).
Both show the new script installing `platform-tools`,
`cmdline-tools;13.0` and `emulator` on attempt **1/5**, followed by
`Build succeeded`.
- Full archive audits read **971 individual task logs** for main,
**145** for device validation and **5,522** for UI. They found
respectively **104 + 8 + 308 = 420 actual Android package-install
invocation lines**, all on attempt **1/5**, and **zero native Azure
`RetryHelper` warnings**. All **157 UI test-execution task logs** were
uniquely correlated with the **157 final published result runs**. The UI
archive audit is complete; zero native retry warnings does not mean that
inline simulator recovery or existing test retries did not occur.
- **Real hosted pre-test simulator recovery observed:** scanning **67
simulator-runtime task logs** (25 main, 2 device, 40 UI) found **18
successful recoveries**: **14 main, 2 device, 2 UI**. Each log reports
`Unable to connect to simulator`, `First attempt failed with exit code
70`, CoreSimulator cleanup/restart, then successful create-usable
smoke-device validation `after 2 install attempt(s)` and final setup
success. Examples: [main log
349](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645251/logs/349)
(lines 16-269), [device log
17](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645253/logs/17)
(lines 16-262), and [UI log
41](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/41)
(lines 16-231) / [UI log
145](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/145)
(lines 16-265). **The CoreSimulator cleanup/restart mechanism was
pre-existing logic retained by this PR**, not a newly invented recovery
mechanism. These logs demonstrate actual pre-test recovery with the
revised attempt accounting, but not recovery beyond the second attempt
or literal corrupt-ZIP recovery.
- **Existing executed-test retries, audited separately:** **103 UI
test-execution tasks ran once** and **54 ran twice**. Of those 54, **51
test-execution steps/jobs ultimately recovered** and **3 remained
failed**, exactly the final failures above. These are recovered
steps/jobs, **not 51 distinct flaky tests**. The **10** `Setup failed
for test fixture` candidates occur **inside NUnit after runner start**
and recovered through the existing executed-test retry path, not the new
five-attempt pre-test loop. [Windows execution log
3577](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1645252/logs/3577)
is an example of the unchanged two-attempt path preserving a final
failure.
- **Remaining limits:** no hosted Android package operation reached
attempt 2. Successful first-attempt package installs do not certify
corrupt-download recovery or exhaustion on hosted agents. The isolated
macOS arm64 CLI observations above remain the direct Android
cleanup/recovery/exhaustion proof; literal `ZipFile unknown archive` and
Windows/Linux Android recovery remain unexercised.
- Docs spellcheck passed. The existing [Pester scripts
check](https://github.com/dotnet/maui/actions/runs/39766212470) reports
**2,624 passed / 3 failed**. All three failures are stale GPT-5.6
model-policy assertions against the existing GPT-6 reviewer
configuration. The failing tests and both configuration inputs are
unchanged from the base commit; the base already sets `gpt-6-astra` in
`Review-Tests.ps1` and imports `shared/gpt-6.1-sol.md` in
`copilot-review-tests.md`. This PR does not change or suppress those
checks.

No pipeline Pester/regex/snapshot tests were added. No host macOS
XCTest/UI automation was used. This evidence update made no code
changes, push, rerun or CI dispatch.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

No linked issue. Addresses the setup/provisioning failures in [build
1642459](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1642459),
including [the Material3 provisioning
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1642459/logs/173).

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions platform/ios platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants