[ci] Fix macOS hosted image label on internal pipeline#12005
Open
jonathanpeppers wants to merge 2 commits into
Open
[ci] Fix macOS hosted image label on internal pipeline#12005jonathanpeppers wants to merge 2 commits into
jonathanpeppers wants to merge 2 commits into
Conversation
PR #11708 bumped `HostedMacImage` to `macOS-15-arm64`, but Microsoft has paused the macOS-15 ARM64 hosted-agent limited public preview on the `Azure Pipelines` pool. DevDiv was not already onboarded to that preview (it was on `macOS-14-arm64`), so the `macOS-15-arm64` label no longer routes and internal builds fail with: No image label found to route agent pool Azure Pipelines. The only valid macOS labels on the hosted `Azure Pipelines` pool are now `macOS-14`, `macOS-15`, and `macOS-26` (no ARM64 variant). Point `HostedMacImage` at `macOS-15` (Intel), matching what the public pipeline already used. Also remove the now-redundant `HostedMacImage` override in `azure-pipelines-public.yaml`, since it matches the new default. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Azure DevOps pipeline variables so internal DevDiv macOS jobs route to a valid Microsoft-hosted agent image label, after the macOS-15-arm64 limited preview was paused.
Changes:
- Change the default
HostedMacImagefrommacOS-15-arm64tomacOS-15in the shared variables template. - Remove the redundant
HostedMacImageoverride from the public pipeline since it now matches the template default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| build-tools/automation/yaml-templates/variables.yaml | Pins HostedMacImage to macOS-15 so internal hosted macOS jobs can route to available agents. |
| build-tools/automation/azure-pipelines-public.yaml | Removes the now-redundant HostedMacImage override in the public pipeline variables section. |
The Java.Interop Mac lane hard-coded `nativeAotRid: osx-arm64` for the NativeAOT sample. Now that the hosted Mac pool runs on Intel (macOS-15 x64), publishing/running Hello-NativeAOTFromJNI for `osx-arm64` produces a .dylib the x64 JDK cannot dlopen:
incompatible architecture (have 'arm64', need 'x86_64')
The run step is `continueOnError: true`, but it still records an error that the trailing `fail-on-issue` step turns into a lane failure.
Detect the agent architecture at runtime via `Agent.OSArchitecture` and publish/run the sample for the matching RID (osx-arm64 on Apple Silicon, osx-x64 on Intel), so the lane stays correct regardless of the hosted pool's architecture.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
simonrozsival
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Builds on the internal DevDiv pipeline started failing on the macOS MSBuild test jobs with:
PR #11708 bumped
HostedMacImagefrommacOS-14-arm64tomacOS-15-arm64. However, Microsoft has paused the macOS-15 ARM64 hosted-agent limited public preview on theAzure Pipelinespool:DevDiv was not already onboarded to the
macOS-15-arm64preview (it had been onmacOS-14-arm64), so that label no longer routes to any agent, and the internal builds fail. The only valid macOS labels on the hostedAzure Pipelinespool are nowmacOS-14,macOS-15, andmacOS-26(no ARM64 variant).What
variables.yaml: pointHostedMacImageatmacOS-15(Intel) instead of the pausedmacOS-15-arm64. This matches the label the public pipeline was already using, which is whydnceng-publicstayed green.azure-pipelines-public.yaml: drop the now-redundantHostedMacImage: macOS-15override, since it is identical to the new default. The public-onlyLinuxPoolImageoverride stays, as it has no default.HostedMacImageWithEmulatorwas alreadymacOS-15(never had the-arm64suffix), so no change was needed there.Follow-on: Java.Interop Mac lane
Switching the hosted Mac pool from ARM64 to Intel also broke the Java.Interop Mac lane, which had hard-coded
nativeAotRid: osx-arm64. Publishing/running theHello-NativeAOTFromJNINativeAOT sample forosx-arm64on an x64 agent produces a.dylibthe x64 JDK cannotdlopen:That run step is
continueOnError: true, but it still records an error that the trailingfail-on-issuestep turns into a lane failure.stage-java-interop-tests.yaml: detect the agent architecture at runtime viaAgent.OSArchitectureand publish/run the sample for the matching RID (osx-arm64on Apple Silicon,osx-x64on Intel), so the lane stays correct regardless of the hosted pool's architecture.Why not just omit the RID and let the CLI pick the default?
The lane targets
net10.0on a .NET 10 SDK, so you might expectPublishAotto infer the host RID automatically. It does, but only forpublish, and the lane runs two commands:dotnet publishstep would be fine without-r:PublishAot=truetriggers an automaticRuntimeIdentifier, so it infers the host RID and writes tobin/Release/<host-rid>/publish/.RunJavaSamplestep would break: that automatic-RID behavior is restricted todotnet publish(publish-only note). The run step is adotnet build, so without-ritsRuntimeIdentifierstays empty.RunJavaSampleexecutes from the publish output directory:$(PublishDir)defaults tobin/$(Configuration)/$(TargetFramework)/$(RuntimeIdentifier)/publish/. If we omit the RID,publishwrites to.../osx-x64/publish/(inferred RID) while thebuild/run step looks in.../net10.0/publish/(no RID) - so the.dyliband jars aren't found and the run fails. Passing an explicit RID to both commands keeps their$(PublishDir)aligned, which is why runtime arch detection (rather than omitting the RID) is the correct fix.