Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/docs/maui-ci-facts.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@ error XAGRDL0000: Could not GET '...pkgs.dev.azure.com/.../maven/v1/...'
| `error NETSDK1144` | `maui-pr` TrimFull legs | Optimizing assemblies for size failed (often an ILLink warning promoted to error). Check whether the same leg is red on the base branch. |
| `XamlC` | `maui-pr` | XAML compiler — usually missing type or bad binding |
| `error XAGRDL0000` / `401` / `No local versions` | `maui-pr` or official build | Gradle/Maven feed issue — see above |
| Apple workload install cannot find a `net10.0` SDK pack | `maui-pr` SDK provisioning | The .NET 11 Apple manifests also install .NET 10 compatibility packs. Resolve the exact missing version's feed with `darc get-asset`; the current .NET 11 feed alone may not contain it. Do not copy another branch's compatibility feed without checking its manifest versions. |
| `NETSDK1140` rejects the Apple target platform version | `maui-pr` build/pack | Align current Apple target-framework versions and SDK defaults in `Directory.Build.props` with the selected Apple SDK. net11.0 uses 26.5; the RC2 release branch uses 27.0. Preserve previous-.NET compatibility targets. |
| Xcode 27 rejects native iOS 12.x / mapped macOS 10.15 deployment targets | `maui-pr` native interop archive | On branches using Apple 27, align the native framework and managed iOS minimum to 15.0, already used by app templates. This maps to macOS 12.0 for Mac Catalyst. Do not raise minimums on Apple 26.5 branches solely to match RC2. |
| Apple `bgen.dll` exits 150 requesting a newer .NET runtime | `maui-pr` Apple binding generation | Keep bootstrap (`global.json`), workload provisioning (`MicrosoftNETSdkPackageVersion`), and SDK provenance pins aligned with a compatible host runtime. SDK `11.0.100-rc.2.26470.103` satisfies the Apple 27 generator's `26465.108` requirement and is already selected on net11.0. |
| Resizetizer raster test assertions pass but `Dispose` fails with a Windows sharing violation | Helix Windows unit tests | Keep temporary images under `BaseTest.DestinationDirectory` and reuse its bounded, logged cleanup retries from #38124. Dispose raster tools deterministically; preserve all image assertions and let exhausted cleanup retries fail the test. |
| `Svg.Animation` / `Svg.SceneGraph` `NU1603`, or `SKPathBuilder` `CS0246` | `maui-pr` restore/build | Release merges can preserve old `eng/Versions.props` pins while importing Skia 4 source and packaging changes. Restore the coordinated SkiaSharp/HarfBuzz/SVG dependency versions, not just the first missing package. |
| Required Xcode is missing / requested iOS runtime is unavailable | `maui-pr` macOS provisioning | Select an image or agents providing the branch's required Xcode. net11.0 retains Aces with Xcode 26.5; RC2 needs the MAUI pool's Xcode 27 RC agents. Do not fall back to an unrelated Xcode or purge runtimes to repair a version mismatch. The legacy Provisionator task is unavailable in `dnceng-public`; enabling it prevents pipeline startup. |
| `iOS 27.0 (universal) is not available for download` | `maui-pr` simulator provisioning | Request the `arm64` runtime on Apple Silicon agents; retain `universal` on Intel. Keep all downloads version-pinned. An unavailable download can also return exit code 70, so do not treat every exit 70 as a wedged CoreSimulator or delete installed runtimes. |
| Helix monitor cannot use `NetCore-Svc-Public` | `maui-pr` release branches | The monitor must use the pipeline's selected Helix submission pool, with its Linux image demand, rather than independently selecting an unauthorized pool from the branch name. |
| `XHarness timeout` | `maui-pr-devicetests` Helix logs | Test killed by infrastructure; may be transient |
| `No test result files found` | `maui-pr-devicetests` Helix logs | Tests never ran or app crashed on launch |
| UI test screenshot diff | `maui-pr-uitests` | Visual regression; check baseline images |
Expand Down
58 changes: 57 additions & 1 deletion .github/scripts/Review-PR.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,68 @@ Describe 'Snapshot diff asset publishing' {
Describe 'Simulator runtime provisioning contract' {
It 'pins every recovery download and smoke test to the selected Xcode version' {
$provisionContent | Should -Match ([regex]::Escape(
'DOWNLOAD_ARGS=(-downloadPlatform iOS -architectureVariant universal -buildVersion "${MAJOR}.${MINOR}")'))
'DOWNLOAD_ARGS=(-downloadPlatform iOS -architectureVariant "$RUNTIME_ARCHITECTURE" -buildVersion "${MAJOR}.${MINOR}")'))
([regex]::Matches($provisionContent, [regex]::Escape(
'sudo xcodebuild "${DOWNLOAD_ARGS[@]}"'))).Count | Should -Be 3
$provisionContent | Should -Match 'SMOKE_RT=.*--arg req "\$\{MAJOR\}\.\$\{MINOR\}".*== \$req'
}

