diff --git a/.github/docs/maui-ci-facts.md b/.github/docs/maui-ci-facts.md index 80860ecd8efb..a9c04a2cfc16 100644 --- a/.github/docs/maui-ci-facts.md +++ b/.github/docs/maui-ci-facts.md @@ -51,6 +51,32 @@ Most failures are in `maui-pr`. Focus on the first failing pipeline before other `/azp run maui-pr` (or `maui-pr-devicetests`, `maui-pr-uitests`). `maui-pr-devicetests` and `maui-pr-uitests` may not run automatically depending on the changed files. +### Shared macOS image selection + +GoldenGate routing is a temporary RC2 workaround. Return to the standard images +once they include Xcode compatible with the pinned Apple SDK. + +All public and internal macOS pool defaults in `ci.yml`, `ci-device-tests.yml`, +and `ci-uitests.yml` use `AcesShared` with +`ImageOverride -equals $(AcesMacImageOverride)`. This covers build, pack, integration, +shared UI app builds, iOS and MacCatalyst UI runs, and device-test app builds. +Pool parameters still support caller overrides. Select the image +once in `eng/pipelines/common/variables.yml`; RC2 uses `ACES_VM_SharedPool_GoldenGate`, +the image selected for official builds in #38852. Do not pin an Xcode application +path in individual pipeline demands. + +The Aces image is independent of `HostedMacImage`: Azure Pipelines hosted images +and Aces images receive new Xcode versions at different times. The older Aces Tahoe +image only had Xcode 26.x, which cannot build the RC2 Apple SDK. + +Keep shared Xcode selection and simulator provisioning enabled for the test jobs. +Provisioning accepts the image-selected Xcode when its reported major/minor version +matches `$(XCODE)`, including prerelease bundles with nonstandard filenames. If it +does not match, the existing named-bundle lookup and missing-Xcode error still apply. +The official pack-only job can use `skipXcode: true`, but that also skips simulator +setup in `common/provision.yml`, which iOS UI tests need. Device-test execution +still uses the Helix queues in `eng/helix_xharness.proj`. + ## AzDO data sources - Primary access is **anonymous/public** REST: `builds`, `builds/{id}/timeline`, diff --git a/eng/pipelines/ci-device-tests.yml b/eng/pipelines/ci-device-tests.yml index af60363fe6ef..8dcede72da09 100644 --- a/eng/pipelines/ci-device-tests.yml +++ b/eng/pipelines/ci-device-tests.yml @@ -55,6 +55,8 @@ variables: parameters: +# Temporary RC2 workaround: macOS defaults use GoldenGate until standard images +# provide Xcode compatible with the pinned Apple SDK. # Internal pools (dnceng) - name: windowsPoolInternal type: object @@ -68,14 +70,18 @@ parameters: - name: macOSTestPoolInternal type: object default: - name: Azure Pipelines - vmImage: macOS-15-arm64 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) + os: macOS - name: macOSPoolInternal type: object default: - name: Azure Pipelines - vmImage: macOS-15-arm64 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) + os: macOS # Public pools (dnceng-public) - name: windowsPoolPublic diff --git a/eng/pipelines/ci-uitests.yml b/eng/pipelines/ci-uitests.yml index e6c6b41d50c1..2139f038e803 100644 --- a/eng/pipelines/ci-uitests.yml +++ b/eng/pipelines/ci-uitests.yml @@ -64,12 +64,15 @@ parameters: type: boolean default: false + # Temporary RC2 workaround: macOS build and UI-test pools use GoldenGate until + # standard images provide Xcode compatible with the pinned Apple SDK. # Internal pools (dnceng) - name: androidPoolInternal type: object default: - name: Azure Pipelines - vmImage: macOS-15-arm64 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) - name: androidPoolLinuxInternal type: object @@ -81,8 +84,9 @@ parameters: - name: iosPoolInternal type: object default: - name: Azure Pipelines - vmImage: macOS-15-arm64 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) - name: windowsBuildPoolInternal type: object @@ -101,8 +105,9 @@ parameters: - name: macosPoolInternal type: object default: - name: Azure Pipelines - vmImage: macOS-14 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) # Public pools (dnceng-public) - name: androidPoolPublic @@ -143,8 +148,9 @@ parameters: - name: macosPoolPublic type: object default: - name: Azure Pipelines - vmImage: macOS-14 + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) stages: diff --git a/eng/pipelines/ci.Tests.ps1 b/eng/pipelines/ci.Tests.ps1 deleted file mode 100644 index b9efc6b69106..000000000000 --- a/eng/pipelines/ci.Tests.ps1 +++ /dev/null @@ -1,115 +0,0 @@ -#Requires -Modules Pester - -Describe 'ci.yml provisioning' { - BeforeAll { - $pipeline = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'ci.yml') -Raw - $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 'Apple dependency 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]$buildTargets = Get-Content -LiteralPath ( - Join-Path $PSScriptRoot '../../Directory.Build.targets') -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 - $nativeProject = Get-Content -LiteralPath ( - Join-Path $PSScriptRoot '../../src/Core/AppleNative/PlatformInterop/MauiPlatformInterop.xcodeproj/project.pbxproj') -Raw - } - - It 'uses a consistent SDK new enough to run the Apple 27 binding generator' { - $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 - [semver]$sdkVersion | Should -BeGreaterOrEqual ([semver]'11.0.100-rc.2.26465.108') - } - - It 'aligns native and managed iOS deployment targets with the Xcode 27 minimum' { - $iosProperties = $buildTargets.Project.PropertyGroup | - Where-Object { $_.Condition -eq "'`$(_MauiTargetPlatformIsiOS)' == 'True'" } - - $iosProperties.SupportedOSPlatformVersion | Should -Be '15.0' - $iosProperties.TargetPlatformMinVersion | Should -Be '15.0' - ([regex]::Matches($nativeProject, '(?m)^\s*IPHONEOS_DEPLOYMENT_TARGET = 15\.0;')).Count | - Should -Be 2 - $nativeProject | Should -Not -Match 'IPHONEOS_DEPLOYMENT_TARGET\[sdk=iphoneos' - } - - It 'aligns 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, '^\$\((?[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 'selects Xcode 27 RC agents for public macOS build, pack, and integration jobs' { - $buildPools = [regex]::Match( - $pipeline, '(?ms)^- name: BuildPlatformsPublic\r?\n.*?(?=^- name:)').Value - $macPools = [regex]::Match( - $pipeline, '(?ms)^- name: MacOSPool\r?\n.*?(?=^- name:)').Value - $xcodeDemand = [regex]::Escape( - 'xcode -equals /Applications/Xcode_27.0.0-rc.app/Contents/Developer') - - $buildPools | Should -Match '(?s)- name: MAUI\s+demands:' - $buildPools | Should -Match $xcodeDemand - $macPools | Should -Match '(?s)public:\s+name: MAUI\s+demands:' - $macPools | Should -Match $xcodeDemand - } - - 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') - } -} diff --git a/eng/pipelines/ci.yml b/eng/pipelines/ci.yml index a753ae2ad083..e543957f823a 100644 --- a/eng/pipelines/ci.yml +++ b/eng/pipelines/ci.yml @@ -50,6 +50,8 @@ parameters: - Debug - Release +# Temporary RC2 workaround: macOS defaults use GoldenGate until standard images +# provide Xcode compatible with the pinned Apple SDK. - name: BuildPlatforms type: object default: @@ -59,8 +61,9 @@ parameters: os: Windows buildScript: $(_buildScript) sln: '$(Build.SourcesDirectory)/Microsoft.Maui.sln' - - name: MAUI - vmImage: MAUI + - name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) os: macOS buildScript: $(_buildScriptMacOS) sln: '$(Build.SourcesDirectory)/Microsoft.Maui-mac.slnf' @@ -74,9 +77,9 @@ parameters: os: Windows buildScript: $(_buildScript) sln: '$(Build.SourcesDirectory)/Microsoft.Maui.sln' - - name: MAUI + - name: AcesShared demands: - - xcode -equals /Applications/Xcode_27.0.0-rc.app/Contents/Developer + - ImageOverride -equals $(AcesMacImageOverride) os: macOS buildScript: $(_buildScriptMacOS) sln: '$(Build.SourcesDirectory)/Microsoft.Maui-mac.slnf' @@ -95,24 +98,21 @@ parameters: - ImageOverride -equals 1es-windows-2022-open os: windows -# Typically X64 pools but XCode 26.2 isn't available yet for the Azure Pipelines X64 Pools +# Apple jobs share the Aces image used by UI and device test builds. - name: MacOSPool type: object default: internal: - name: Azure Pipelines - vmImage: $(HostedMacImage) + name: AcesShared + demands: + - ImageOverride -equals $(AcesMacImageOverride) + os: macOS label: macOS public: - name: MAUI + name: AcesShared demands: - - xcode -equals /Applications/Xcode_27.0.0-rc.app/Contents/Developer + - ImageOverride -equals $(AcesMacImageOverride) label: macOS -# Switch back to this once XCode 26.2 is available on Azure Pipelines -# name: Azure Pipelines -# vmImage: $(HostedMacImage) -# os: macOS -# label: macOS - name: AndroidPoolLinux type: object @@ -122,8 +122,8 @@ parameters: - ImageOverride -equals 1ESPT-Ubuntu22.04 # Condition for MacOSPool comparison lanes (non-ARM64) -# Currently disabled - both pools use MAUI self-hosted since Xcode 26.2 isn't available on Azure Pipelines x64. -# Re-enable once Azure Pipelines has Xcode 26.2 on x64 pools. +# These additional comparison lanes remain disabled; the standard build, pack, +# and ARM64 integration lanes provide public macOS coverage. # Original condition: or(and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), and(startsWith(variables['Build.SourceBranch'], 'refs/heads/net'), endsWith(variables['Build.SourceBranch'], '.0')), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/inflight/'))), and(eq(variables['Build.Reason'], 'PullRequest'), or(and(startsWith(variables['System.PullRequest.TargetBranch'], 'net'), endsWith(variables['System.PullRequest.TargetBranch'], '.0')), startsWith(variables['System.PullRequest.TargetBranch'], 'release/'), startsWith(variables['System.PullRequest.TargetBranch'], 'inflight/')))) - name: macOSPoolLaneCondition type: string diff --git a/eng/pipelines/common/provision.yml b/eng/pipelines/common/provision.yml index 433519f18ab0..4d6b3b14c8b2 100644 --- a/eng/pipelines/common/provision.yml +++ b/eng/pipelines/common/provision.yml @@ -155,7 +155,22 @@ steps: echo "Will try Xcode versions in order: ${VERSIONS_TO_TRY[*]}" + # Temporary RC2 workaround for GoldenGate's nonstandard prerelease bundle name. + # Remove this fast path once standard images provide conventionally named, compatible Xcode. + if SELECTED_XCODE_PATH=$(xcode-select --print-path) && SELECTED_XCODE_INFO=$(xcodebuild -version); then + SELECTED_XCODE_VERSION=$(printf '%s\n' "$SELECTED_XCODE_INFO" | awk '$1 == "Xcode" { print $2; exit }') + if [[ -d "$SELECTED_XCODE_PATH" && ( "$SELECTED_XCODE_VERSION" == "$XCODE_MAJOR_MINOR" || "$SELECTED_XCODE_VERSION" == "$XCODE_MAJOR_MINOR".* ) ]]; then + XCODE_PATH="$SELECTED_XCODE_PATH" + echo "Using image-selected Xcode $SELECTED_XCODE_VERSION at $XCODE_PATH" + fi + else + echo "##vso[task.logissue type=warning]Unable to inspect the selected Xcode; checking installed versions." + fi + for VERSION in "${VERSIONS_TO_TRY[@]}"; do + if [[ -n "$XCODE_PATH" ]]; then + break + fi CANDIDATE_PATH="/Applications/Xcode_${VERSION}.app" echo "Checking for Xcode ${VERSION} at ${CANDIDATE_PATH}..." if [[ -d "$CANDIDATE_PATH" ]]; then diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index d82e63183e9c..2adb7938a15b 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -35,17 +35,13 @@ variables: - name: signingCondition value: $[or( eq(variables['Sign'], 'true'), in(variables['Build.SourceBranch'], 'refs/heads/net9.0', 'refs/heads/net10.0', 'refs/heads/main', 'refs/heads/inflight/current' ), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') )] # Common Agent Pools in use -# hostedMacImage is the source of truth for Azure Pipelines hosted macOS image lanes. -# Keep the AcesMacImageOverride mapping below aligned so AcesShared lanes target -# the corresponding macOS/Xcode generation. +# Hosted and Aces images are independent: the providers receive new Xcode versions at different times. - name: HostedMacImage value: ${{ parameters.hostedMacImage }} -- ${{ if eq(parameters.hostedMacImage, 'macOS-26') }}: - - name: AcesMacImageOverride - value: ACES_VM_SharedPool_Tahoe -- ${{ if ne(parameters.hostedMacImage, 'macOS-26') }}: - - name: AcesMacImageOverride - value: Unsupported_HostedMacImage_${{ parameters.hostedMacImage }}_Update_AcesMacImageOverride +# Temporary RC2 workaround for Xcode availability. Return to the regular Aces image +# once it supports the pinned Apple SDK. +- name: AcesMacImageOverride + value: ACES_VM_SharedPool_GoldenGate - name: HostedWindowsImage value: windows-2022 - name: LogDirectory