Skip to content

[ci] Fix simulator install failures and artifact publishing for all pipeline types#33999

Merged
mattleibow merged 10 commits intomainfrom
fix/ci-simulator-install
Feb 13, 2026
Merged

[ci] Fix simulator install failures and artifact publishing for all pipeline types#33999
mattleibow merged 10 commits intomainfrom
fix/ci-simulator-install

Conversation

@mattleibow
Copy link
Copy Markdown
Member

@mattleibow mattleibow commented Feb 11, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Three CI pipeline fixes:

  1. Simulator install error handling — Stop silently swallowing simulator installation failures
  2. Artifact publishing for all pipelines — Use arcade publish template so artifacts are published on all pipeline types
  3. Build number format for arcade SDK — Set explicit format so version calculation works

Fix 1: Simulator Install Failures

The "Install Simulator Runtimes" CI step was silently swallowing failures.

Problems Fixed

  1. exit 0 when Xcode not found — Changed to exit 1
  2. Exit code 70 treated as success — Now triggers retry
  3. continueOnError: true — Removed

What Changed (provision.yml)

  • Any non-zero exit from xcodebuild -downloadPlatform triggers a retry
  • After download, verify at least one simulator runtime is installed
  • If no runtimes found, build fails with clear error

Fix 2: Artifact Publishing

dotnet-maui-build was not publishing MacNativeArtifacts because templateContext.outputs only works with 1ES extends: wrapper.

Solution

Use arcade core-templates/steps/publish-pipeline-artifacts.yml for all artifact publishing:

Pipeline is1ESPipeline Task Used
maui-pr (public) false PublishPipelineArtifact@1
dotnet-maui-build (internal) false PublishPipelineArtifact@1
dotnet-maui (official) true 1ES.PublishPipelineArtifact@1

What Changed (stage-pack.yml, ci-official.yml)

  • Added is1ESPipeline parameter to stage-pack.yml
  • Replaced all conditional publish logic with unified arcade step template

Fix 3: Build Number Format

dotnet-maui-build failed with:

error MSB4186: Method '[MSBuild]::Add' not found

Root Cause

The arcade SDK Version.BeforeCommonTargets.targets expects OfficialBuildId in format yyyyMMdd.r (e.g., 20260212.1). The code used $(BUILD.BUILDNUMBER) which depends on the Azure DevOps pipeline's build number format — not guaranteed to match the expected format.

Solution

Set the build number format explicitly in ci.yml using the name: property:

name: $(Date:yyyyMMdd).$(Rev:r)

This ensures $(BUILD.BUILDNUMBER) always has the correct format for arcade SDK version calculation.

…ontinuing

- Change exit 0 to exit 1 when Xcode version is not found
- Remove continueOnError: true from Install Simulator Runtimes step
- Stop treating exit code 70 as success - retry on any failure
- Add verification step that checks simulator runtimes were actually installed
- Unify download logic for Xcode 26.0.x and other versions
Copilot AI review requested due to automatic review settings February 11, 2026 21:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens macOS CI provisioning so simulator runtime installation failures are surfaced immediately, avoiding hard-to-diagnose downstream build errors.

Changes:

  • Fail the “Select Xcode Version” step when no matching Xcode is found (exit 1 instead of exit 0).
  • Remove continueOnError: true from “Install Simulator Runtimes” so failures properly fail the job.
  • Unify simulator runtime download + retry flow and add a post-download verification that at least one runtime is installed.

Comment thread eng/pipelines/common/provision.yml
Comment thread eng/pipelines/common/provision.yml
Comment thread eng/pipelines/common/provision.yml
@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-devicetests

@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

The templateContext.outputs for pipelineArtifact used incorrect field
names (artifact/path) instead of the 1ES-required names
(artifactName/targetPath), causing internal builds to silently skip
publishing MacNativeArtifacts, APIScanFiles, and Metadata artifacts.
The dotnet-maui-build definition uses ci.yml which does NOT have the
1ES extends template wrapper. Without that wrapper, templateContext.outputs
is just ignored metadata - no publish step is ever generated.

Fix: Remove the runAsPublic guard on the inline publish: step so it runs
for ALL builds. Also remove the templateContext.outputs for MacNativeArtifacts
since the inline publish: step now handles all cases (avoiding duplicate
artifact conflicts when ci-official.yml runs with 1ES wrapper).
…nism

The previous approach used runAsPublic to select between templates-official
(1ES) and templates (non-official). This conflated 'internal build' with
'1ES managed pipeline'. dotnet-maui-build uses ci.yml (no 1ES extends)
with runAsPublic: false, so it got templates-official which puts outputs
in templateContext - but without the 1ES extends wrapper, nothing processes
templateContext into actual publish tasks.

