Repository navigation
Move main to .NET 12 - #40060
Move main to .NET 12#40060kubaflo wants to merge 62 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40060Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40060" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 8 findings
Reviewed commit c10ad7b.
Source assessment incomplete (12/13 dimensions); finding count is partial.
See inline comments for details.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - Major-version roll-forward does not permit release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions .dotnet, prepends it to PATH, then invokes the net10.0 Cake tool for its unpackaged and packaged builds. src/DotNet/DotNet.csproj deletes and recreates that isolated installation with the pinned .NET 12 alpha SDK/runtime, so Cake still fails framework resolution before building the apps. A stable runtime under the system dotnet installation does not populate this root. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for the affected invocations or install a compatible stable runtime into their selected root.
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion | ||
| type: string |
There was a problem hiding this comment.
[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into the job's XCODE variable in stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml. Supplying 27.0 beta makes Bash attempt to execute beta after the assignment instead of treating the input as a version value, failing provisioning. These pinned jobs disable package installation, so installer validation does not guard this path, and the pinned-version comparison runs only afterward. Pass the requested version through an environment variable and validate numeric version syntax before selection.
| # The .NET 12 Apple workloads require Xcode 27.1. Agents without it fall back to Xcode_27.app (27.0) | ||
| # during "Select Xcode Version", so keep validation off until every image has Xcode 27.1. | ||
| - name: ValidateXcodeVersion | ||
| value: false |
There was a problem hiding this comment.
[moderate] Build & MSBuild - Public agents without Xcode 27.1 select the Xcode_27.app fallback (27.0) in provision.yml, but the pinned .NET 12 iOS workload requires the iOS 27.1 compilation SDK. The compatible Xcode package is installed only for internal jobs. Disabling validation and downloading simulator runtimes matching the fallback cannot supply the missing compilation SDK/APIs, leaving current-framework Apple builds blocked on these agents. Provision a compatible public compilation toolchain while preserving the explicit previous-framework and UI-execution pins.
| { | ||
| public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources; | ||
|
|
||
| public ResourceDictionary OwnerResources { get; } |
There was a problem hiding this comment.
[moderate] Memory Leak Prevention - Apply a non-null TrackColor to an on-switch, then replace ToggleSwitch.Resources and leave TrackColor unchanged. The live switch's ConditionalWeakTable value still strongly retains the discarded dictionary through OwnerResources, including its application resources. Cleanup only runs on a subsequent on-state TrackColor update, so replacing Resources alone never releases these obsolete objects while the switch remains alive. Release the old state when Resources changes and add a WeakReference collection test without a subsequent TrackColor update; CustomOnColorPreservesReplacedResources immediately performs that update and misses this retention path.
| ALREADY_DOWNLOADED=1 | ||
| fi | ||
| rm -f "$DOWNLOAD_LOG" | ||
| RUNTIME_READY=0 |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The simulator-recovery fix lacks a discriminating regression fixture: exit 70 with "is already downloaded." and a create-usable plain runtime must avoid deleting installed runtimes. Contrast this with a device-specific runtime of the same version and a plain runtime whose device creation fails, neither of which may count as ready. .github/scripts/Review-PR.Tests.ps1 stops its download fixture before this recovery decision, and its final runtime-count cases omit device-specific identifiers. The new C# selector tests do not exercise this YAML branch. Add isolated command fixtures asserting the recovery decision and exact runtime identifier.
| # back to an older Xcode when the pinned one is missing; that Xcode has no device types | ||
| # for the pinned runtime, so match the selected Xcode's simulator SDK instead. | ||
| XCODE_MAJOR_MINOR="$(XCODE)" | ||
| SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix has no fixture for requested Xcode 27.1 falling back to an installed Xcode whose simulator SDK is 27.0. The architecture fixtures in .github/scripts/Review-PR.Tests.ps1 inject MAJOR/MINOR directly and extract code beginning at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the fix leaves those fixtures unchanged. Add isolated fixtures contrasting mismatched and matching versions, asserting the resulting download arguments and required runtime identifier.
| # resolve the raw framework-dependent binary there (e.g. Homebrew's | ||
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix has no regression fixture with the triggering leading Homebrew PSHOME entry. A host without that competing entry cannot detect reintroducing selection of the raw libexec/pwsh instead of the wrapper, which prevents subsequent test steps from starting. Add an isolated PATH fixture asserting repo dotnet first, the wrapper directory before PSHOME, and preservation of unrelated entries; contrast a PATH without PSHOME to verify the conditional does not introduce it.
| if ($env:UI_TEST_PLATFORM) { | ||
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array change and its new rejection guards have no discriminating fixture. The only nonempty caller supplies --ios and --catalyst, so it cannot detect argument splitting for an option such as --nugetsource=/tmp/NuGet Cache. Add an isolated fixture capturing arguments received by a stub build.ps1 and asserting that this option remains one unchanged argument. Contrast accepted empty/single-item string arrays with rejected scalar and non-string inputs so the guards cannot silently reject valid callers.
Keep .NET 12 dependency versions. Combine dotnet#40305's selected-platform UI test builds with the separate Android CoreCLR sample build: the shared stage builds only the selected iOS/Mac Catalyst platforms, and the Android stage runs only when Android is selected. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Local .NET 12 smoke test after merging
|
| Platform | Workload | Device | Result |
|---|---|---|---|
| Android | 37.99.0-preview.1.358 | Emulator API 36 (Android 16) | ✅ 0 errors; launched as the top resumed activity with no FATAL EXCEPTION; button tap updated its text (Tapped 1) |
| iOS | 27.1.12089-net12-p1 (Xcode 27.1) | iOS 27.1 simulator | ✅ 0 errors; launched and running |
| Mac Catalyst | 27.0.13384-net12-p1 (Xcode 27.1) | macOS, maccatalyst-arm64 | ✅ 0 errors; launched and running; no crash reports |
On every platform the app reported .NET 12.0.0-alpha.1.26523.103 and MAUI 12.0.0.0.
CI was triggered on this head: maui-pr 1691847, uitests 1691848, devicetests 1691849. Results will follow.
There was a problem hiding this comment.
Expert Review — 7 findings
Reviewed commit 74fa027.
Source assessment incomplete (11/13 dimensions); finding count is partial.
See inline comments for details.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - DOTNET_ROLL_FORWARD=Major still excludes prerelease runtimes for release-targeted tools. The Windows device-test stage provisions .dotnet, prepends it to PATH, then invokes net10.0 Cake for both unpackaged and packaged builds. src/DotNet/DotNet.csproj deletes and recreates that isolated installation with the pinned .NET 12 alpha SDK/runtime; a stable runtime in the system installation does not satisfy this root. Cake therefore fails framework resolution before building the apps. Enable prerelease roll-forward for these invocations or install a compatible stable runtime into their selected root.
| - ImageOverride -equals 1ESPT-Ubuntu22.04 | ||
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion |
There was a problem hiding this comment.
[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE in stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml:178. A value such as 27.0 beta makes Bash execute beta instead of treating the input as a version, failing provisioning. The sink predates this PR, but this parameter newly connects caller-supplied text to it. Explicitly pinned jobs disable package installation, and the pinned-version comparison runs after this sink. Pass the value through an environment variable and validate numeric version syntax before selection.
| { | ||
| public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources; | ||
|
|
||
| public ResourceDictionary OwnerResources { get; } |
There was a problem hiding this comment.
[moderate] Memory Leak Prevention - Apply a non-null TrackColor to an on-switch, then replace ToggleSwitch.Resources and leave TrackColor unchanged. The live switch now strongly retains the discarded dictionary and its application resources through the ConditionalWeakTable value and OwnerResources. Replacement cleanup only runs on a subsequent on-state TrackColor update, so the obsolete graph remains retained while the switch stays alive. Release the old state when Resources changes while preserving wrapper retention for the active dictionary. Add a collection test without a subsequent color update; CustomOnColorPreservesReplacedResources immediately updates TrackColor and misses this path.
| - catalyst | ||
| skipProvisioning: ${{ parameters.skipProvisioning }} | ||
|
|
||
| - ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}: |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The separate Android build guard increases the plain-category guard expression count from 10 to 11, but handles qualified selections in every stage guard, including the dedicated lanes in .github/scripts/RunTests.Tests.ps1:431 still asserts exactly 10. This change therefore breaks the existing contract test regardless of the selected platforms. Update that test alongside the split, preferably checking the required guards individually.
| } elseif ($env:UI_TEST_PLATFORM) { | ||
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array fix has no regression fixture proving that an option containing spaces survives unchanged. Current callers leave cakeArgs empty, and the existing pipeline tests only inspect platform interpolation, so they cannot detect reintroduced expression parsing or argument splitting. Add an isolated fixture capturing arguments received by a stub build.ps1, proving that --nugetsource=/tmp/NuGet Cache remains one argument. Exercise accepted empty/single-item string arrays and rejected scalar/non-string inputs to cover the new guards.
| # resolve the raw framework-dependent binary there (e.g. Homebrew's | ||
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the triggering leading Homebrew $PSHOME entry. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of the wrapper, which prevents subsequent steps from starting. Add an isolated PATH fixture asserting repository dotnet first, the wrapper directory before $PSHOME, and preservation of unrelated entries. Also cover PATH without $PSHOME so the conditional cannot introduce it unexpectedly.
| # back to an older Xcode when the pinned one is missing; that Xcode has no device types | ||
| # for the pinned runtime, so match the selected Xcode's simulator SDK instead. | ||
| XCODE_MAJOR_MINOR="$(XCODE)" | ||
| SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix has no fixture for requested Xcode 27.1 falling back to an installed Xcode with simulator SDK 27.0. The architecture fixtures in .github/scripts/Review-PR.Tests.ps1:1002 inject MAJOR/MINOR directly and extract code beginning at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the fix leaves those fixtures unchanged. Add mismatched and matching version fixtures asserting the resulting download arguments and required runtime identifier. The C# runtime-selection tests exercise a different selector.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 9 findings
Reviewed commit 74fa027.
See inline comments for details.
Previously reported findings were not duplicated.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - DOTNET_ROLL_FORWARD=Major permits crossing major versions but does not let release-targeted tools select prerelease runtimes. The Windows device-test stage provisions .dotnet, prepends it to PATH, then invokes net10.0 Cake for unpackaged and packaged builds. src/DotNet/DotNet.csproj deletes and recreates that isolated root with the pinned .NET 12 alpha SDK/runtime, so Cake still fails framework resolution when no stable runtime exists there. A stable runtime in another installation does not satisfy this host. Enable prerelease roll-forward for these invocations or install a compatible stable runtime into their selected root.
| - ImageOverride -equals 1ESPT-Ubuntu22.04 | ||
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion |
There was a problem hiding this comment.
[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE in stage-integration-tests.yml, then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) in common/provision.yml:178. A value such as 27.0 beta makes Bash attempt to execute beta instead of assigning one version value, failing provisioning under set -e. These pinned jobs disable package installation, so installer metadata validation does not guard this path; the pinned-version comparison runs afterward. The sink predates this PR, but the new parameter connects caller-supplied text to it. Pass the value through an environment variable and validate numeric version syntax before selection.
| { | ||
| public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources; | ||
|
|
||
| public ResourceDictionary OwnerResources { get; } |
There was a problem hiding this comment.
[moderate] Memory Leak Prevention - Apply a non-null TrackColor to an on-switch, then replace ToggleSwitch.Resources without another on-state TrackColor update. The live switch's ConditionalWeakTable value strongly retains the discarded dictionary and its application resources through OwnerResources. Replacement cleanup only runs inside UpdateOnPointerOverResources, so the obsolete resource graph remains uncollectable while the switch stays alive and unchanged. Invalidate the cached owner when Resources changes while preserving wrapper retention for the active dictionary. Add a WeakReference collection test without recoloring; CustomOnColorPreservesReplacedResources immediately updates TrackColor and misses this path.
| - catalyst | ||
| skipProvisioning: ${{ parameters.skipProvisioning }} | ||
|
|
||
| - ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}: |
There was a problem hiding this comment.
[moderate] Logic and Correctness Verification - Adding the separate Android build guard increases the number of plain-category guard expressions from 10 to 11, but .github/scripts/RunTests.Tests.ps1:431 still asserts exactly 10 in handles qualified selections in every stage guard, including the dedicated lanes. That existing contract test therefore fails against this template regardless of the selected platforms. Update the assertion with the split, preferably checking the required guards individually rather than fixing their total count.
| } elseif ($env:UI_TEST_PLATFORM) { | ||
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array fix has no discriminating regression fixture for an option containing spaces. Current callers leave cakeArgs empty, and the existing pipeline test only checks platform interpolation, so it cannot detect reintroduced expression parsing or argument splitting. Add an isolated fixture capturing arguments received by a stub build.ps1, proving that --nugetsource=/tmp/NuGet Cache remains one unchanged argument. Include accepted empty/single-item string arrays and rejected scalar/non-string inputs to cover the new guards.
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } | ||
| $otherEntries = @($pathEntries | Where-Object { $_.TrimEnd('/') -ne $PSHOME.TrimEnd('/') }) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the triggering leading Homebrew PSHOME entry. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of the wrapper, which prevents subsequent steps from starting. Add an isolated PATH fixture asserting repository dotnet first, the wrapper directory before PSHOME, and preservation of unrelated entries. Also cover PATH without PSHOME so the conditional cannot introduce it unexpectedly.
| # The .NET 12 Apple workloads require Xcode 27.1. Agents without it fall back to Xcode_27.app (27.0) | ||
| # during "Select Xcode Version", so keep validation off until every image has Xcode 27.1. | ||
| - name: ValidateXcodeVersion | ||
| value: false |
There was a problem hiding this comment.
[moderate] Build & MSBuild - On public agents without Xcode 27.1, provision.yml still selects the Xcode_27.app (27.0) fallback, while the pinned net12 iOS workload requires the iOS 27.1 compilation SDK. The compatible Xcode package is installed only for internal jobs. Disabling validation and downloading simulator runtimes matching the fallback cannot supply the missing compilation SDK/APIs, leaving current-framework Apple compilation blocked on those agents. Provision and select a compatible public compilation toolchain while preserving explicit previous-framework and UI-execution pins.
| @@ -1,6 +1,24 @@ | |||
| { | |||
There was a problem hiding this comment.
[minor] Build & MSBuild - This changes a build-generated manifest instead of leaving it build-owned. Microsoft.Maui.Templates.csproj unconditionally enables UpdateCgManifestBeforeBuild, and eng/CgManifest.targets invokes eng/scripts/update-cgmanifest.ps1 to rebuild its registrations from the central versions. The committed Microsoft.Extensions entries say 11.0.0, while their central properties now say 11.0.1, so the template build rewrites this delta again. Remove the generated-file delta and let the existing generation target produce it.
On Mac Catalyst built with Xcode 27.1 the ListView cell re-renders after the tap, so the held element reference goes stale (StaleElementReference in 4 of 6 PR attempts, 0 of 10 main/net11 runs). Re-query the buttons and retry the text and count assertions instead of reusing references. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - DOTNET_ROLL_FORWARD=Major does not allow release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions .dotnet, prepends it to PATH, then invokes net10.0 Cake for packaged/unpackaged builds (stage-device-tests.yml:444-474). DotNet.csproj recreates that isolated installation with only the pinned .NET 12 alpha runtime, so Cake still fails framework resolution. Enable prerelease roll-forward for these invocations or install a compatible stable runtime into that root.
| - ImageOverride -equals 1ESPT-Ubuntu22.04 | ||
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion |
There was a problem hiding this comment.
[major] Input and Path Correctness - Unrestricted previousXcodeVersion flows through job.xcodeVersion into XCODE (stage-integration-tests.yml:23), then into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) (provision.yml:178). A value such as 27.0 beta makes Bash execute beta rather than assign a version, failing provisioning under set -e. These pinned jobs disable package installation, and the version comparison runs afterward. Pass this value through an environment variable and validate numeric version syntax before selection.
| { | ||
| public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources; | ||
|
|
||
| public ResourceDictionary OwnerResources { get; } |
There was a problem hiding this comment.
[moderate] Memory Leak Prevention - After applying an on-state TrackColor, replacing ToggleSwitch.Resources without recoloring leaves the live switch's ConditionalWeakTable value strongly retaining the discarded dictionary and its unrelated resources through OwnerResources. Cleanup runs only during a later on-state TrackColor update, so the obsolete resource graph remains uncollectable while the switch stays unchanged. Invalidate the cached owner on replacement while retaining active wrappers. The replacement test immediately recolors and misses this lifetime.
|
|
||
| <PropertyGroup> | ||
| <_MauiDotNetVersionMajor Condition="'$(_MauiDotNetVersionMajor)' == ''">11</_MauiDotNetVersionMajor> | ||
| <_MauiDotNetVersionMajor Condition="'$(_MauiDotNetVersionMajor)' == ''">12</_MauiDotNetVersionMajor> |
There was a problem hiding this comment.
[moderate] Logic and Correctness Verification - Device-project TFMs now resolve to net12, but eng/pipelines/device-tests.yml:105 still defaults targetFrameworkVersions to net11.0. Its alternate pipeline branch passes that value through device-tests-jobs/steps to Cake's --targetFrameworkVersion, producing, for example, -f net11.0-android against Core/Controls device projects that expose only net12 platform TFMs. Update this entry point's default alongside ci-device-tests.yml so default runs can build their bundles.
| - catalyst | ||
| skipProvisioning: ${{ parameters.skipProvisioning }} | ||
|
|
||
| - ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}: |
There was a problem hiding this comment.
[moderate] Logic and Correctness Verification - The separate Android build guard increases the plain-category guard expression count from 10 to 11, but .github/scripts/RunTests.Tests.ps1:431 still asserts exactly 10 in handles qualified selections in every stage guard, including the dedicated lanes. That contract assertion now fails independently of platform selection. Update it alongside the split, preferably checking the required guards individually.
| # back to an older Xcode when the pinned one is missing; that Xcode has no device types | ||
| # for the pinned runtime, so match the selected Xcode's simulator SDK instead. | ||
| XCODE_MAJOR_MINOR="$(XCODE)" | ||
| SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this selection; removing the fix leaves those fixtures unchanged. Add mismatched and matching version cases asserting download arguments and the required runtime identifier. The C# SimulatorRuntimeSelectionTests exercise a different selector.
| # resolve the raw framework-dependent binary there (e.g. Homebrew's | ||
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the leading Homebrew PSHOME entry described by pinned commit 26c5bb6. A fixture without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of the wrapper, preventing later steps from starting. Assert repository dotnet first, wrapper before PSHOME, and preservation of unrelated entries; also cover PATH without PSHOME so the branch cannot introduce it.
| } elseif ($env:UI_TEST_PLATFORM) { | ||
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array fix has no fixture for the reported Cake option containing spaces. Current sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks only platform interpolation, so they cannot detect reintroduced argument splitting. Capture arguments with a stub build.ps1 and assert --nugetsource=/tmp/NuGet Cache remains one argument. Contrast accepted empty/single-item string arrays with rejected scalar/non-string inputs to cover the new guards.
| # The .NET 12 Apple workloads require Xcode 27.1. Agents without it fall back to Xcode_27.app (27.0) | ||
| # during "Select Xcode Version", so keep validation off until every image has Xcode 27.1. | ||
| - name: ValidateXcodeVersion | ||
| value: false |
There was a problem hiding this comment.
[moderate] Build & MSBuild - Public agents without Xcode 27.1 still select the Xcode_27.app (27.0) fallback in provision.yml:220-233, while the net12 iOS workload and Directory.Build.props:165-171 require the iOS 27.1 compilation SDK. The compatible package is installed only for internal jobs. Disabling validation and downloading simulator runtimes for the fallback does not supply the missing compilation SDK, so current-framework Apple compilation remains blocked on those agents. Provision a compatible public compilation toolchain while preserving explicit previous-framework/UI execution pins.
| "nuget": { | ||
| "name": "Microsoft.Extensions.Configuration", | ||
| "version": "10.0.0" | ||
| "version": "11.0.0" |
There was a problem hiding this comment.
[minor] Build & MSBuild - This commits a generated manifest delta that is already stale: Microsoft.Extensions registrations say 11.0.0, while their central properties in eng/Versions.props:47-56 say 11.0.1. Microsoft.Maui.Templates.csproj enables UpdateCgManifestBeforeBuild, whose existing generator rebuilds these registrations from the central versions; the next template build rewrites the delta. Remove generated-file changes and leave regeneration to the build target.
This comment has been minimized.
This comment has been minimized.
CI summary for 7494403 (merge ref 8cef639)
UI test failures after retries (attempt 3):
Fixed in this push: Issue2951 (Mac Catalyst) failed in 4 of 6 earlier PR attempts. The test now re-queries the buttons after each tap and uses No tests are disabled. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 11 findings
Reviewed commit 7494403.
Source assessment incomplete (11/13 dimensions); finding count is partial.
See inline comments for details.
Previously reported findings were not duplicated.
1 findings could not be attached inline; retained in run artifacts.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - Major-version roll-forward does not permit release-targeted tools to select prerelease runtimes. The Windows device stage provisions and prepends the isolated .dotnet root, then invokes net10.0 Cake for packaged and unpackaged builds. src/DotNet/DotNet.csproj recreates that root with the pinned .NET 12 alpha SDK/runtime; a stable system runtime does not populate it. With no stable runtime in that root, Cake fails framework resolution before building. Enable prerelease roll-forward for these invocations or install a compatible stable runtime into their selected root.
| - ImageOverride -equals 1ESPT-Ubuntu22.04 | ||
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion |
There was a problem hiding this comment.
[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE (stage-integration-tests.yml:23), then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) (common/provision.yml:178). Supplying 27.0 beta makes Bash execute beta rather than assign one version value, failing provisioning under set -e. The new parameter connects caller-supplied text to this existing sink. Pinned jobs disable package installation, and pinned-version verification runs afterward, so neither guards this assignment. Pass the value through an environment variable and validate numeric version syntax before selection.
| - catalyst | ||
| skipProvisioning: ${{ parameters.skipProvisioning }} | ||
|
|
||
| - ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}: |
There was a problem hiding this comment.
[moderate] Logic and Correctness Verification - The separate Android build guard increases the number of not(contains(join(',', parameters.selectedCategories), ':')) expressions from 10 to 11, but .github/scripts/RunTests.Tests.ps1:431 still asserts exactly 10 in handles qualified selections in every stage guard, including the dedicated lanes. That contract assertion now fails independently of platform or category selection. Update it with the stage split, preferably checking the required guards individually.
|
|
||
| <!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not | ||
| match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). --> | ||
| <Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences"> |
There was a problem hiding this comment.
[moderate] Build & MSBuild - The previous-framework ILLink override is not imported by the generated template projects. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into TestDirectory; MSBuild stops at that nearer file, which does not import the fixture-root targets containing this override. The net11 Mono Release cases in AppleTemplateTests therefore do not receive the intended 11.0.0 linker pin, leaving the documented custom-linker-step compatibility fix inactive for those cases. Put the override in the targets actually imported by generated projects.
| static internal Point? CalculatePosition(IElement relativeTo, WeakReference viewHandlerRef, WeakReference sessionRef) | ||
| { | ||
| if (sessionRef is null) | ||
| if (sessionRef?.Target is not IUIDragDropSession session) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The collected-target guard has no discriminating regression test. DragPositionIsAvailableAfterGarbageCollectionDuringHandler queries GetPosition while KeepAlive protects the session; DragOverPositionIsNullWithoutLocalDragSession supplies a null sessionRef. Both still succeed if only this guard is reverted to the reference-only check, although saved event args queried after the local session is collected would again dereference null. Add an iOS/MacCatalyst case with a non-null WeakReference whose target has been collected and assert GetPosition returns null.
| } elseif ($env:UI_TEST_PLATFORM) { | ||
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array fix has no regression fixture for a Cake option containing spaces. Current sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks only platform interpolation, so neither detects reintroduced expression parsing or argument splitting. Capture arguments with a stub build.ps1 and assert --nugetsource=/tmp/NuGet Cache remains one unchanged argument. Contrast accepted empty/single-item string arrays with rejected scalar/non-string inputs to exercise the new guards.
| # resolve the raw framework-dependent binary there (e.g. Homebrew's | ||
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the leading Homebrew PSHOME entry described by pinned commit 26c5bb6. A host without that competing entry cannot detect reintroduced selection of raw libexec/pwsh instead of the wrapper, preventing subsequent steps from starting. Add an isolated PATH fixture asserting repository dotnet first, the wrapper directory before PSHOME, and preservation of unrelated entries; also cover PATH without PSHOME so the conditional cannot introduce it.
| # back to an older Xcode when the pinned one is missing; that Xcode has no device types | ||
| # for the pinned runtime, so match the selected Xcode's simulator SDK instead. | ||
| XCODE_MAJOR_MINOR="$(XCODE)" | ||
| SELECTED_SDK_VERSION=$(xcrun --sdk iphonesimulator --show-sdk-version 2>/dev/null) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The selected-SDK fallback fix lacks a fixture where requested Xcode 27.1 falls back to simulator SDK 27.0, the scenario documented by pinned commit 150853e. Review-PR.Tests.ps1 injects MAJOR/MINOR and extracts code starting at RUNTIME_ARCHITECTURE, bypassing this selection; deleting the fix leaves those fixtures unchanged. Add mismatched and matching version cases asserting download arguments and the required runtime identifier. The C# SimulatorRuntimeSelectionTests exercise a different selector.
| "nuget": { | ||
| "name": "Microsoft.Extensions.Configuration", | ||
| "version": "10.0.0" | ||
| "version": "11.0.0" |
There was a problem hiding this comment.
[minor] Build & MSBuild - The committed generated manifest records Microsoft.Extensions.Configuration, DependencyInjection and Logging.Debug as 11.0.0, but the pinned Versions.props entries are 11.0.1. update-cgmanifest.ps1 reads those stable values directly and regenerates all three registrations as 11.0.1. The checked-in component inventory describes different package versions from its generator's inputs. Leave this generated file out of the change instead of committing stale registrations.
PR Test Gate🧪 Gate analysis — click to expand❌ Failed. The selected tests did not meet the expected outcomes. Inspect the evidence before changing the test or fix. 🧪 Unit tests
📄 XAML unit tests
📱 Device tests
🖥 UI tests
Coverage gap: some detected groups were omitted by the verifier. Inspect the complete report before treating this as full coverage. Execution log excerptsWithout fix With fix Without fix With fix PR head: 74944030. Without-fix baseline: f79bb5b3. |
There was a problem hiding this comment.
🟡 Changes recommended
Release-targeted tools still cannot start with only the .NET 12 alpha runtime installed, and iOS Mono device-test coverage is removed without restoration or explicit follow-up.
2 open issues
What changed in this PR
Moves MAUI’s main branch to .NET 12 while retaining .NET 11 compatibility testing. The migration updates build infrastructure, adapts platform code to runtime changes, and refreshes tests and documentation.
Changes:
- Updates SDK, workload, framework, assembly-version, and package-feed settings.
- Separates Android and Apple test builds and adjusts toolchain provisioning and runtime coverage.
- Fixes platform object-lifetime issues and adds regression tests.
| File | Description |
|---|---|
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/Utilities/TestEnvironment.cs | Uses the ARM64 iOS simulator runtime identifier. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimulatorRuntimeSelectionTests.cs | Tests simulator runtime compatibility selection. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs | Enables template cases and verifies package-version overrides. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/SampleTests.cs | Removes a blank line only. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/ResizetizerTests.cs | Retargets generated libraries and updates SDK detection. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/PackageSourceTests.cs | Tests package-source deduplication and conflicts. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs | Enables Avalonia template tests. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/MacTemplateTest.cs | Enables Mac Catalyst signing and entitlement tests. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/BaseTemplateTests.cs | Deduplicates package sources. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/BaseBuildTest.cs | Updates framework constants, linker pinning, and keystore isolation. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/AppleTemplateTests.cs | Adjusts current and previous-framework runtime cases. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/Apple/Simulator.cs | Filters runtimes by supported simulator device type. |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/AOTTemplateTest.cs | Uses .NET 11 for simulator-x64 compatibility cases. |
| src/TestUtils/src/DeviceTests/AssertionExtensions.cs | Allows time for Android CoreCLR peer cleanup. |
| src/TestUtils/src/DeviceTests.Runners/HeadlessRunner/iOS/XHarnessSceneManifest.plist | Adds the headless runner’s scene manifest. |
| src/TestUtils/src/DeviceTests.Runners/HeadlessRunner/iOS/XHarnessSceneDelegate.cs | Registers the headless runner’s scene delegate. |
| src/Templates/src/cgmanifest.json | Refreshes generated dependency registrations. |
| src/Microsoft.Maui.TestUtils.DeviceTests.Runners.targets | Conditionally includes the scene manifest. |
| src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj | Enables the XHarness scene manifest. |
| src/Essentials/src/FileSystem/FileSystem.android.cs | Preserves Java file-not-found exception constructors. |
| src/DotNet/Dependencies/Workloads.csproj | Moves compatibility manifests from net10 to net11. |
| src/Core/tests/DeviceTests/Platform/InputMethodManagerTests.Android.cs | Tests shared input-service lifetime. |
| src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs | Tests resource lifetime and replacement handling. |
| src/Core/tests/DeviceTests/Core.DeviceTests.csproj | Enables the XHarness scene manifest. |
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Records removed Android threshold overrides. |
| src/Core/src/Platform/Windows/SwitchExtensions.cs | Retains hover-resource state with the control. |
| src/Core/src/Platform/Android/ViewExtensions.cs | Uses Java casting and preserves shared input services. |
| src/Core/src/Platform/Android/SearchViewExtensions.cs | Uses Java casting for the input service. |
| src/Core/src/Platform/Android/MauiHybridWebViewClient.cs | Preserves Java file-not-found exception constructors. |
| src/Core/src/Platform/Android/EditTextExtensions.cs | Uses Java casting for the input service. |
| src/Controls/tests/Xaml.UnitTests/AssemblyInfoTests.cs | Expects assembly major version 12. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2951.cs | Retries assertions after cell updates. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28986.cs | Adjusts Android keyboard dismissal. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28986_ContentPage.cs | Adjusts Android keyboard dismissal. |
| src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj | Restricts current-framework iOS builds to ARM64. |
| src/Controls/tests/SourceGen.UnitTests/StaticResourceInMarkup.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/Maui32879Tests.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/XStaticUnresolvedType.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/WarningIgnore.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/UnresolvedType.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/StaticResourceWithTypeConversion.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SimplifyOnPlatform.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SimpleValueTargetProviderTests.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SetterCompiledConverters.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/SetBinding.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/Maui32758Tests.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/DataTemplateMarkupExtension.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/CompiledBindings.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/BasicCase.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/InitializeComponent/AppThemeBinding.cs | Updates assembly-version snapshots. |
| src/Controls/tests/SourceGen.UnitTests/FlexLayoutTests.cs | Updates assembly-version snapshots. |
| src/Controls/tests/DeviceTests/Elements/DragAndDrop/DragAndDropTests.iOS.cs | Tests drag-session lifetime and missing-session behavior. |
| src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj | Enables the XHarness scene manifest. |
| src/Controls/src/Core/Platform/iOS/DragAndDropDelegate.cs | Keeps drag sessions alive during event handlers. |
| src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj | Enables the XHarness scene manifest. |
| NuGet.config | Adds .NET 12 and Apple compatibility feeds. |
| global.json | Selects the .NET 12 alpha SDK. |
| eng/Versions.props | Updates product, SDK, workload, and JDK versions. |
| eng/Version.Details.xml | Updates dependency versions and coherent-parent metadata. |
| eng/pipelines/device-tests.yml | Adds Android-specific provisioning steps. |
| eng/pipelines/common/variables.yml | Updates Xcode defaults and runtime roll-forward settings. |
| eng/pipelines/common/ui-tests.yml | Separates Android sample builds and propagates Xcode pins. |
| eng/pipelines/common/ui-tests-steps.yml | Parameterizes artifacts and pinned Xcode handling. |
| eng/pipelines/common/ui-tests-build-sample.yml | Passes build arguments safely and parameterizes artifacts. |
| eng/pipelines/common/run-dotnet-preview.yml | Adjusts PATH ordering for PowerShell startup. |
| eng/pipelines/common/provision.yml | Matches simulator provisioning to Xcode and retries JDK downloads. |
| eng/pipelines/ci.yml | Reorganizes compatibility partitions and Apple test jobs. |
| eng/pipelines/ci-device-tests.yml | Targets net12 and adds Android provisioning. |
| eng/pipelines/arcade/stage-device-tests.yml | Separates platform builds and adds workload diagnostics. |
| eng/helix.proj | Aligns test publishing with the repository framework. |
| eng/devices/devices-shared.cake | Defaults device tooling to net12. |
| eng/cake/dotnet.cake | Defaults to net12 and ARM64 iOS NativeAOT builds. |
| eng/Build.props | Clarifies restore isolation in a comment. |
| docs/DevelopmentTips.md | Documents Apple toolchains and compatibility coverage. |
| Directory.Build.props | Updates frameworks, isolates restores, and adjusts Apple settings. |
| .github/skills/run-integration-tests/SKILL.md | Updates iOS test invocation examples. |
| .github/instructions/integration-tests.instructions.md | Refreshes framework, CI, and toolchain guidance. |
Review effort: Balanced
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
| - script: $(_buildScriptMacOS) -restore -build -configuration $(_BuildConfig) /p:BuildDeviceTests=true /p:UseMonoRuntime=false /p:IncludeIosTargetFrameworks=false /p:IncludeMacCatalystTargetFrameworks=false /bl:BuildDeviceTests.binlog | ||
| displayName: Build DeviceTests Android (CoreCLR) |
|
/review expert-review-with-gate |
|
Warning Your |
There was a problem hiding this comment.
Expert Review — 12 findings
Reviewed commit 7494403.
Source assessment incomplete (11/13 dimensions); finding count is partial.
See inline comments for details.
1 findings could not be attached inline; retained in run artifacts.
| # Tools such as Cake target net10.0; let them run on the repo's .NET 12 preview runtime when | ||
| # no .NET 10 runtime is installed (their own roll-forward setting skips prerelease runtimes). | ||
| - name: DOTNET_ROLL_FORWARD | ||
| value: Major |
There was a problem hiding this comment.
[major] Logic and Correctness Verification - DOTNET_ROLL_FORWARD=Major does not allow release-targeted tools to select prerelease runtimes. The Windows device-test stage provisions .dotnet, prepends it to PATH, then invokes net10 Cake for unpackaged and packaged builds. DotNet.csproj deletes and recreates that root with the pinned .NET 12 alpha SDK/runtime, so Cake cannot resolve its framework when that root has no stable runtime; the system installation does not satisfy this isolated host. Enable DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 for these invocations or install a compatible stable runtime in their selected root.
| - ImageOverride -equals 1ESPT-Ubuntu22.04 | ||
|
|
||
| # The .NET 11 iOS compatibility workload recommends Xcode 27.0. | ||
| - name: previousXcodeVersion |
There was a problem hiding this comment.
[major] Input and Path Correctness - The unrestricted previousXcodeVersion parameter flows through job.xcodeVersion into XCODE (stage-integration-tests.yml:23), then Azure substitutes it into executable Bash at XCODE_MAJOR_MINOR=$(XCODE) (common/provision.yml:178). A value such as 27.0 beta makes Bash attempt to execute beta instead of assigning one version value, failing provisioning under set -e. These pinned jobs disable package installation, and version verification occurs afterward, so neither guards this assignment. Pass the parameter through an environment variable and validate numeric version syntax before selection.
| { | ||
| public SwitchHoverResourceState(ResourceDictionary ownerResources) => OwnerResources = ownerResources; | ||
|
|
||
| public ResourceDictionary OwnerResources { get; } |
There was a problem hiding this comment.
[moderate] Memory Leak Prevention - Apply a non-null TrackColor to an on-switch, then replace ToggleSwitch.Resources without recoloring. The live switch's ConditionalWeakTable value still strongly retains the discarded dictionary and its unrelated application resources through OwnerResources. Replacement cleanup runs only during a subsequent on-state TrackColor update, so the obsolete resource graph remains retained while the switch stays unchanged. Release the old owner when Resources changes while preserving active-wrapper retention. CustomOnColorPreservesReplacedResources immediately recolors; add a WeakReference collection case without that update.
| - catalyst | ||
| skipProvisioning: ${{ parameters.skipProvisioning }} | ||
|
|
||
| - ${{ if and(containsValue(parameters.selectedPlatforms, 'android'), or(eq(length(parameters.selectedCategories), 0), and(not(contains(join(',', parameters.selectedCategories), ':')), ne(join('', parameters.selectedCategories), 'Material3')), contains(replace(join(',', parameters.selectedCategories), 'android:Material3', ''), 'android:'))) }}: |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The Android build-stage split adds an eleventh not(contains(join(',', parameters.selectedCategories), ':')) guard, but the existing qualified-selection contract in .github/scripts/RunTests.Tests.ps1:431 still asserts exactly ten occurrences. The assertion therefore fails against this template regardless of platform or category selection. Update the contract alongside the split, preferably checking the required guards individually.
| static internal Point? CalculatePosition(IElement relativeTo, WeakReference viewHandlerRef, WeakReference sessionRef) | ||
| { | ||
| if (sessionRef is null) | ||
| if (sessionRef?.Target is not IUIDragDropSession session) |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The collected-session guard has no discriminating regression case. DragPositionIsAvailableAfterGarbageCollectionDuringHandler queries GetPosition while KeepAlive protects the session; DragOverPositionIsNullWithoutLocalDragSession supplies a null sessionRef. Both still succeed if only this guard is reverted to the old reference-only check, while saved event args queried after the local session is collected would dereference null again. Add an iOS/MacCatalyst case with a non-null WeakReference whose target has been collected and assert GetPosition returns null.
| $buildArguments += "--$env:UI_TEST_PLATFORM" | ||
| } | ||
| $extraCakeArguments = ConvertFrom-Json -InputObject $env:UI_TEST_CAKE_ARGS -NoEnumerate | ||
| if ($extraCakeArguments -isnot [array]) { |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The argument-array fix has no regression fixture for a Cake option containing spaces. Current sample-build callers leave cakeArgs empty, and RunTests.Tests.ps1 checks platform interpolation rather than argument preservation, so neither detects reintroduced expression parsing or splitting. Capture arguments with an isolated stub build.ps1 and assert --nugetsource=/tmp/NuGet Cache remains one unchanged argument. Include accepted empty/single-item string arrays and rejected scalar/non-string inputs to exercise these guards.
| # resolve the raw framework-dependent binary there (e.g. Homebrew's | ||
| # libexec/pwsh) instead of the agent's entry point, and it fails when | ||
| # DOTNET_ROOT lacks its runtime. Keep $PSHOME, but last. | ||
| $pathEntries = $env:PATH -split ':' | Where-Object { $_ } |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - The PATH-ordering fix lacks a regression fixture with the leading Homebrew PSHOME entry described by pinned commit 26c5bb6. Without that competing entry, a fixture cannot detect reintroduced selection of raw libexec/pwsh instead of the wrapper, which prevents later steps from starting when the required runtime is absent from the selected root. Add an isolated PATH case asserting repository dotnet first, the wrapper before PSHOME, and preservation of unrelated entries; also cover PATH without PSHOME.
|
|
||
| <!-- The current SDK pins {{BaseBuildTest.DotNetPrevious}} ILLink to a pre-release whose API does not | ||
| match the custom steps used by previous-.NET Apple SDKs for Mono builds (IL1027). --> | ||
| <Target Name="_MauiTestPinPreviousILLinkPack" BeforeTargets="ProcessFrameworkReferences"> |
There was a problem hiding this comment.
[moderate] Build & MSBuild - The previous-framework ILLink pin is written only to the fixture-root Directory.Build.targets. BaseTemplateTests copies src/Templates/tests/Directory.Build.targets into each generated-project directory; MSBuild stops at that nearer file, which neither imports the parent nor contains this pin. Retained net11 Release SimpleTemplateTest.Build and BuildWithMauiVersion app cases therefore do not receive the workaround for the SDK-default ILLink/custom Apple Mono-step incompatibility described here. Put the pin in the targets these fixtures actually import, or explicitly import a shared pin from both locations.
| # Agents don't preinstall JDK 21, so this downloads it; the download host has | ||
| # intermittent 504 windows that outlast the task-level retry backoff. | ||
| - pwsh: | | ||
| foreach ($delay in 0, 30, 60, 120) { |
There was a problem hiding this comment.
[minor] Complexity Reduction - The four-attempt backoff loop remains wrapped in retryCountOnTaskFailure: 4, multiplying recovery into up to 20 ProvisionJdk invocations and 1,050 seconds of explicit sleeps, excluding command time and Azure backoff, on persistent failures. The longer delay does not require two retry owners. Follow the existing bounded single-owner pattern in eng/scripts/Install-AndroidSdkPackage.ps1: use one five-attempt loop with the longer backoff and remove the enclosing task retry.
| "nuget": { | ||
| "name": "Microsoft.Extensions.Configuration", | ||
| "version": "10.0.0" | ||
| "version": "11.0.0" |
There was a problem hiding this comment.
[minor] Build & MSBuild - The committed registrations for Microsoft.Extensions.Configuration, DependencyInjection and Logging.Debug use 11.0.0, while their central Versions.props properties are 11.0.1. update-cgmanifest.ps1 maps these packages directly to those stable properties, so regeneration rewrites all three registrations to 11.0.1; the prerelease N-1 substitution does not apply. The committed dependency inventory therefore disagrees with its generator. Regenerate it from the central versions rather than retaining these manual version replacements.


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!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.Description of Change
Moves
mainfrom .NET 11 to .NET 12. (net11is now the .NET 11 servicing branch.)SDK / workloads — taken from coherent
mainbuilds of dotnet/android and dotnet/macios, which are both built against the same VMR SDK:12.0.100-alpha.1.26523.103/12.0.0-alpha.1.26523.103net12.0_27.1)27.1.12089-net12-p1net12.0_27.0)27.0.13384-net12-p1(same macios commit7af83b1)37.99.0-preview.1.35812.0.100-alpha.1Arcade stays on 11 for now.
Changes
global.json,eng/Versions.props,eng/Version.Details.xml: SDK, runtime, Apple and Android versions;MajorVersion,SdkBandVersionandAssemblyVersionare now 12. Previous-framework workload metadata is aligned with the retained upstream parents.Directory.Build.props: current TFMnet12.0, iOS TPV27.1.Workloads.csproj(net10 → net11),MicrosoftMauiPreviousDotNetReleasedVersion(11.0.0-rc.2.26505.5) and the integration-test constants.NuGet.config:dotnet12anddotnet12-transportfeeds;ValidateXcodeVersion=falsebypasses version validation, but cannot supply the iOS 27.1 APIs missing from agents with Xcode 27.0. Those public Apple builds remain blocked until a suitable toolchain is available.11.0.0.0→12.0.0.0.net12.0.Coverage still unresolved: this PR currently removes the Android Mono device-test lane and the net12 iOS simulator-x64 UI-host target because those runtime configurations are no longer supplied by the current upstream workloads. The net11 x64 cases do not restore equivalent net12 coverage. The retained iOS Mono device build also fails to link with the current workload. The request to keep every test configuration enabled is therefore not yet satisfied.
Validation: The previous-framework Build partition passed 15/15 locally, the restored net11 iOS simulator-x64 NativeAOT cases passed 2/2, current-framework iOS arm64 NativeAOT passed 2/2, and two iOS simulator integration cases passed 2/2. Apple validation used local Xcode 27.1 with the version check bypassed where required. On an Android API 33 arm64 emulator with .NET 12 CoreCLR, the Entry category passed 246 tests with 2 skipped, Essentials passed 424/424, and HybridWebView passed 97 tests with 5 skipped. Controlled reversions reproduced the input-service and missing-file failures. Full local Core and Controls runs still had failures; not all Controls leak-assertion failures have been classified. Latest-head CI is running; actual internal Xcode-package installation and the strict Xcode 27.0 job pin still require CI validation.
Issues Fixed
N/A — SDK migration.
Follow-ups (not in this PR)
ValidateXcodeVersion=falsewhere no longer needed.