It 'selects <RuntimeArchitecture> simulator downloads on <HostArchitecture> for Xcode <XcodeVersion>' -TestCases @(
@{ HostArchitecture = 'arm64'; RuntimeArchitecture = 'arm64'; XcodeVersion = '26.5' },
@{ HostArchitecture = 'x86_64'; RuntimeArchitecture = 'universal'; XcodeVersion = '26.5' },
@{ HostArchitecture = 'arm64'; RuntimeArchitecture = 'arm64'; XcodeVersion = '27.0' },
@{ HostArchitecture = 'x86_64'; RuntimeArchitecture = 'universal'; XcodeVersion = '27.0' }
) -Skip:(-not (Get-Command bash -ErrorAction SilentlyContinue)) {
param($HostArchitecture, $RuntimeArchitecture, $XcodeVersion)

$selection = [regex]::Match(
$provisionContent,
'(?ms)^\s*RUNTIME_ARCHITECTURE=universal.*?^\s*DOWNLOAD_ARGS=.*?\r?$')
$selection.Success | Should -BeTrue
$script = @'
HOST_ARCH="$1"
uname() { printf '%s\n' "$HOST_ARCH"; }
MAJOR="${2%.*}"
MINOR="${2#*.}"
'@ + "`n" + $selection.Value + "`n" + 'printf "%s\n" "${DOWNLOAD_ARGS[@]}"'
$actual = & bash -c $script -- $HostArchitecture $XcodeVersion

$LASTEXITCODE | Should -Be 0
($actual -join ' ') | Should -Be "-downloadPlatform iOS -architectureVariant $RuntimeArchitecture -buildVersion $XcodeVersion"
}

It 'handles <Case> before simulator recovery' -TestCases @(
@{ Case = 'unavailable 26.5 runtime'; Message = 'iOS 26.5 (arm64) is not available for download.'; DownloadExitCode = 70; ExpectedExitCode = 1 },
@{ Case = 'unavailable 27.0 runtime'; Message = 'iOS 27.0 (arm64) is not available for download.'; DownloadExitCode = 70; ExpectedExitCode = 1 },
@{ Case = 'CoreSimulator connection failure'; Message = 'Unable to connect to simulator'; DownloadExitCode = 70; ExpectedExitCode = 0 },
@{ Case = 'successful download'; Message = 'Download complete'; DownloadExitCode = 0; ExpectedExitCode = 0 }
) -Skip:(-not (Get-Command bash -ErrorAction SilentlyContinue)) {
param($Case, $Message, $DownloadExitCode, $ExpectedExitCode)

$download = [regex]::Match(
$provisionContent,
'(?ms)^\s*DOWNLOAD_LOG=\$\(mktemp\).*?(?=^\s*if \[\[ "\$RC" != "0" \]\]; then)')
$download.Success | Should -BeTrue
$script = @'
DOWNLOAD_MESSAGE="$1"
DOWNLOAD_EXIT_CODE="$2"
sudo() { printf '%s\n' "$DOWNLOAD_MESSAGE"; return "$DOWNLOAD_EXIT_CODE"; }
MAJOR=26
MINOR=5
RUNTIME_ARCHITECTURE=arm64
DOWNLOAD_ARGS=(-downloadPlatform iOS)
'@ + "`n" + $download.Value + "`n" + 'echo "RECOVERY_CHECK_RC=$RC"'
$actual = & bash -c $script -- $Message $DownloadExitCode

$LASTEXITCODE | Should -Be $ExpectedExitCode
if ($ExpectedExitCode -eq 1) {
($actual -join "`n") | Should -Match 'simulator recovery cannot fix an unavailable download'
($actual -join "`n") | Should -Not -Match 'RECOVERY_CHECK_RC'
} else {
($actual -join "`n") | Should -Match "RECOVERY_CHECK_RC=$DownloadExitCode"
}
}