Fix: Add is1ESPipeline parameter (default: false). Only ci-official.yml
passes is1ESPipeline: true. Template selection and publish mechanism are
now keyed off is1ESPipeline:
- 1ES (ci-official.yml): templateContext.outputs → 1ES wrapper processes
- Non-1ES (ci.yml): inline publish: steps → works everywhere
…publishing

Replace conditional templateContext.outputs (1ES only) and inline publish:
(non-1ES only) with the arcade core-templates/steps/publish-pipeline-artifacts
step template. This template automatically dispatches to the correct task:
- 1ES pipelines: 1ES.PublishPipelineArtifact@1
- Non-1ES pipelines: PublishPipelineArtifact@1

This eliminates all conditional publish logic while maintaining 1ES compliance.
Applies to MacNativeArtifacts, APIScanFiles, and Metadata artifacts.
@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-devicetests

@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-uitests

@mattleibow mattleibow changed the title [ci] Fix simulator install: fail build on error instead of silently continuing [ci] Fix simulator install failures and artifact publishing for all pipeline types Feb 12, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

The arcade SDK Version.BeforeCommonTargets.targets expects OfficialBuildId
in format 'yyyyMMdd.r'. The dotnet-maui-build pipeline uses BUILD.BUILDNUMBER
which depends on the Azure DevOps default format.

Fix: Explicitly set the build number format in ci.yml using the 'name:' property.
This ensures BUILD.BUILDNUMBER always has the correct format for arcade.
@mattleibow mattleibow force-pushed the fix/ci-simulator-install branch from b3c2df0 to aad2333 Compare February 12, 2026 21:17
@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-devicetests

@mattleibow
Copy link
Copy Markdown
Member Author

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow mattleibow merged commit 9cbf19a into main Feb 13, 2026
128 of 162 checks passed
@mattleibow mattleibow deleted the fix/ci-simulator-install branch February 13, 2026 00:55
TamilarasanSF4853 pushed a commit to TamilarasanSF4853/maui that referenced this pull request Mar 2, 2026
…ipeline types (dotnet#33999)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Three CI pipeline fixes:

1. **Simulator install error handling** — Stop silently swallowing
simulator installation failures
2. **Artifact publishing for all pipelines** — Use arcade publish
template so artifacts are published on all pipeline types
3. **Build number format for arcade SDK** — Set explicit format so
version calculation works

---

## Fix 1: Simulator Install Failures

The "Install Simulator Runtimes" CI step was silently swallowing
failures.

### Problems Fixed

1. **`exit 0` when Xcode not found** — Changed to `exit 1`
2. **Exit code 70 treated as success** — Now triggers retry
3. **`continueOnError: true`** — Removed

### What Changed (provision.yml)

- Any non-zero exit from `xcodebuild -downloadPlatform` triggers a retry
- After download, verify at least one simulator runtime is installed
- If no runtimes found, build fails with clear error

---

## Fix 2: Artifact Publishing

`dotnet-maui-build` was not publishing MacNativeArtifacts because
`templateContext.outputs` only works with 1ES `extends:` wrapper.

### Solution

Use arcade `core-templates/steps/publish-pipeline-artifacts.yml` for all
artifact publishing:

| Pipeline | `is1ESPipeline` | Task Used |
|---|---|---|
| `maui-pr` (public) | `false` | `PublishPipelineArtifact@1` |
| `dotnet-maui-build` (internal) | `false` | `PublishPipelineArtifact@1`
|
| `dotnet-maui` (official) | `true` | `1ES.PublishPipelineArtifact@1` |

### What Changed (stage-pack.yml, ci-official.yml)

- Added `is1ESPipeline` parameter to `stage-pack.yml`
- Replaced all conditional publish logic with unified arcade step
template

---

## Fix 3: Build Number Format

`dotnet-maui-build` failed with:
```
error MSB4186: Method '[MSBuild]::Add' not found
```

### Root Cause

The arcade SDK `Version.BeforeCommonTargets.targets` expects
`OfficialBuildId` in format `yyyyMMdd.r` (e.g., `20260212.1`). The code
used `$(BUILD.BUILDNUMBER)` which depends on the Azure DevOps pipeline's
build number format — not guaranteed to match the expected format.

### Solution

Set the build number format explicitly in `ci.yml` using the `name:`
property:

```yaml
name: $(Date:yyyyMMdd).$(Rev:r)
```

This ensures `$(BUILD.BUILDNUMBER)` always has the correct format for
arcade SDK version calculation.
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants