From 1874da3f991ca820e6982de2731ec27555c02cfa Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 7 Jul 2026 08:33:07 -0500 Subject: [PATCH 1/2] [ci] Fix macOS hosted image label on internal pipeline 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> --- build-tools/automation/azure-pipelines-public.yaml | 2 -- build-tools/automation/yaml-templates/variables.yaml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build-tools/automation/azure-pipelines-public.yaml b/build-tools/automation/azure-pipelines-public.yaml index 436dc31d184..ef6e0a58408 100644 --- a/build-tools/automation/azure-pipelines-public.yaml +++ b/build-tools/automation/azure-pipelines-public.yaml @@ -45,8 +45,6 @@ variables: - name: DefaultJavaSdkMajorVersion value: 21 # Override pool images for public Microsoft-hosted agents -- name: HostedMacImage - value: macOS-15 - name: LinuxPoolImage value: ubuntu-22.04 - name: NetCorePublicPoolName diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 629ec32e7a1..cc638e08919 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -30,7 +30,7 @@ variables: - name: GitHub.Token value: $(github--pat--vs-mobiletools-engineering-service2) - name: HostedMacImage - value: macOS-15-arm64 + value: macOS-15 - name: HostedMacImageWithEmulator value: macOS-15 - name: SharedMacPool From 551b592429207e3b6bbf58b7939c6c2ddd46b7ce Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 7 Jul 2026 16:06:29 -0500 Subject: [PATCH 2/2] [ci] Detect NativeAOT RID by agent arch in Java.Interop Mac lane 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> --- .../yaml-templates/stage-java-interop-tests.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/stage-java-interop-tests.yaml b/build-tools/automation/yaml-templates/stage-java-interop-tests.yaml index 3739f6a9662..92aff51cf19 100644 --- a/build-tools/automation/yaml-templates/stage-java-interop-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-java-interop-tests.yaml @@ -104,6 +104,18 @@ stages: fi displayName: Ensure cmake is installed + # The hosted macOS pool architecture can change between Intel (osx-x64) and + # Apple Silicon (osx-arm64), so detect it at runtime and publish/run the + # NativeAOT sample for the matching RID. Otherwise the produced .dylib fails + # to dlopen with an "incompatible architecture" error. + - bash: | + if [ "$(Agent.OSArchitecture)" = "ARM64" ]; then + echo "##vso[task.setvariable variable=NativeAOTRid]osx-arm64" + else + echo "##vso[task.setvariable variable=NativeAOTRid]osx-x64" + fi + displayName: Determine NativeAOT RID + - template: /external/Java.Interop/build-tools/automation/templates/install-dependencies.yaml@self - template: /external/Java.Interop/build-tools/automation/templates/core-build.yaml@self @@ -111,7 +123,7 @@ stages: - template: /external/Java.Interop/build-tools/automation/templates/core-tests.yaml@self parameters: runNativeTests: true - nativeAotRid: osx-arm64 + nativeAotRid: $(NativeAOTRid) platformName: .NET - MacOS - template: /external/Java.Interop/build-tools/automation/templates/fail-on-dirty-tree.yaml@self