It 'requires a Ready runtime matching Xcode rather than any installed runtime' -Skip:(-not (Get-Command jq -ErrorAction SilentlyContinue)) {
$filterMatch = [regex]::Match(
$provisionContent,
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/powershell-script-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ on:
- '.github/skills/verify-tests-fail-without-fix/scripts/*.ps1'
- '.github/workflows/**'
- 'eng/scripts/**'
- 'Directory.Build.props'
- 'global.json'
- 'eng/Versions.props'
- 'eng/Version.Details.xml'
- 'eng/pipelines/arcade/stage-helix-tests.yml'
- 'eng/pipelines/ci.Tests.ps1'
- 'eng/pipelines/ci-copilot.yml'
- 'eng/pipelines/ci-official.yml'
- 'eng/pipelines/ci-official.Tests.ps1'
Expand Down Expand Up @@ -82,6 +88,7 @@ jobs:
'.github/scripts'
'.github/skills/run-device-tests/scripts'
'.github/skills/verify-tests-fail-without-fix/scripts'
'eng/pipelines/ci.Tests.ps1'
'eng/pipelines/ci-official.Tests.ps1'
'eng/pipelines/ci-official-release.Tests.ps1'
'eng/scripts/nuget_release_packages.Tests.ps1'
Expand Down
3 changes: 1 addition & 2 deletions eng/pipelines/arcade/stage-helix-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ stages:
displayName: Monitor Helix Jobs
timeoutInMinutes: ${{ parameters.helixJobMonitorTimeoutInMinutes }}
pool:
name: ${{ parameters.helixPool.name }}
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64.open
${{ else }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64
steps:
- checkout: self
Expand Down
84 changes: 84 additions & 0 deletions eng/pipelines/ci.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#Requires -Modules Pester

Describe 'CI provisioning' {
BeforeAll {
$provision = Get-Content -LiteralPath (
Join-Path $PSScriptRoot 'common/provision.yml') -Raw
$helixStage = Get-Content -LiteralPath (
Join-Path $PSScriptRoot 'arcade/stage-helix-tests.yml') -Raw
}

Describe 'SDK alignment' {
BeforeAll {
[xml]$buildProps = Get-Content -LiteralPath (
Join-Path $PSScriptRoot '../../Directory.Build.props') -Raw
[xml]$versions = Get-Content -LiteralPath (
Join-Path $PSScriptRoot '../Versions.props') -Raw
[xml]$versionDetails = Get-Content -LiteralPath (
Join-Path $PSScriptRoot '../Version.Details.xml') -Raw
$globalJson = Get-Content -LiteralPath (
Join-Path $PSScriptRoot '../../global.json') -Raw | ConvertFrom-Json
}

It 'keeps the bootstrap, workload provisioning, and provenance SDK pins aligned' {
$sdkVersion = $versions.SelectSingleNode(
'/Project/PropertyGroup/MicrosoftNETSdkPackageVersion').InnerText
$globalJson.tools.dotnet | Should -Be $sdkVersion
$versionDetails.SelectSingleNode(
"/Dependencies/ProductDependencies/Dependency[@Name='Microsoft.NET.Sdk']").Version |
Should -Be $sdkVersion
}

It 'aligns <Platform> target frameworks with the selected Apple SDK' -TestCases @(
@{ Platform = 'Ios'; SdkAlias = 'MicrosoftiOSSdkPackageVersion' }
@{ Platform = 'Tvos'; SdkAlias = 'MicrosofttvOSSdkPackageVersion' }
@{ Platform = 'MacCatalyst'; SdkAlias = 'MicrosoftMacCatalystSdkPackageVersion' }
@{ Platform = 'Macos'; SdkAlias = 'MicrosoftmacOSSdkPackageVersion' }
) {
param($Platform, $SdkAlias)

$reference = $versions.SelectSingleNode("/Project/PropertyGroup/$SdkAlias").InnerText
$referenceMatch = [regex]::Match($reference, '^\$\((?<property>[A-Za-z0-9_]+)\)$')
$referenceMatch.Success | Should -BeTrue
$sdkProperty = $referenceMatch.Groups['property'].Value
$sdkVersion = $versions.SelectSingleNode("/Project/PropertyGroup/$sdkProperty").InnerText
[version]$version = ($sdkVersion -split '-')[0]
$platformVersion = "$($version.Major).$($version.Minor)"

$buildProps.SelectSingleNode(
"/Project/PropertyGroup/${Platform}TargetFrameworkVersionSdkDefault").InnerText |
Should -Be $platformVersion
$buildProps.SelectSingleNode(
"/Project/PropertyGroup/${Platform}TargetFrameworkVersion").InnerText |
Should -Be $platformVersion
}
}

It 'fails before simulator setup when the required Xcode is missing' {
$missingXcodeMatch = [regex]::Match(
$provision,
'(?s)if \[\[ -z "\$XCODE_PATH" \]\]; then.*?\r?\n fi')

$missingXcodeMatch.Success | Should -BeTrue
$missingXcodeMatch.Value | Should -Match 'task\.logissue type=error'
$missingXcodeMatch.Value | Should -Match 'Update the macOS agent image'
$missingXcodeMatch.Value | Should -Match '(?m)^\s*exit 1\r?$'
$missingXcodeMatch.Value | Should -Not -Match 'LATEST_XCODE'
}

It 'runs the Helix monitor in the submission pool with the appropriate Linux image' {
$monitorMatch = [regex]::Match(
$helixStage,
'(?ms)^ - job: HelixJobMonitor\r?\n.*?(?=^ steps:)')

$monitorMatch.Success | Should -BeTrue
$monitorMatch.Value | Should -Match (
[regex]::Escape('name: ${{ parameters.helixPool.name }}'))
$monitorMatch.Value | Should -Not -Match 'DncEng(Public|Internal)BuildPool'
$monitorMatch.Value | Should -Match (
'(?s)eq\(variables\[''System.TeamProject''\], ''public''\).*?' +
'demands: ImageOverride -equals build\.azurelinux\.3\.amd64\.open')
$monitorMatch.Value | Should -Match (
'(?s)\$\{\{ else \}\}:.*?demands: ImageOverride -equals build\.azurelinux\.3\.amd64\r?\n')
}
}
32 changes: 17 additions & 15 deletions eng/pipelines/common/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,10 @@ steps:
done

if [[ -z "$XCODE_PATH" ]]; then
echo "WARNING: No exact match for requested Xcode version ${ORIGINAL_VERSION}"
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
Comment on lines +172 to +175
fi

sudo xcode-select -s "$XCODE_PATH"
Expand Down Expand Up @@ -218,8 +209,12 @@ steps:
exit 1
fi

RUNTIME_ARCHITECTURE=universal
if [[ "$(uname -m)" == "arm64" ]]; then
RUNTIME_ARCHITECTURE=arm64
fi
# Keep recovery downloads pinned too: a runtime newer than Xcode can break actool/ibtool.
DOWNLOAD_ARGS=(-downloadPlatform iOS -architectureVariant universal -buildVersion "${MAJOR}.${MINOR}")
DOWNLOAD_ARGS=(-downloadPlatform iOS -architectureVariant "$RUNTIME_ARCHITECTURE" -buildVersion "${MAJOR}.${MINOR}")

# `simctl runtime list --json` reports disk images (including stuck
# "(Deleting)" images), unlike `simctl list runtimes -j`, which reports
Expand Down Expand Up @@ -251,8 +246,15 @@ steps:
printf '%s\n' "${counts%%$'\t'*}"
}

RC=0
sudo xcodebuild "${DOWNLOAD_ARGS[@]}" || RC=$?
DOWNLOAD_LOG=$(mktemp) || exit 1
sudo xcodebuild "${DOWNLOAD_ARGS[@]}" 2>&1 | tee "$DOWNLOAD_LOG"
RC=${PIPESTATUS[0]}
if grep -Fq "is not available for download." "$DOWNLOAD_LOG"; then
rm -f "$DOWNLOAD_LOG"
echo "##vso[task.logissue type=error]iOS ${MAJOR}.${MINOR} (${RUNTIME_ARCHITECTURE}) is unavailable for download. Check the selected Xcode and runtime architecture; simulator recovery cannot fix an unavailable download."
exit 1
fi
rm -f "$DOWNLOAD_LOG"
if [[ "$RC" != "0" ]]; then
echo "First attempt failed with exit code $RC, deleting all simulator runtimes and trying again..."
# Exit code 70 ("Unable to connect to simulator") means CoreSimulatorService is
Expand Down
Loading
Loading