From a5fb9687c0962859d9a4823b1146ea8ceaff1dd3 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 11 Mar 2026 13:44:30 +0100 Subject: [PATCH 01/73] Enable NativeAOT library tests on Apple mobile platforms Replace NativeAOT runtime test legs with library test legs on iOS/tvOS devices, iOS/tvOS simulators, and Mac Catalyst. The runtime tests (nativeaot/SmokeTests) provide minimal value on mobile since the compiler doesn't meaningfully distinguish between iOS and macOS. Library tests exercise OS-specific APIs (crypto, networking, etc.) that are the real quality gate. Changes: - ioslike: remove NativeAOT runtime test leg, update existing library test leg to use dynamic smoke test arg - ioslikesimulator: replace NativeAOT runtime test leg with library test leg, fix isiOSLikeSimulatorOnlyBuild parameter - maccatalyst: replace both NativeAOT runtime test legs (regular + AppSandbox) with library test legs, fix coreclrContainsChange variable (was incorrectly using monoContainsChange) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../runtime-extra-platforms-ioslike.yml | 42 +---------------- ...ntime-extra-platforms-ioslikesimulator.yml | 36 +++++--------- .../runtime-extra-platforms-maccatalyst.yml | 47 ++++++++----------- 3 files changed, 34 insertions(+), 91 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index da7fff53452b34..ab089c738f5b08 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -118,8 +118,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: @@ -129,44 +129,6 @@ jobs: testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true -# -# Build the whole product using NativeAOT for iOS/tvOS and run runtime tests with iOS/tvOS devices -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: coreclr - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} - platforms: - - ios_arm64 - - tvos_arm64 - variables: - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_RuntimeTests - timeoutInMinutes: 240 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) - # extra steps, run tests - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: innerloop - useNativeAOTRuntime: true - postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml - parameters: - creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true - testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) - buildAllTestsAsStandalone: true - # # Build the whole product using CoreCLR R2R and run runtime tests # diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 9a5d8939d1f06a..5bd800aeb7c6b1 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -90,49 +90,39 @@ jobs: extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true # -# Build the whole product using Native AOT for iOSSimulator/tvOSSimulator and run runtime tests with iOS/tvOS simulators +# iOS/tvOS simulators +# Build the whole product using Native AOT and run libraries tests # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} platforms: - iossimulator_x64 - iossimulator_arm64 - tvossimulator_arm64 variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: coreclrContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_RuntimeTests + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) # extra steps, run tests - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: innerloop - useNativeAOTRuntime: true postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + - template: /eng/pipelines/libraries/helix.yml parameters: creator: dotnet-bot - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) - buildAllTestsAsStandalone: true + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true # # Build the whole product using CoreCLR R2R and run runtime tests diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index cd2bba5421b151..1f13778bbcbf6d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -127,12 +127,13 @@ jobs: testRunNamePrefixSuffix: Mono_$(_BuildConfig) # -# Build the whole product using Native AOT and run runtime tests +# MacCatalyst +# Build the whole product using Native AOT and run libraries tests # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} @@ -144,34 +145,30 @@ jobs: # map dependencies variables to local variables - name: librariesContainsChange value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ] + - name: coreclrContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_RuntimeTests - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: innerloop - useNativeAOTRuntime: true postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + - template: /eng/pipelines/libraries/helix.yml parameters: creator: dotnet-bot - buildAllTestsAsStandalone: true - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true # -# Build the whole product using Native AOT with the App Sandbox entitlement and run runtime tests +# MacCatalyst +# Build the whole product using Native AOT and run libraries tests +# The test app is built with the App Sandbox entitlement # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} @@ -183,26 +180,20 @@ jobs: # map dependencies variables to local variables - name: librariesContainsChange value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ] + - name: coreclrContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_RuntimeTests_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs -c $(_BuildConfig) + nameSuffix: AllSubsets_NativeAOT_AppSandbox + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true timeoutInMinutes: 180 # extra steps, run tests - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: innerloop - useNativeAOTRuntime: true postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + - template: /eng/pipelines/libraries/helix.yml parameters: creator: dotnet-bot - buildAllTestsAsStandalone: true - testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true /p:DevTeamProvisioning=adhoc /p:EnableAppSandbox=true testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true # # Build the whole product using CoreCLR R2R and run runtime tests From fe0e141073b8bdd4067de65e1ad1f4dd91c8052c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 12 Mar 2026 10:30:11 +0000 Subject: [PATCH 02/73] Update dependencies from https://github.com/dotnet/xharness build 20260312.1 On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 11.0.0-prerelease.26160.2 -> To Version 11.0.0-prerelease.26162.1 --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6b46169cb36d04..8b0f6147ab38c1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26160.2", + "version": "11.0.0-prerelease.26162.1", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index a2269cd6d6c096..98fcfb8250f08e 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26159.1 11.0.0-beta.26159.1 - 11.0.0-prerelease.26160.2 - 11.0.0-prerelease.26160.2 - 11.0.0-prerelease.26160.2 + 11.0.0-prerelease.26162.1 + 11.0.0-prerelease.26162.1 + 11.0.0-prerelease.26162.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e8afb73f0d2a56..e7d05ebf0aaf25 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 5507d7a2f05bb6c073a055ead6ce1c4bbe396cda - + https://github.com/dotnet/xharness - c32a7777a0f8f7a4fc8d9920d445f5f4b5658d38 + ea007a310af356f4ec7e10005f7853e2e32cf775 - + https://github.com/dotnet/xharness - c32a7777a0f8f7a4fc8d9920d445f5f4b5658d38 + ea007a310af356f4ec7e10005f7853e2e32cf775 - + https://github.com/dotnet/xharness - c32a7777a0f8f7a4fc8d9920d445f5f4b5658d38 + ea007a310af356f4ec7e10005f7853e2e32cf775 https://github.com/dotnet/dotnet From 0a9ea0bae5308eba8556d732007201e32095ccc1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 12 Mar 2026 12:00:14 +0000 Subject: [PATCH 03/73] Update dependencies from https://github.com/dotnet/xharness build 20260312.3 On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 11.0.0-prerelease.26160.2 -> To Version 11.0.0-prerelease.26162.3 --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8b0f6147ab38c1..677e5aba954589 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26162.1", + "version": "11.0.0-prerelease.26162.3", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 98fcfb8250f08e..a8a26a78fb40af 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26159.1 11.0.0-beta.26159.1 - 11.0.0-prerelease.26162.1 - 11.0.0-prerelease.26162.1 - 11.0.0-prerelease.26162.1 + 11.0.0-prerelease.26162.3 + 11.0.0-prerelease.26162.3 + 11.0.0-prerelease.26162.3 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e7d05ebf0aaf25..254c5190c6d98a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 5507d7a2f05bb6c073a055ead6ce1c4bbe396cda - + https://github.com/dotnet/xharness - ea007a310af356f4ec7e10005f7853e2e32cf775 + 8fc29af4ca42135c51f1a32c3bd40dd95084d19c - + https://github.com/dotnet/xharness - ea007a310af356f4ec7e10005f7853e2e32cf775 + 8fc29af4ca42135c51f1a32c3bd40dd95084d19c - + https://github.com/dotnet/xharness - ea007a310af356f4ec7e10005f7853e2e32cf775 + 8fc29af4ca42135c51f1a32c3bd40dd95084d19c https://github.com/dotnet/dotnet From 1658ca5a432e1073cdee28a21318d0b064681b9c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 16 Mar 2026 05:01:33 +0000 Subject: [PATCH 04/73] Update dependencies from https://github.com/dotnet/xharness build 20260314.3 On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 11.0.0-prerelease.26160.2 -> To Version 11.0.0-prerelease.26164.3 --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 677e5aba954589..2468cc0fdec265 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26162.3", + "version": "11.0.0-prerelease.26164.3", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index a8a26a78fb40af..33bd0a30c2935d 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26159.1 11.0.0-beta.26159.1 - 11.0.0-prerelease.26162.3 - 11.0.0-prerelease.26162.3 - 11.0.0-prerelease.26162.3 + 11.0.0-prerelease.26164.3 + 11.0.0-prerelease.26164.3 + 11.0.0-prerelease.26164.3 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 254c5190c6d98a..39586554a9ab82 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 5507d7a2f05bb6c073a055ead6ce1c4bbe396cda - + https://github.com/dotnet/xharness - 8fc29af4ca42135c51f1a32c3bd40dd95084d19c + 6fe0045f33ab855e15064acaf63c3bfe9f83a6af - + https://github.com/dotnet/xharness - 8fc29af4ca42135c51f1a32c3bd40dd95084d19c + 6fe0045f33ab855e15064acaf63c3bfe9f83a6af - + https://github.com/dotnet/xharness - 8fc29af4ca42135c51f1a32c3bd40dd95084d19c + 6fe0045f33ab855e15064acaf63c3bfe9f83a6af https://github.com/dotnet/dotnet From e9c07fe8ff250e27e25748cf8df6ddf24d695af3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 17 Mar 2026 16:16:15 +0000 Subject: [PATCH 05/73] Update dependencies from https://github.com/dotnet/xharness build 20260317.2 On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 11.0.0-prerelease.26160.2 -> To Version 11.0.0-prerelease.26167.2 --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2468cc0fdec265..1c8caf7d5da489 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26164.3", + "version": "11.0.0-prerelease.26167.2", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 33bd0a30c2935d..7530c4a9d756a3 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26159.1 11.0.0-beta.26159.1 - 11.0.0-prerelease.26164.3 - 11.0.0-prerelease.26164.3 - 11.0.0-prerelease.26164.3 + 11.0.0-prerelease.26167.2 + 11.0.0-prerelease.26167.2 + 11.0.0-prerelease.26167.2 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 39586554a9ab82..02aaca15dba2e7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 5507d7a2f05bb6c073a055ead6ce1c4bbe396cda - + https://github.com/dotnet/xharness - 6fe0045f33ab855e15064acaf63c3bfe9f83a6af + f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 - + https://github.com/dotnet/xharness - 6fe0045f33ab855e15064acaf63c3bfe9f83a6af + f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 - + https://github.com/dotnet/xharness - 6fe0045f33ab855e15064acaf63c3bfe9f83a6af + f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 https://github.com/dotnet/dotnet From 10f5e12d3db7cdfbb2c5f4d54168297d05e5821f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 18 Mar 2026 12:46:43 +0000 Subject: [PATCH 06/73] Update dependencies from https://github.com/dotnet/xharness build 20260318.1 On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 11.0.0-prerelease.26160.2 -> To Version 11.0.0-prerelease.26168.1 --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1c8caf7d5da489..223740995c4fc4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26167.2", + "version": "11.0.0-prerelease.26168.1", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 7530c4a9d756a3..301458cdb8f3d0 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26159.1 11.0.0-beta.26159.1 - 11.0.0-prerelease.26167.2 - 11.0.0-prerelease.26167.2 - 11.0.0-prerelease.26167.2 + 11.0.0-prerelease.26168.1 + 11.0.0-prerelease.26168.1 + 11.0.0-prerelease.26168.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 02aaca15dba2e7..abaf8fbbb37e51 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 5507d7a2f05bb6c073a055ead6ce1c4bbe396cda - + https://github.com/dotnet/xharness - f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 + 607b3de9cf2dbfec6734e686e68d2813b40b2b51 - + https://github.com/dotnet/xharness - f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 + 607b3de9cf2dbfec6734e686e68d2813b40b2b51 - + https://github.com/dotnet/xharness - f3b160fbbe5a43f6fc03b27629e689ef00de3ef9 + 607b3de9cf2dbfec6734e686e68d2813b40b2b51 https://github.com/dotnet/dotnet From a50e76c8a29ccef39ac13a1220b1c155778587f9 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 23 Mar 2026 14:27:23 +0100 Subject: [PATCH 07/73] Enable iOS/tvOS platforms for builds by removing tracking issue comments in YAML configuration --- .../runtime-extra-platforms-ioslike.yml | 25 ++++++++----------- eng/pipelines/runtime.yml | 15 +++++------ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 84c3ccde3b90c0..ab089c738f5b08 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -23,9 +23,8 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -65,9 +64,8 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - name: _HelixSource @@ -110,9 +108,8 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -144,9 +141,8 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - name: _HelixSource @@ -188,9 +184,8 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 0457b338ce54a5..244f3f5b48fdfa 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1140,9 +1140,8 @@ extends: buildConfig: Release runtimeFlavor: mono platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -1187,9 +1186,8 @@ extends: buildConfig: Release runtimeFlavor: coreclr platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -1234,9 +1232,8 @@ extends: buildConfig: Release runtimeFlavor: coreclr platforms: - # Tracking issue: https://github.com/dotnet/runtime/issues/123796 - # - ios_arm64 - # - tvos_arm64 + - ios_arm64 + - tvos_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange From 1f56b6c4f53b59bc2a08fbd6adbe807fb506c4a9 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 23 Mar 2026 18:16:37 +0100 Subject: [PATCH 08/73] Replace NativeAOT runtime tests with library tests on Apple mobile platforms - Extra platforms: run full library tests (not smoke-only) using _runSmokeTestsOnlyArg which evaluates to RunSmokeTestsOnly=false - runtime.yml: smoke tests now include System.Runtime.Tests for NativeAOT on Apple mobile via tests.proj change - Remove NativeAOT RuntimeTests sections from ioslike, ioslikesimulator, and maccatalyst extra-platforms pipelines - Switch to libraries helix queues and libraries/helix.yml template - Use coreclrContainsChange instead of monoContainsChange for NativeAOT Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/tests.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index d934ee6238bf07..767ab3cb3dfb3d 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -611,6 +611,7 @@ + From c9d4929360df7ff02e40623ef9a98d67909c11ff Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 24 Mar 2026 20:06:43 +0100 Subject: [PATCH 09/73] Add ILC entrypoint for NativeAOT library tests on Apple mobile Library test DLLs have no Main() method, causing ILC to throw 'No entrypoint module' when --splitinit is active. Add AppleTestRunner.dll (which is an EXE with Main) as an additional ILC input to provide the entrypoint, and add published DLLs as ILC references for non-framework dependency resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../apple/data/ProxyProjectForAOTOnHelix.proj | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 30b9edf0ff4f0e..d52b0af4a84798 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -96,6 +96,19 @@ + + + + + + + + From 9c4acbc4112be701e60f1acf405934b8aeaa7dfb Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 25 Mar 2026 10:05:28 +0100 Subject: [PATCH 10/73] Enable console UI template for NativeAOT library tests on Apple mobile When IncludesTestRunner is true with NativeAOT, the AppleTestRunner P/Invokes mono_ios_append_output and mono_ios_set_summary which are only defined in main-console.m. The UseConsoleUITemplate condition previously excluded all NativeAOT builds, causing main-simple.m to be used instead, resulting in undefined symbol linker errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/build/AppleBuild.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index ee15221fca821e..4457a18b28f1b3 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -96,6 +96,7 @@ <_AppleRuntimeConfigFilePath Condition="'$(_AppleRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), '$(AssemblyName).runtimeconfig.json')) <_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), 'runtimeconfig.bin')) true + true From 7a7383d647233481167f3d86389848af4b7ae907 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 25 Mar 2026 15:31:10 +0100 Subject: [PATCH 11/73] Fix AppleTestRunner test discovery for NativeAOT In NativeAOT mode, test assemblies are statically linked into the native binary and no DLL files exist on disk. The file-based discovery (Directory.GetFiles("*.Tests.dll")) finds nothing, causing the runner to exit with 'Test libs were not found' before tests can execute. Add a NativeAOT-aware discovery path that uses AppDomain.CurrentDomain.GetAssemblies() to find test assemblies matching *.Tests when RuntimeFeature.IsDynamicCodeSupported is false. Update GetTestAssemblies() to return the already-loaded Assembly objects directly instead of attempting Assembly.LoadFrom() on non-existent files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/AppleTestRunner/AppleTestRunner.cs | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 62d01c6df836eb..5022bb2da6b50e 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -24,6 +24,7 @@ public class SimpleTestRunner : iOSApplicationEntryPoint, IDevice public extern static void mono_ios_set_summary (string value); private static List s_testLibs = new List(); + private static List? s_testAssemblies; private static string? s_MainTestName; public static async Task Main(string[] args) @@ -45,8 +46,20 @@ public static async Task Main(string[] args) if (s_testLibs.Count < 1) { - // Look for *.Tests.dll files if target test suites are not set via "testlib:" arguments - s_testLibs = Directory.GetFiles(Environment.CurrentDirectory, "*.Tests.dll").ToList(); + if (!RuntimeFeature.IsDynamicCodeSupported) + { + // NativeAOT: test assemblies are statically linked into the native binary, + // so there are no DLL files on disk. Discover them from loaded assemblies. + s_testAssemblies = AppDomain.CurrentDomain.GetAssemblies() + .Where(a => a.GetName().Name?.EndsWith(".Tests") == true) + .ToList(); + s_testLibs = s_testAssemblies.Select(a => a.GetName().Name!).ToList(); + } + else + { + // Look for *.Tests.dll files if target test suites are not set via "testlib:" arguments + s_testLibs = Directory.GetFiles(Environment.CurrentDirectory, "*.Tests.dll").ToList(); + } } if (s_testLibs.Count < 1) @@ -110,9 +123,19 @@ public SimpleTestRunner(bool verbose) protected override IEnumerable GetTestAssemblies() { - foreach (string file in s_testLibs) + if (s_testAssemblies is not null) { - yield return new TestAssemblyInfo(Assembly.LoadFrom(file), file); + foreach (Assembly assembly in s_testAssemblies) + { + yield return new TestAssemblyInfo(assembly, assembly.GetName().Name!); + } + } + else + { + foreach (string file in s_testLibs) + { + yield return new TestAssemblyInfo(Assembly.LoadFrom(file), file); + } } } From d29178685e1df9164381bb958fd5842dfc4884af Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 26 Mar 2026 11:33:17 +0100 Subject: [PATCH 12/73] Root test and xunit assemblies for NativeAOT library tests on Apple mobile ILC trims types not reachable from the entrypoint. Library test types are only discovered via xunit reflection, so they were trimmed away, causing AppDomain.CurrentDomain.GetAssemblies() to not return the test assembly. Add TrimmerRootAssembly items for the test assembly, test runner, and xunit framework assemblies in _SetupNativeAOTLibraryTestInputs so ILC preserves them (--root: arguments). Add diagnostic logging to AppleTestRunner to dump all loaded assemblies when NativeAOT test discovery runs, making future issues easier to debug. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/AppleTestRunner/AppleTestRunner.cs | 20 +++++++++++++++++-- .../apple/data/ProxyProjectForAOTOnHelix.proj | 14 ++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 5022bb2da6b50e..6c83d9401ef3e8 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -50,7 +50,15 @@ public static async Task Main(string[] args) { // NativeAOT: test assemblies are statically linked into the native binary, // so there are no DLL files on disk. Discover them from loaded assemblies. - s_testAssemblies = AppDomain.CurrentDomain.GetAssemblies() + Console.WriteLine("NativeAOT mode: discovering test assemblies from loaded assemblies."); + Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies(); + Console.WriteLine($"Loaded assemblies ({allAssemblies.Length}):"); + foreach (Assembly a in allAssemblies) + { + Console.WriteLine($" {a.GetName().Name}"); + } + + s_testAssemblies = allAssemblies .Where(a => a.GetName().Name?.EndsWith(".Tests") == true) .ToList(); s_testLibs = s_testAssemblies.Select(a => a.GetName().Name!).ToList(); @@ -64,7 +72,15 @@ public static async Task Main(string[] args) if (s_testLibs.Count < 1) { - Console.WriteLine($"Test libs were not found (*.Tests.dll was not found in {Environment.CurrentDirectory})"); + if (!RuntimeFeature.IsDynamicCodeSupported) + { + Console.WriteLine("No assemblies ending with '.Tests' were found among loaded assemblies."); + } + else + { + Console.WriteLine($"Test libs were not found (*.Tests.dll was not found in {Environment.CurrentDirectory})"); + } + return -1; } diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index d52b0af4a84798..a6aa5ffd1dd44e 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -98,7 +98,9 @@ + non-framework dependencies (xunit, test utilities, etc.) can be resolved. + Root the test assembly and xunit framework assemblies so ILC does not trim test + types that are only reachable via reflection-based xunit discovery. --> @@ -106,6 +108,16 @@ + + + + + + + + + + From d767d8b9f566be06708319d6238092b26458a6b5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 26 Mar 2026 12:38:58 +0100 Subject: [PATCH 13/73] Root test assemblies and fix xunit-excludes path for NativeAOT on Apple mobile ILC trims types not reachable from the entrypoint. Library test types are only discovered via xunit reflection, so they were trimmed away, causing AppDomain.CurrentDomain.GetAssemblies() to not return the test assembly. Add TrimmerRootAssembly items for the test assembly, test runner, and xunit framework assemblies in _SetupNativeAOTLibraryTestInputs so ILC preserves them (--root: arguments). Resolve IgnoredTraitsFilePath against AppContext.BaseDirectory instead of using a relative path, since Environment.CurrentDirectory is / on iOS under NativeAOT while the xunit-excludes.txt file lives in the app bundle. Add diagnostic logging to AppleTestRunner to dump all loaded assemblies when NativeAOT test discovery runs, making future issues easier to debug. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 6c83d9401ef3e8..5fc58c66fa6d75 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -168,7 +168,7 @@ protected override void TerminateWithSuccess() protected override string? IgnoreFilesDirectory => null; - protected override string IgnoredTraitsFilePath => "xunit-excludes.txt"; + protected override string IgnoredTraitsFilePath => Path.Combine(AppContext.BaseDirectory, "xunit-excludes.txt"); public string BundleIdentifier => "net.dot." + s_MainTestName; From 56190afd50b467ea2360782be0ff4c7e1b4fe315 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 26 Mar 2026 14:04:48 +0100 Subject: [PATCH 14/73] Handle missing xunit-excludes.txt in NativeAOT app bundle Xcode.cs blanket-excludes .txt files from NativeAOT app bundles, so xunit-excludes.txt is not present at runtime. Return empty string from IgnoredTraitsFilePath when the file does not exist to skip trait filtering instead of crashing. Also resolve the path against AppContext.BaseDirectory since Environment.CurrentDirectory is / on iOS under NativeAOT. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Common/tests/AppleTestRunner/AppleTestRunner.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 5fc58c66fa6d75..3de0020e27c1d4 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -168,7 +168,16 @@ protected override void TerminateWithSuccess() protected override string? IgnoreFilesDirectory => null; - protected override string IgnoredTraitsFilePath => Path.Combine(AppContext.BaseDirectory, "xunit-excludes.txt"); + // NativeAOT excludes .txt files from the app bundle (Xcode.cs predefinedExcludes), + // so xunit-excludes.txt may not be present. Return empty string to skip trait filtering. + protected override string IgnoredTraitsFilePath + { + get + { + string path = Path.Combine(AppContext.BaseDirectory, "xunit-excludes.txt"); + return File.Exists(path) ? path : string.Empty; + } + } public string BundleIdentifier => "net.dot." + s_MainTestName; From e70510808351345d0fea158d6babe0bb2bdad03e Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 26 Mar 2026 16:42:17 +0100 Subject: [PATCH 15/73] Update XHarness to 11.0.0-prerelease.26173.1 for NativeAOT test runner The previous version (26168.1) predates the ReflectionBasedXunitTestRunner added in dotnet/xharness#1554. That runner uses reflection-based discovery (NativeAOT-compatible) instead of XunitFrontController which tries to load assemblies from disk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- eng/Version.Details.props | 6 +++--- eng/Version.Details.xml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 223740995c4fc4..e70303ecfe8d1d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26168.1", + "version": "11.0.0-prerelease.26173.1", "commands": [ "xharness" ] diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 627575517e919a..7ea82dd03d76ac 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -113,9 +113,9 @@ This file should be imported by eng/Versions.props 11.0.0-beta.26166.1 11.0.0-beta.26166.1 - 11.0.0-prerelease.26168.1 - 11.0.0-prerelease.26168.1 - 11.0.0-prerelease.26168.1 + 11.0.0-prerelease.26173.1 + 11.0.0-prerelease.26173.1 + 11.0.0-prerelease.26173.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6c49e6d094c4e5..b6c7a132e479dd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -287,17 +287,17 @@ https://github.com/dotnet/dotnet 840ea139a6e8aebe487f7041190f3865a74378d9 - + https://github.com/dotnet/xharness - 607b3de9cf2dbfec6734e686e68d2813b40b2b51 + e5857fbbc3f1d39d2776af5a5e3235c9ff485afa - + https://github.com/dotnet/xharness - 607b3de9cf2dbfec6734e686e68d2813b40b2b51 + e5857fbbc3f1d39d2776af5a5e3235c9ff485afa - + https://github.com/dotnet/xharness - 607b3de9cf2dbfec6734e686e68d2813b40b2b51 + e5857fbbc3f1d39d2776af5a5e3235c9ff485afa https://github.com/dotnet/dotnet From b9b429fa195417f4edad976c3c0c16ddec5632c3 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 30 Mar 2026 13:45:50 +0200 Subject: [PATCH 16/73] Fix NativeAOT test assembly name passed to xunit discovery Path.GetFileNameWithoutExtension("System.Runtime.Tests") strips ".Tests" as a file extension, producing "System.Runtime". Xunit then tries Assembly.Load("System.Runtime") which fails because that facade has no metadata in NativeAOT. Appending ".dll" ensures the extension stripping yields the correct assembly name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 3de0020e27c1d4..57717fff870c1c 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -143,7 +143,7 @@ protected override IEnumerable GetTestAssemblies() { foreach (Assembly assembly in s_testAssemblies) { - yield return new TestAssemblyInfo(assembly, assembly.GetName().Name!); + yield return new TestAssemblyInfo(assembly, assembly.GetName().Name! + ".dll"); } } else From 277d642fac0137633d810cc5d736dd57e66676e8 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 30 Mar 2026 21:55:57 +0200 Subject: [PATCH 17/73] Do not exclude .txt files from NativeAOT app bundles The NativeAOT predefined excludes in Xcode.cs stripped all .txt files from the app bundle, including xunit-excludes.txt. This file contains the trait filters that enable [ActiveIssue] test skip annotations. Without it, tests marked to be skipped on NativeAOT ran and failed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/tasks/AppleAppBuilder/Xcode.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 89d4f19a4102db..c470bc994bcbda 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -278,7 +278,6 @@ public string GenerateCMake( predefinedExcludes.Add(".dll"); predefinedExcludes.Add(".pdb"); predefinedExcludes.Add(".json"); - predefinedExcludes.Add(".txt"); predefinedExcludes.Add(".bin"); predefinedExcludes.Add(".dSYM"); } From 7f89e570433d6b6761079bec819e5538042456bd Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 31 Mar 2026 11:06:25 +0200 Subject: [PATCH 18/73] Dispatch open virtual delegates through DelegateInvokeMethod Use the delegate's Invoke method (shuffle thunk) for open virtual delegates with compiled targets instead of manually adjusting callArgsOffset, which would break 16-byte alignment for V128 arguments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/vm/interpexec.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index 3f4c2279c4834d..d25f78afbb9987 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -3208,20 +3208,29 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr pThreadContext->pStackPointer = stack + pMethod->allocaSize; break; } + else if (isOpenVirtual) + { + // For open virtual delegates with compiled target, dispatch through the delegate's + // Invoke method which uses the shuffle thunk to correctly handle argument shifting. + goto CALL_DELEGATE_INVOKE; + } } - OBJECTREF targetMethodObj = (*delegateObj)->GetTarget(); - LOCAL_VAR(callArgsOffset, OBJECTREF) = targetMethodObj; - - if ((targetMethod = NonVirtualEntry2MethodDesc(targetAddress)) != NULL) { - // In this case targetMethod holds a pointer to the MethodDesc that will be called by using targetMethodObj as - // the this pointer. This may be the final method (in the case of instance method delegates), or it may be a - // shuffle thunk, or multicast invoke method. - goto CALL_INTERP_METHOD; + OBJECTREF targetMethodObj = (*delegateObj)->GetTarget(); + LOCAL_VAR(callArgsOffset, OBJECTREF) = targetMethodObj; + + if ((targetMethod = NonVirtualEntry2MethodDesc(targetAddress)) != NULL) + { + // In this case targetMethod holds a pointer to the MethodDesc that will be called by using targetMethodObj as + // the this pointer. This may be the final method (in the case of instance method delegates), or it may be a + // shuffle thunk, or multicast invoke method. + goto CALL_INTERP_METHOD; + } } // targetMethod holds a pointer to the Invoke method of the delegate, not the final actual target. +CALL_DELEGATE_INVOKE: targetMethod = (MethodDesc*)pMethod->pDataItems[methodSlot]; int8_t* callArgsAddress = LOCAL_VAR_ADDR(callArgsOffset, int8_t); From f87331615d47e40dbfe2a6a9d2b5c522694d0e52 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 31 Mar 2026 11:07:26 +0200 Subject: [PATCH 19/73] Revert "Dispatch open virtual delegates through DelegateInvokeMethod" This reverts commit 7f89e570433d6b6761079bec819e5538042456bd. --- src/coreclr/vm/interpexec.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index d25f78afbb9987..3f4c2279c4834d 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -3208,29 +3208,20 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr pThreadContext->pStackPointer = stack + pMethod->allocaSize; break; } - else if (isOpenVirtual) - { - // For open virtual delegates with compiled target, dispatch through the delegate's - // Invoke method which uses the shuffle thunk to correctly handle argument shifting. - goto CALL_DELEGATE_INVOKE; - } } - { - OBJECTREF targetMethodObj = (*delegateObj)->GetTarget(); - LOCAL_VAR(callArgsOffset, OBJECTREF) = targetMethodObj; + OBJECTREF targetMethodObj = (*delegateObj)->GetTarget(); + LOCAL_VAR(callArgsOffset, OBJECTREF) = targetMethodObj; - if ((targetMethod = NonVirtualEntry2MethodDesc(targetAddress)) != NULL) - { - // In this case targetMethod holds a pointer to the MethodDesc that will be called by using targetMethodObj as - // the this pointer. This may be the final method (in the case of instance method delegates), or it may be a - // shuffle thunk, or multicast invoke method. - goto CALL_INTERP_METHOD; - } + if ((targetMethod = NonVirtualEntry2MethodDesc(targetAddress)) != NULL) + { + // In this case targetMethod holds a pointer to the MethodDesc that will be called by using targetMethodObj as + // the this pointer. This may be the final method (in the case of instance method delegates), or it may be a + // shuffle thunk, or multicast invoke method. + goto CALL_INTERP_METHOD; } // targetMethod holds a pointer to the Invoke method of the delegate, not the final actual target. -CALL_DELEGATE_INVOKE: targetMethod = (MethodDesc*)pMethod->pDataItems[methodSlot]; int8_t* callArgsAddress = LOCAL_VAR_ADDR(callArgsOffset, int8_t); From b90781a6e58ddc656daec72fd4030e477ece1602 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 31 Mar 2026 11:25:29 +0200 Subject: [PATCH 20/73] Add support for default.rd.xml and adjust trimming settings for NativeAOT library tests --- eng/testing/tests.ioslike.targets | 4 ++++ .../apple/data/ProxyProjectForAOTOnHelix.proj | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 5db2b02f21b3b0..a80a0d8549ff96 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -76,6 +76,10 @@ + + diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index a6aa5ffd1dd44e..f70ba9664cc6f2 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -30,6 +30,16 @@ true false + + + + partial + true + false + false @@ -112,12 +122,17 @@ + + + + From 5dd88e7770c958b3ebf2727dfbbdfed63ac30b69 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 31 Mar 2026 15:30:06 +0200 Subject: [PATCH 21/73] Bundle per-test rd.xml files for NativeAOT library tests on Apple mobile On desktop NativeAOT, both the shared eng/testing/default.rd.xml and the per-test default.rd.xml (from the test csproj's RdXmlFile item) are processed by ILC during dotnet publish. On Apple mobile, the test DLLs are pre-built and then AOT-compiled on Helix via ProxyProjectForAOTOnHelix.proj. Only the shared default.rd.xml was being bundled, causing 1000+ test failures from missing generic method instantiations (NotSupportedException: missing native code). Fix: - In tests.ioslike.targets, copy the shared rd.xml as common.rd.xml (renamed to avoid overwriting) and copy per-test RdXmlFile items to the bundle. - In ProxyProjectForAOTOnHelix.proj, glob *.rd.xml to pick up both files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 15 +++++++++++---- .../apple/data/ProxyProjectForAOTOnHelix.proj | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index a80a0d8549ff96..0cac283149e568 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -76,10 +76,6 @@ - - @@ -103,6 +99,17 @@ + + + + <_PublishBundleFiles Include="@(BundleFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index f70ba9664cc6f2..377b96909ec019 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -130,9 +130,9 @@ - - + + From 04921c9cae1742508e20ece070393be5d0309447 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 1 Apr 2026 16:29:01 +0200 Subject: [PATCH 22/73] Add pal_console.c to Native sources for Apple platforms --- src/native/libs/System.Native/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/libs/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt index 8fa04ec15a9c9e..7d80318b314bca 100644 --- a/src/native/libs/System.Native/CMakeLists.txt +++ b/src/native/libs/System.Native/CMakeLists.txt @@ -74,6 +74,7 @@ if (CLR_CMAKE_TARGET_APPLE) if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) list (APPEND NATIVE_SOURCES_OBJC_NO_ARC pal_log.m) + list (APPEND NATIVE_SOURCES pal_console.c) if (CLR_CMAKE_TARGET_MACCATALYST) list (APPEND NATIVE_SOURCES_OBJC_NO_ARC pal_iossupportversion.m) From 4e2156df7aebddcd2865fac78f4e891c47cbbfef Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 1 Apr 2026 16:58:13 +0200 Subject: [PATCH 23/73] Revert changes --- src/native/libs/System.Native/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/native/libs/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt index 7d80318b314bca..8fa04ec15a9c9e 100644 --- a/src/native/libs/System.Native/CMakeLists.txt +++ b/src/native/libs/System.Native/CMakeLists.txt @@ -74,7 +74,6 @@ if (CLR_CMAKE_TARGET_APPLE) if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) list (APPEND NATIVE_SOURCES_OBJC_NO_ARC pal_log.m) - list (APPEND NATIVE_SOURCES pal_console.c) if (CLR_CMAKE_TARGET_MACCATALYST) list (APPEND NATIVE_SOURCES_OBJC_NO_ARC pal_iossupportversion.m) From e62ec0a6702a1a642c596f4e68b877737add2107 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 1 Apr 2026 23:11:52 +0200 Subject: [PATCH 24/73] Fix SystemNative_IsATty to handle macOS Catalyst, iOS, and tvOS platforms --- src/native/libs/System.Native/pal_console.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/native/libs/System.Native/pal_console.c b/src/native/libs/System.Native/pal_console.c index b51e16c0bbc271..39d6bcbeef57a8 100644 --- a/src/native/libs/System.Native/pal_console.c +++ b/src/native/libs/System.Native/pal_console.c @@ -42,7 +42,12 @@ int32_t SystemNative_GetWindowSize(intptr_t fd, WinSize* windowSize) int32_t SystemNative_IsATty(intptr_t fd) { +#if defined(TARGET_MACCATALYST) || defined(TARGET_IOS) || defined(TARGET_TVOS) + (void)fd; + return 0; +#else return isatty(ToFileDescriptor(fd)); +#endif } static char* g_keypadXmit = NULL; // string used to enable application mode, from terminfo From 7bd78389587ece9fa28b94ae6a4df8a64113d604 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 8 Apr 2026 10:54:29 +0200 Subject: [PATCH 25/73] Remove unnecessary changes --- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../Common/tests/AppleTestRunner/AppleTestRunner.cs | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index c29e08bdf2addb..2086a5f84dd1bf 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -21,7 +21,7 @@ jobs: buildConfig: Release runtimeFlavor: mono isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - iossimulator_x64 - iossimulator_arm64 diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 57717fff870c1c..6dd66d2e56de36 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -50,13 +50,7 @@ public static async Task Main(string[] args) { // NativeAOT: test assemblies are statically linked into the native binary, // so there are no DLL files on disk. Discover them from loaded assemblies. - Console.WriteLine("NativeAOT mode: discovering test assemblies from loaded assemblies."); Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - Console.WriteLine($"Loaded assemblies ({allAssemblies.Length}):"); - foreach (Assembly a in allAssemblies) - { - Console.WriteLine($" {a.GetName().Name}"); - } s_testAssemblies = allAssemblies .Where(a => a.GetName().Name?.EndsWith(".Tests") == true) From a18a7e525d1edaee58e7186812f962ab42959d4b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 8 Apr 2026 10:55:25 +0200 Subject: [PATCH 26/73] Update src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 377b96909ec019..906286fcb3f379 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -115,9 +115,9 @@ AfterTargets="ComputeIlcCompileInputs" Condition="'$(UseNativeAOTRuntime)' == 'true' and '$(IncludesTestRunner)' == 'true'"> - + + Exclude="$(OriginalPublishDir)$(MainLibraryFileName);$(OriginalPublishDir)$(AssemblyName).dll" /> From d16cc3863ce32e95e6734daf0cf9a11f8df435a5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 8 Apr 2026 15:43:30 +0200 Subject: [PATCH 27/73] Fix NativeAOT Apple mobile test failures in System.Runtime.Tests - Add SINGLE_FILE_TEST_RUNNER define in tests.ioslike.targets for NativeAOT builds, fixing ModuleTests.Name and FullyQualifiedName expectations (matches existing Android pattern) - Skip ModuleTests that rely on module-level members from TestModule assembly, which is not rooted in mobile NativeAOT proxy project - Skip ModifiedTypeTests that use GenericWithModifiers from TestILAssembly, whose metadata is not preserved when the test assembly is not the entry point - Skip GetCustomAttribute tests for module-level attributes that differ in NativeAOT mobile (DebuggableAttribute, custom attrs) - Skip DoubleTests.ParsePatterns where ibm-fpgen.txt is not found due to iOS working directory being / instead of app bundle dir All skips use IsNativeAot AND IsAppleMobile to avoid affecting desktop NativeAOT where these tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 4 ++++ src/libraries/Common/tests/System/ModifiedTypeTests.cs | 8 ++++++++ .../tests/System.Runtime.Tests/System/Attributes.cs | 3 +++ .../tests/System.Runtime.Tests/System/DoubleTests.cs | 1 + .../System.Runtime.Tests/System/Reflection/ModuleTests.cs | 5 +++++ 5 files changed, 21 insertions(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 5754df2ae70125..cf1147465aab1d 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,6 +3,10 @@ $(BundleTestAppTargets);BundleTestAppleApp + + $(DefineConstants);SINGLE_FILE_TEST_RUNNER + + helix helix diff --git a/src/libraries/Common/tests/System/ModifiedTypeTests.cs b/src/libraries/Common/tests/System/ModifiedTypeTests.cs index 0175ddc892fa7e..60f8ef0e6aca89 100644 --- a/src/libraries/Common/tests/System/ModifiedTypeTests.cs +++ b/src/libraries/Common/tests/System/ModifiedTypeTests.cs @@ -589,6 +589,7 @@ public static unsafe void Property_FcnPtr_Complex_Modified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void MethodWithGenericParameterWithModifiers_Unmodified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.MethodWithGenericParameter), Bindings); @@ -612,6 +613,7 @@ public static unsafe void MethodWithGenericParameterWithModifiers_Unmodified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void MethodWithGenericParameterWithModifiers_Modified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.MethodWithGenericParameter), Bindings); @@ -637,6 +639,7 @@ public static unsafe void MethodWithGenericParameterWithModifiers_Modified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericFieldWithModifiers_Unmodified() { FieldInfo fi = typeof(GenericWithModifiers).Project().GetField(nameof(GenericWithModifiers.GenericField), Bindings); @@ -659,6 +662,7 @@ public static unsafe void GenericFieldWithModifiers_Unmodified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericFieldWithModifiers_Modified() { FieldInfo fi = typeof(GenericWithModifiers).Project().GetField(nameof(GenericWithModifiers.GenericField), Bindings); @@ -683,6 +687,7 @@ public static unsafe void GenericFieldWithModifiers_Modified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericPropertyWithModifiers_Unmodified() { PropertyInfo pi = typeof(GenericWithModifiers).Project().GetProperty(nameof(GenericWithModifiers.GenericProperty), Bindings); @@ -705,6 +710,7 @@ public static unsafe void GenericPropertyWithModifiers_Unmodified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericPropertyWithModifiers_Modified() { PropertyInfo pi = typeof(GenericWithModifiers).Project().GetProperty(nameof(GenericWithModifiers.GenericProperty), Bindings); @@ -729,6 +735,7 @@ public static unsafe void GenericPropertyWithModifiers_Modified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericMethod_Unmodified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.GenericMethod), Bindings); @@ -741,6 +748,7 @@ public static unsafe void GenericMethod_Unmodified() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericMethod_Modified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.GenericMethod), Bindings); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs index 3784d52cfcaa0b..15924ce21e90cf 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs @@ -334,6 +334,7 @@ public static class GetCustomAttribute [Fact] [ActiveIssue("https://github.com/dotnet/linker/issues/2078", typeof(PlatformDetection), nameof(PlatformDetection.IsTrimmedWithILLink)) /* Stripping security attributes removes UnverifiableCodeAttribute */] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void customAttributeCount() { List customAttributes = typeof(GetCustomAttribute).Module.CustomAttributes.ToList(); @@ -505,6 +506,7 @@ public static void NegTest4() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void PositiveTest5() { Type clsType = typeof(GetCustomAttribute); @@ -537,6 +539,7 @@ public static void NegTest5() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void PositiveTest6() { Type clsType = typeof(GetCustomAttribute); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index e567324ba71741..8da4f4ac2821c9 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,6 +536,7 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index df758d8faca60c..a7af34a263b55e 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -171,6 +171,7 @@ public void GetField_NullName() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetField() { FieldInfo testInt = TestModule.GetField("TestInt", BindingFlags.Public | BindingFlags.Static); @@ -184,6 +185,7 @@ public void GetField() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetFields() { List fields = TestModule.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).OrderBy(f => f.Name).ToList(); @@ -214,6 +216,7 @@ public void GetMethod_NullTypes() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod_AmbiguousMatch() { var ex = Assert.Throws(() => TestModule.GetMethod("TestMethodFoo")); @@ -223,6 +226,7 @@ public void GetMethod_AmbiguousMatch() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod() { var method = TestModule.GetMethod("TestMethodFoo", Type.EmptyTypes); @@ -240,6 +244,7 @@ public void GetMethod() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethods() { var methodNames = TestModule.GetMethods().Select(m => m.Name).ToArray(); From 75762c8b91aeaa2fc21164b1a8c6a1d32a4a0fd9 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 12:47:29 +0200 Subject: [PATCH 28/73] Refactor NativeAOT build configurations for iOS and iOS Simulator --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 4 ++-- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- eng/testing/tests.ioslike.targets | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index f287300f73ce39..7225d486c18abf 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -115,8 +115,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + nameSuffix: AllSubsets_NativeAOT_Smoke + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 2086a5f84dd1bf..323c65d3120322 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -55,7 +55,7 @@ jobs: buildConfig: Release runtimeFlavor: mono isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} platforms: - iossimulator_arm64 variables: diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index cf1147465aab1d..10bfcb70fb04cd 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -103,10 +103,6 @@ - From e638f9039c48dd3548946cdf1951a8f3006b3357 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 12:51:53 +0200 Subject: [PATCH 29/73] Refactor AppleTestRunner and ProxyProjectForAOTOnHelix to streamline NativeAOT test assembly handling --- .../tests/AppleTestRunner/AppleTestRunner.cs | 9 +-------- .../apple/data/ProxyProjectForAOTOnHelix.proj | 16 ++-------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 6dd66d2e56de36..88ef4c1fcfc41e 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -48,18 +48,13 @@ public static async Task Main(string[] args) { if (!RuntimeFeature.IsDynamicCodeSupported) { - // NativeAOT: test assemblies are statically linked into the native binary, - // so there are no DLL files on disk. Discover them from loaded assemblies. - Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - - s_testAssemblies = allAssemblies + s_testAssemblies = AppDomain.CurrentDomain.GetAssemblies() .Where(a => a.GetName().Name?.EndsWith(".Tests") == true) .ToList(); s_testLibs = s_testAssemblies.Select(a => a.GetName().Name!).ToList(); } else { - // Look for *.Tests.dll files if target test suites are not set via "testlib:" arguments s_testLibs = Directory.GetFiles(Environment.CurrentDirectory, "*.Tests.dll").ToList(); } } @@ -162,8 +157,6 @@ protected override void TerminateWithSuccess() protected override string? IgnoreFilesDirectory => null; - // NativeAOT excludes .txt files from the app bundle (Xcode.cs predefinedExcludes), - // so xunit-excludes.txt may not be present. Return empty string to skip trait filtering. protected override string IgnoredTraitsFilePath { get diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 906286fcb3f379..c7b0b911706496 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -24,22 +24,19 @@ - + $(OriginalPublishDir) static true false - partial true false + false @@ -106,11 +103,6 @@ - @@ -119,19 +111,15 @@ - - - From c37fb7c63740267088b96015900429060e534c74 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 12:56:25 +0200 Subject: [PATCH 30/73] Rename isiOSLikeOnlyBuild parameter for clarity in iOS simulator build configurations --- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- src/native/libs/System.Native/pal_console.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 323c65d3120322..773d16e5702639 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -21,7 +21,7 @@ jobs: buildConfig: Release runtimeFlavor: mono isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} platforms: - iossimulator_x64 - iossimulator_arm64 diff --git a/src/native/libs/System.Native/pal_console.c b/src/native/libs/System.Native/pal_console.c index 39d6bcbeef57a8..b51e16c0bbc271 100644 --- a/src/native/libs/System.Native/pal_console.c +++ b/src/native/libs/System.Native/pal_console.c @@ -42,12 +42,7 @@ int32_t SystemNative_GetWindowSize(intptr_t fd, WinSize* windowSize) int32_t SystemNative_IsATty(intptr_t fd) { -#if defined(TARGET_MACCATALYST) || defined(TARGET_IOS) || defined(TARGET_TVOS) - (void)fd; - return 0; -#else return isatty(ToFileDescriptor(fd)); -#endif } static char* g_keypadXmit = NULL; // string used to enable application mode, from terminfo From 4dba043e5fa0a4a17f9f30e6e7b308f2ef5da820 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 12:58:59 +0200 Subject: [PATCH 31/73] Simplify SmokeTestProject condition for System.Runtime.Tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/tests.proj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 666d651fb8cbbc..51e7d53023cc4e 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -563,8 +563,7 @@ - - + From 90e6a1f0cf38a8174b86d655b9aad4d820ebb618 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 13:07:15 +0200 Subject: [PATCH 32/73] Fix isiOSLikeSimulatorOnlyBuild parameter --- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 773d16e5702639..0a75345d16a65b 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -168,7 +168,7 @@ jobs: buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} platforms: - iossimulator_arm64 variables: From a8eae525c08ce367524f7065ea798dd30f9edcdf Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 13:32:43 +0200 Subject: [PATCH 33/73] Update AppleTestRunner to use test assembly name and refine IlcCompileInput handling in ProxyProjectForAOTOnHelix --- src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs | 4 +++- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 88ef4c1fcfc41e..1fa5437a1c1940 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -79,7 +79,9 @@ public static async Task Main(string[] args) Console.WriteLine(testLib); } Console.WriteLine("."); - s_MainTestName = Path.GetFileNameWithoutExtension(s_testLibs[0]); + s_MainTestName = s_testAssemblies is not null + ? s_testAssemblies[0].GetName().Name + : Path.GetFileNameWithoutExtension(s_testLibs[0]); mono_ios_set_summary($"Starting tests..."); var simpleTestRunner = new SimpleTestRunner(verbose); diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index c7b0b911706496..913263dd1d5747 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -107,9 +107,10 @@ AfterTargets="ComputeIlcCompileInputs" Condition="'$(UseNativeAOTRuntime)' == 'true' and '$(IncludesTestRunner)' == 'true'"> + + Exclude="$(OriginalPublishDir)$(MainLibraryFileName)" /> From 3d47dc66b1808826d2e398a2107c6eeeca3bb7b0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 9 Apr 2026 22:33:52 +0200 Subject: [PATCH 34/73] Replace closed issue #51912 with #126730 for NativeAOT Apple mobile ActiveIssue annotations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System/Reflection/ModuleTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index a7af34a263b55e..e9b621a30a92c8 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -171,7 +171,7 @@ public void GetField_NullName() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetField() { FieldInfo testInt = TestModule.GetField("TestInt", BindingFlags.Public | BindingFlags.Static); @@ -185,7 +185,7 @@ public void GetField() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetFields() { List fields = TestModule.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).OrderBy(f => f.Name).ToList(); @@ -216,7 +216,7 @@ public void GetMethod_NullTypes() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod_AmbiguousMatch() { var ex = Assert.Throws(() => TestModule.GetMethod("TestMethodFoo")); @@ -226,7 +226,7 @@ public void GetMethod_AmbiguousMatch() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod() { var method = TestModule.GetMethod("TestMethodFoo", Type.EmptyTypes); @@ -244,7 +244,7 @@ public void GetMethod() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethods() { var methodNames = TestModule.GetMethods().Select(m => m.Name).ToArray(); From 5786cd0f95695be5945a4b1e307bb300833656fe Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 13 Apr 2026 17:18:40 +0200 Subject: [PATCH 35/73] Improve NativeAOT support for Apple builds by adding compilation steps on the build machine and adjusting dependencies for ILC compilation. --- eng/testing/tests.ioslike.targets | 15 ++++++++++++++- src/mono/msbuild/apple/build/AppleBuild.props | 2 ++ src/mono/msbuild/apple/build/AppleBuild.targets | 2 +- .../apple/data/ProxyProjectForAOTOnHelix.proj | 12 ++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 10bfcb70fb04cd..22a4b0eba24d69 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -22,6 +22,8 @@ <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:UseMonoRuntime=$(UseMonoRuntime) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=$(UsePortableRuntimePack) /p:Configuration=$(Configuration) <_AOTBuildCommand Condition="'$(NativeLib)' != ''">$(_AOTBuildCommand) /p:NativeLib=$(NativeLib) /p:BundlesResources=$(BundlesResources) /p:ForceLibraryModeGenerateAppBundle=$(ForceLibraryModeGenerateAppBundle) + + <_AOTBuildCommand Condition="'$(UseNativeAOTRuntime)' == 'true'">$(_AOTBuildCommand) /p:SkipIlcCompile=true <_AOTBuildCommand Condition="'$(UseMonoRuntime)' != 'true' and '$(UseNativeAOTRuntime)' != 'true'">$(_AOTBuildCommand) /p:PublishReadyToRun=true /p:PublishReadyToRunComposite=true /p:PublishReadyToRunContainerFormat=macho /p:StripSymbols=true <_AOTBuildCommand>$(_AOTBuildCommand) @@ -53,7 +55,7 @@ PrepareForAppleBuildApp;$(AppleBuildDependsOn);_CopyTestArchive AppleBuild - $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CopyTestArchive + $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CompileNativeAOTOnBuildMachine;_CopyTestArchive @@ -181,6 +183,17 @@ OutputFile="$(BundleDir)publish\ProxyProjectForAOTOnHelix.props" /> + + + + + + diff --git a/src/mono/msbuild/apple/build/AppleBuild.props b/src/mono/msbuild/apple/build/AppleBuild.props index ec67cde3c84259..80076e380df114 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.props @@ -36,6 +36,8 @@ <_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' == 'true'">_AppleNativeAotCompile <_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' != 'true'">_AppleAotCompile ComputeIlcCompileInputs;SetupOSSpecificProps;PrepareForILLink + <_AppleNativeAotCompileDependsOn Condition="'$(SkipIlcCompile)' != 'true'">IlcCompile + <_AppleNativeAotCompileDependsOn Condition="'$(SkipIlcCompile)' == 'true'">SetupOSSpecificProps <_ReadRuntimeComponentsManifestTargetName Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(UseMonoRuntime)' != 'false'">_MonoReadAvailableComponentsManifest Publish diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index 4457a18b28f1b3..f2f280e95991a5 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -285,7 +285,7 @@ + DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;$(_AppleNativeAotCompileDependsOn);$(_IlcLibraryBuildDependsOn);_PublishNativeBinary" /> + + + @@ -97,6 +103,12 @@ 127.0.0.1:9000,nosuspend,listen + + + + + + From 5b60f6692cca43817bf6ad2681ca0c457f2be233 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 13 Apr 2026 21:41:35 +0200 Subject: [PATCH 36/73] Enable aggressive trimming for NativeAOT smoke tests across iOS, iOS simulator, and MacCatalyst configurations --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 2 +- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 4 ++-- eng/pipelines/runtime.yml | 4 ++-- eng/testing/tests.ioslike.targets | 2 ++ src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 1 + 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 7225d486c18abf..30f371f7119fc2 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -116,7 +116,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 0a75345d16a65b..0811663d392e6d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -111,7 +111,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 95f907bc781c0b..8f3587da71516a 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -148,7 +148,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: @@ -181,7 +181,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true /p:EnableAppSandbox=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index cc52b790b8c9d3..1bda07217868d1 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1209,7 +1209,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 useNativeAOTRuntime: true condition: >- @@ -1339,7 +1339,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 useNativeAOTRuntime: true condition: >- diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 10bfcb70fb04cd..19b5f4fbe3b9be 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -5,6 +5,8 @@ $(DefineConstants);SINGLE_FILE_TEST_RUNNER + partial + true diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 913263dd1d5747..febf8d77488c80 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -32,6 +32,7 @@ + $(NoWarn);IL3000;IL3001;IL3002;IL3003;IL3050;IL3051;IL3052;IL3053 partial true false From 5947a8d7b542ed5cef4d8eb628660148aa9ad4d8 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 14 Apr 2026 12:55:12 +0200 Subject: [PATCH 37/73] Fix ILLink IL1007 and MSB4011 errors for NativeAOT Apple mobile tests The build command passes EnableAggressiveTrimming=true which sets PublishTrimmed=true in tests.mobile.targets. This causes the SDK's ILLink to run during the test project's dotnet publish, but ILLink fails with IL1007 (Missing predefined System.NotSupportedException) during cross-compilation for ios-arm64. Fix: Set PublishTrimmed=false for all NativeAOT tests (including functional tests) in tests.ioslike.targets. Trimming is correctly handled by ILC's integrated ILLink via _CompileNativeAOTOnBuildMachine, which invokes the ProxyProject's RunNativeAOTCompilation target on the build machine. Only app bundling and signing happen on Helix (with SkipIlcCompile=true). Also remove the explicit ILLink targets import from AppleBuild.targets. ILC targets set PublishTrimmed=true which causes the SDK to import ILLink targets automatically. The explicit import caused MSB4011 (double-import error). Also add DynamicCodeSupport=false since NativeAOT does not support dynamic code generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 11 +++++++++-- src/mono/msbuild/apple/build/AppleBuild.targets | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 72673b081a7ab7..6b863774e8e1d5 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,10 +3,17 @@ $(BundleTestAppTargets);BundleTestAppleApp + + + false + true + false + + $(DefineConstants);SINGLE_FILE_TEST_RUNNER - partial - true diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index f2f280e95991a5..ed0de8a073da80 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -21,8 +21,8 @@ - + From 355b0607d2c9a5064c31804c7075c29d06579f40 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 15 Apr 2026 17:16:30 +0200 Subject: [PATCH 38/73] Revert ActiveIssue annotations for NativeAOT Apple mobile tests These tests should work on NativeAOT Apple mobile the same way they work on other NativeAOT platforms without platform-specific exclusions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/Common/tests/System/ModifiedTypeTests.cs | 8 -------- .../tests/System.Runtime.Tests/System/Attributes.cs | 3 --- .../tests/System.Runtime.Tests/System/DoubleTests.cs | 1 - .../System.Runtime.Tests/System/Reflection/ModuleTests.cs | 5 ----- 4 files changed, 17 deletions(-) diff --git a/src/libraries/Common/tests/System/ModifiedTypeTests.cs b/src/libraries/Common/tests/System/ModifiedTypeTests.cs index 60f8ef0e6aca89..0175ddc892fa7e 100644 --- a/src/libraries/Common/tests/System/ModifiedTypeTests.cs +++ b/src/libraries/Common/tests/System/ModifiedTypeTests.cs @@ -589,7 +589,6 @@ public static unsafe void Property_FcnPtr_Complex_Modified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void MethodWithGenericParameterWithModifiers_Unmodified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.MethodWithGenericParameter), Bindings); @@ -613,7 +612,6 @@ public static unsafe void MethodWithGenericParameterWithModifiers_Unmodified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void MethodWithGenericParameterWithModifiers_Modified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.MethodWithGenericParameter), Bindings); @@ -639,7 +637,6 @@ public static unsafe void MethodWithGenericParameterWithModifiers_Modified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericFieldWithModifiers_Unmodified() { FieldInfo fi = typeof(GenericWithModifiers).Project().GetField(nameof(GenericWithModifiers.GenericField), Bindings); @@ -662,7 +659,6 @@ public static unsafe void GenericFieldWithModifiers_Unmodified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericFieldWithModifiers_Modified() { FieldInfo fi = typeof(GenericWithModifiers).Project().GetField(nameof(GenericWithModifiers.GenericField), Bindings); @@ -687,7 +683,6 @@ public static unsafe void GenericFieldWithModifiers_Modified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericPropertyWithModifiers_Unmodified() { PropertyInfo pi = typeof(GenericWithModifiers).Project().GetProperty(nameof(GenericWithModifiers.GenericProperty), Bindings); @@ -710,7 +705,6 @@ public static unsafe void GenericPropertyWithModifiers_Unmodified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericPropertyWithModifiers_Modified() { PropertyInfo pi = typeof(GenericWithModifiers).Project().GetProperty(nameof(GenericWithModifiers.GenericProperty), Bindings); @@ -735,7 +729,6 @@ public static unsafe void GenericPropertyWithModifiers_Modified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericMethod_Unmodified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.GenericMethod), Bindings); @@ -748,7 +741,6 @@ public static unsafe void GenericMethod_Unmodified() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static unsafe void GenericMethod_Modified() { MethodInfo mi = typeof(GenericWithModifiers).Project().GetMethod(nameof(GenericWithModifiers.GenericMethod), Bindings); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs index 15924ce21e90cf..3784d52cfcaa0b 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Attributes.cs @@ -334,7 +334,6 @@ public static class GetCustomAttribute [Fact] [ActiveIssue("https://github.com/dotnet/linker/issues/2078", typeof(PlatformDetection), nameof(PlatformDetection.IsTrimmedWithILLink)) /* Stripping security attributes removes UnverifiableCodeAttribute */] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void customAttributeCount() { List customAttributes = typeof(GetCustomAttribute).Module.CustomAttributes.ToList(); @@ -506,7 +505,6 @@ public static void NegTest4() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void PositiveTest5() { Type clsType = typeof(GetCustomAttribute); @@ -539,7 +537,6 @@ public static void NegTest5() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void PositiveTest6() { Type clsType = typeof(GetCustomAttribute); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index 8da4f4ac2821c9..e567324ba71741 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,7 +536,6 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index e9b621a30a92c8..df758d8faca60c 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -171,7 +171,6 @@ public void GetField_NullName() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetField() { FieldInfo testInt = TestModule.GetField("TestInt", BindingFlags.Public | BindingFlags.Static); @@ -185,7 +184,6 @@ public void GetField() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetFields() { List fields = TestModule.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).OrderBy(f => f.Name).ToList(); @@ -216,7 +214,6 @@ public void GetMethod_NullTypes() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod_AmbiguousMatch() { var ex = Assert.Throws(() => TestModule.GetMethod("TestMethodFoo")); @@ -226,7 +223,6 @@ public void GetMethod_AmbiguousMatch() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethod() { var method = TestModule.GetMethod("TestMethodFoo", Type.EmptyTypes); @@ -244,7 +240,6 @@ public void GetMethod() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51912", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/126730", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public void GetMethods() { var methodNames = TestModule.GetMethods().Select(m => m.Name).ToArray(); From 257c214e471f3dfc45f2530eee117cb58dbd84a5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 16 Apr 2026 11:42:46 +0200 Subject: [PATCH 39/73] Fix NativeAOT metadata preservation and test failures on Apple mobile On Apple mobile, the test runner (AppleTestRunner.dll) is the IlcCompileInput while test assemblies are IlcReference. This causes ILC to trim module-level attributes, global fields/methods, and custom modifiers from test assemblies. Setting IlcTrimMetadata=false preserves all reflection metadata, fixing 16 test failures (ModifiedTypeTests, ModuleTests, GetCustomAttribute). Also restores ActiveIssue for DoubleTests.ParsePatterns (file path issue on iOS) and reformats MSBuild Properties for readability. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 15 ++++++++++++++- .../System.Runtime.Tests/System/DoubleTests.cs | 1 + .../apple/data/ProxyProjectForAOTOnHelix.proj | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 6b863774e8e1d5..1431899e2715cc 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -200,7 +200,20 @@ + Properties=" + RuntimeSrcDir=$(RepoRoot); + RuntimeConfig=$(Configuration); + TargetOS=$(TargetOS); + TargetArchitecture=$(TargetArchitecture); + UseNativeAOTRuntime=true; + Configuration=$(Configuration); + NativeLib=$(NativeLib); + IncludesTestRunner=$(IncludesTestRunner); + IlcToolsPath=$(CoreCLRCrossILCompilerDir); + IlcSdkPath=$(CoreCLRAotSdkDir); + IlcFrameworkPath=$(IlcFrameworkPath); + IlcFrameworkNativePath=$(IlcFrameworkNativePath); + ILCompilerTargetsPath=$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets" /> diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index e567324ba71741..8da4f4ac2821c9 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,6 +536,7 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 826c6164e03546..01d0850a1e97d7 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -31,9 +31,14 @@ false + $(NoWarn);IL3000;IL3001;IL3002;IL3003;IL3050;IL3051;IL3052;IL3053 partial + false true false From 04018776f4736b2a91adcd3fb4c7b170ebc4c006 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 17 Apr 2026 10:22:54 +0200 Subject: [PATCH 40/73] Refactor NativeAOT test configurations for Apple mobile and streamline build process --- eng/testing/tests.ioslike.targets | 49 ++++++------------- eng/testing/tests.mobile.targets | 2 +- eng/testing/tests.singlefile.targets | 8 +-- .../System/DoubleTests.cs | 1 - .../apple/data/ProxyProjectForAOTOnHelix.proj | 42 ++-------------- 5 files changed, 24 insertions(+), 78 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 1431899e2715cc..30ff51abcf6dc2 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,18 +3,23 @@ $(BundleTestAppTargets);BundleTestAppleApp - + - false - true - false + true + Static + true - - $(DefineConstants);SINGLE_FILE_TEST_RUNNER - + + + + helix @@ -64,7 +69,7 @@ PrepareForAppleBuildApp;$(AppleBuildDependsOn);_CopyTestArchive AppleBuild - $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CompileNativeAOTOnBuildMachine;_CopyTestArchive + $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CopyTestArchive @@ -192,30 +197,6 @@ OutputFile="$(BundleDir)publish\ProxyProjectForAOTOnHelix.props" /> - - - - - - diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 21b85c60da72e3..5c4dd4e577b4a4 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -126,7 +126,7 @@ Condition="'$(TestFramework)' == 'xunit'"> <_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'android'" /> - <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator'" /> + <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="('$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator') and '$(TestNativeAot)' != 'true'" /> <_runnerFilesToPublish Include="$(WasmTestRunnerDir)*" Condition="'$(TargetOS)' == 'Browser' or '$(TargetOS)' == 'wasi'" /> diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 1a992b1b7e10d3..b5f40f2cdefb4b 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -1,6 +1,6 @@ - Exe + Exe $([MSBuild]::NormalizeDirectory('$(OutDir)', 'publish')) $([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)')) @@ -40,7 +40,7 @@ true - + $(DefineConstants);SINGLE_FILE_TEST_RUNNER @@ -56,7 +56,7 @@ + Condition="'$(CLRTestKind)' == '' and '$(IsFunctionalTest)' != 'true' and '$(TargetsAppleMobile)' != 'true'" /> @@ -183,7 +183,7 @@ diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index 8da4f4ac2821c9..e567324ba71741 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,7 +536,6 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 01d0850a1e97d7..ae6887986b0c9d 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -31,16 +31,10 @@ false - - - $(NoWarn);IL3000;IL3001;IL3002;IL3003;IL3050;IL3051;IL3052;IL3053 - partial - false - true - false + + + true @@ -68,12 +62,6 @@ - - - @@ -121,28 +109,6 @@ - - - - - - - - - - - - - - - - - - - From 050b7f87ddf3ee71c5238fc83d29fff3e4b537af Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 17 Apr 2026 11:59:52 +0200 Subject: [PATCH 41/73] Root test assembly as TrimmerRootAssembly for Apple mobile NativeAOT When TestNativeAot=true on Apple mobile, the test project publishes as a static library (NativeLib=Static) with OutputType != Exe, so ILLink does not auto-root the main assembly under TrimMode=partial. This caused IL1007 'Missing predefined System.NotSupportedException type' because nothing reached into corelib. Explicitly root the test assembly so its transitive closure (including System.Private.CoreLib) is resolved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.singlefile.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index b5f40f2cdefb4b..fa1a260b1953f7 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -51,6 +51,9 @@ + + From 2f928ea1b41c5cb72e219ccbbda2e0a1e69c2256 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 17 Apr 2026 14:30:29 +0200 Subject: [PATCH 42/73] Use OutputType=Exe for Apple mobile NativeAOT tests The previous refactor excluded OutputType=Exe for Apple mobile with TestNativeAot=true to accommodate NativeLib=Static, but this left ILLink without an entry assembly to root under TrimMode=partial, causing IL1007 'Missing predefined System.NotSupportedException type' because System.Private.CoreLib was never included in the trim closure. ILC's NativeLib=Static produces a static library regardless of OutputType, so OutputType=Exe (matching desktop NativeAOT) is compatible: ILLink properly roots the entry assembly and resolves corelib, while ILC still emits the .a consumed by AppleBuild on Helix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.singlefile.targets | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index fa1a260b1953f7..7ff9d126c3e019 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -1,6 +1,6 @@ - Exe + Exe $([MSBuild]::NormalizeDirectory('$(OutDir)', 'publish')) $([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)')) @@ -51,9 +51,6 @@ - - From c13f86b9d58113b4d085924929ddb929d174b918 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 21 Apr 2026 12:54:29 +0200 Subject: [PATCH 43/73] Enable NativeAOT single file publishing and runtime pack usage for Apple mobile tests --- eng/testing/tests.ioslike.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 30ff51abcf6dc2..65b027af6e19be 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -10,6 +10,9 @@ matching how desktop NativeAOT library tests are structured. --> true + true + true + <_IsPublishing Condition="'$(_IsPublishing)' == ''">true Static true From 7fc9eb5d49f7cace507fae6a5e76bbf51b6efd02 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 24 Apr 2026 17:09:39 +0200 Subject: [PATCH 44/73] Enhance NativeAOT support for Apple mobile: add DirectPInvoke for __Internal, streamline Helix build process, and adjust MainLibraryFileName handling. --- eng/testing/tests.ioslike.targets | 27 ++++++- eng/testing/tests.singlefile.targets | 4 +- .../apple/data/ProxyProjectForAOTOnHelix.proj | 72 +++++++++++++++++-- 3 files changed, 94 insertions(+), 9 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 65b027af6e19be..325ae808a89da2 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -24,6 +24,14 @@ Version="$(MicrosoftDotNetXHarnessTestRunnersXunitVersion)" /> + + + + + helix helix @@ -39,8 +47,6 @@ <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:UseMonoRuntime=$(UseMonoRuntime) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=$(UsePortableRuntimePack) /p:Configuration=$(Configuration) <_AOTBuildCommand Condition="'$(NativeLib)' != ''">$(_AOTBuildCommand) /p:NativeLib=$(NativeLib) /p:BundlesResources=$(BundlesResources) /p:ForceLibraryModeGenerateAppBundle=$(ForceLibraryModeGenerateAppBundle) - - <_AOTBuildCommand Condition="'$(UseNativeAOTRuntime)' == 'true'">$(_AOTBuildCommand) /p:SkipIlcCompile=true <_AOTBuildCommand Condition="'$(UseMonoRuntime)' != 'true' and '$(UseNativeAOTRuntime)' != 'true'">$(_AOTBuildCommand) /p:PublishReadyToRun=true /p:PublishReadyToRunComposite=true /p:PublishReadyToRunContainerFormat=macho /p:StripSymbols=true <_AOTBuildCommand>$(_AOTBuildCommand) @@ -103,6 +109,19 @@ Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" /> + + + <_NativeAotHelixLinkInputs Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/*.a" /> + <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.a" /> + <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.o" /> + + + @@ -210,7 +229,9 @@ true true true - AppleTestRunner.dll + AppleTestRunner.dll + + $(PublishDir) $(BundleDir) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 7ff9d126c3e019..1f52835b829a1a 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -6,8 +6,8 @@ $([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)')) $(TargetRid) - $(AssemblyName).exe - chmod +rwx $(AssemblyName) && ./$(AssemblyName) + $(AssemblyName).exe + chmod +rwx $(AssemblyName) && ./$(AssemblyName) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index ae6887986b0c9d..ffee65915fc8c0 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -23,6 +23,16 @@ <_targetOS>$(TargetOS) + + + <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix + PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix + + $(OriginalPublishDir) @@ -60,24 +70,68 @@ + + + <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a + + + + + + + + <_NativeAotLinkInputsDir>$(OriginalPublishDir)nativeaot-link-inputs\ + + + + + + $(_PrebuiltNativeAOTLib) + + + <_NativeAotHelixLinkLibs Include="$(_NativeAotLinkInputsDir)*.a" + Exclude="$(_NativeAotLinkInputsDir)libRuntime.ServerGC.a;$(_NativeAotLinkInputsDir)libRuntime.VxsortEnabled.a;$(_NativeAotLinkInputsDir)libstandalonegc-enabled.a;$(_NativeAotLinkInputsDir)libeventpipe-enabled.a" /> + + <_NativeAotHelixLinkLibs Include="$(_NativeAotLinkInputsDir)libbootstrapperdll.o" /> + + + + + + true - AppleTestRunner.dll + AppleTestRunner.dll + + $(OriginalPublishDir) $(TestRootDir)AppBundle\ - + - + <_ExtraFiles Include="$(ExtraFilesPath)**\*" /> @@ -86,6 +140,13 @@ + + + + + @@ -97,7 +158,10 @@ 127.0.0.1:9000,nosuspend,listen - + From 69b7af2d5d1f61847b99db1b4baebbea717a1af5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 27 Apr 2026 17:04:57 +0200 Subject: [PATCH 45/73] Gate NativeAOT library-test logic on IncludesTestRunner != 'false' The NativeAOT_Smoke pipeline passes /p:UseNativeAOTRuntime=true to all tests in the job, including pre-existing functional smoke tests with a custom Main (IncludesTestRunner=false, e.g. iOS.Device.Aot.Test). My unconditional true in tests.ioslike.targets cascaded TestSingleFile=true via tests.props, which caused xunit.console.targets to append '-xml testResults.xml' to RunScriptCommand. On the ioslike Helix path RunScriptCommand ends in 'xharness apple run ... --', so the trailing -xml argument flowed past the dash-dash separator into mlaunch/devicectl, which rejected it with APP_LAUNCH_FAILURE ('Unknown option -x'). Fix: gate every new NativeAOT branch in tests.ioslike.targets and ProxyProjectForAOTOnHelix.proj on IncludesTestRunner != 'false', so that functional/smoke tests stay on the legacy ILC-on-Helix path while library tests (which use AppleTestRunner.cs + xunit) take the new on-host ILC + on-Helix link path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 29 ++++++---- .../apple/data/ProxyProjectForAOTOnHelix.proj | 56 +++++++++---------- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 325ae808a89da2..8473d5c25fc0a0 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,12 +3,19 @@ $(BundleTestAppTargets);BundleTestAppleApp - - + + true true true @@ -28,7 +35,7 @@ AppleAppBuilder-generated objc main (e.g. mono_ios_set_summary). With NativeAOT these must be DirectPInvoke so ILC emits static references instead of runtime dlopen("__Internal"). --> - + @@ -114,7 +121,7 @@ fully-linked binary. The Xcode link + .app bundling happens on Helix via the proxy project. Package the NativeAOT link inputs (PAL static libs from the iOS runtime pack and ILC aotsdk libs/objects) so the proxy can link them. --> - + <_NativeAotHelixLinkInputs Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/*.a" /> <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.a" /> <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.o" /> @@ -141,10 +148,10 @@ - - @@ -231,7 +238,7 @@ true AppleTestRunner.dll - + $(PublishDir) $(BundleDir) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index ffee65915fc8c0..ff44e2ecf2f026 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -23,16 +23,6 @@ <_targetOS>$(TargetOS) - - - <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix - PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix - - $(OriginalPublishDir) @@ -41,12 +31,6 @@ false - - - true - - false @@ -64,19 +48,31 @@ - - - - - + is available. Only library tests (IncludesTestRunner != false) ship a pre-built + lib; functional/smoke tests with a custom Main still need ILC to run on Helix. --> + <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a + + + <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix + PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix + true + + + + + + + Condition="'$(UseNativeAOTRuntime)' == 'true' and '$(_UseNativeAOTLibraryModeBundling)' != 'true' and '$(IncludesTestRunner)' != 'false'"> @@ -122,14 +118,14 @@ true AppleTestRunner.dll - + $(OriginalPublishDir) $(TestRootDir)AppBundle\ - + @@ -140,10 +136,12 @@ - - + + From de8a0ac1932a93518584c63922eff67b57468e01 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 28 Apr 2026 11:27:58 +0200 Subject: [PATCH 46/73] Scope EnableAggressiveTrimming to NativeAOT library tests only The pipeline buildArgs applied /p:EnableAggressiveTrimming=true globally to every project in the build, including pre-existing iOS smoke tests (IncludesTestRunner=false, custom Main, e.g. iOS.Device.Aot.Test). On those projects ILLink failed with: ILLink : error IL1007: Missing predefined 'System.NotSupportedException' type error NETSDK1144: Optimizing assemblies for size failed. [src/tests/FunctionalTests/iOS/Device/AOT/iOS.Device.Aot.Test.csproj] Move EnableAggressiveTrimming=true out of the pipeline buildArgs and into the NativeAOT library-test PropertyGroup in tests.ioslike.targets, which is already gated on IncludesTestRunner != 'false'. Smoke tests no longer trim on the host and stay on the legacy ILC-on-Helix path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/runtime.yml | 4 ++-- eng/testing/tests.ioslike.targets | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 1bda07217868d1..cc52b790b8c9d3 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1209,7 +1209,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 useNativeAOTRuntime: true condition: >- @@ -1339,7 +1339,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 useNativeAOTRuntime: true condition: >- diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 8473d5c25fc0a0..7603b4d1fb9fbb 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -22,6 +22,7 @@ <_IsPublishing Condition="'$(_IsPublishing)' == ''">true Static true + true From 61674263e5e5a981ddf6710c753ce06dd9a7f845 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 28 Apr 2026 12:58:19 +0200 Subject: [PATCH 47/73] Skip -xml arg for Apple mobile NativeAOT library tests xharness 'apple test' launchers (open on maccatalyst, mlaunch on ios-device) do not reliably forward args past the '--' separator to the app, causing APP_LAUNCH_FAILURE on those targets. AppleTestRunner.cs only parses 'testlib:'-prefixed args and '--verbose', so the '-xml testResults.xml' suffix appended by xunit.console.targets is unused on Apple mobile and breaks the launcher. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/xunit/xunit.console.targets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index cb79571f2f1d5c..f732bc810459b7 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -52,8 +52,10 @@ $(_withoutCategories.Replace(';', '%0dcategory=')) - - + + $(RunScriptCommand) -xml $(TestResultsName) From 3e3b73c5aaa6a999ff7777560ac7eecdb7e1922d Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 28 Apr 2026 15:52:36 +0200 Subject: [PATCH 48/73] Don't enable aggressive ILLink trimming for NativeAOT library tests Aggressive ILLink trimming on top of NativeAOT's ILC analysis over-trims xunit MemberData test data properties (which are referenced only via attribute reflection), causing failures like: System.ArgumentException: Could not find public static member (property, field, or method) named 'IndexOf_SZArray_TestData' on System.Tests.ArrayTests NativeAOT library tests should rely on ILC's static analysis (via PublishAot=true) for trimming, not stack ILLink on top. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 7603b4d1fb9fbb..8473d5c25fc0a0 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -22,7 +22,6 @@ <_IsPublishing Condition="'$(_IsPublishing)' == ''">true Static true - true From c2e2afe87efdfdb1e280657de6d8c7500eebf676 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 28 Apr 2026 18:10:26 +0200 Subject: [PATCH 49/73] Root XUnit trait discoverers for NativeAOT Apple library tests xunit2 resolves trait/data discoverers (PlatformSpecific, OuterLoop, ActiveIssue, MemberData, etc.) via Type.GetType using string-only references in [TraitDiscovererAttribute]/[DataDiscovererAttribute] on the user attributes. ILC has no compile-time reference to these types, so it trims them and trait discovery silently no-ops, leaving every [PlatformSpecific(TestPlatforms.Windows)] etc. test running on Apple mobile and producing hundreds of expected-platform-skip failures. Root Microsoft.DotNet.XUnitExtensions and xunit.core for NativeAOT library tests so the discoverers survive trimming. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 8473d5c25fc0a0..af355aa5da8c6b 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -37,6 +37,13 @@ dlopen("__Internal"). --> + + + From c9117e4b157e32663cda2b314e671089ad7ac7a2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 29 Apr 2026 09:40:04 +0200 Subject: [PATCH 50/73] Add ILLink.Descriptor.xunit.xml for NativeAOT discoverer rooting TrimmerRootAssembly alone preserves type bodies but ILC may still trim internal discoverer types referenced only via Type.GetType strings. Reuse the existing xunit descriptor (used by Mono path) to explicitly preserve PlatformSpecificDiscoverer, ConditionalFactDiscoverer, etc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index af355aa5da8c6b..056ad5e325de11 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -44,6 +44,7 @@ category-based filters in xunit-excludes.txt do not apply. --> + From fb98065c73f008188926d549a2685f7cb253fbbb Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 29 Apr 2026 11:11:21 +0200 Subject: [PATCH 51/73] Look up xunit-excludes.txt in maccatalyst Resources directory For maccatalyst NativeAOT apps the binary lives under .app/Contents/MacOS/ (which is what AppContext.BaseDirectory returns) but the xunit-excludes.txt file is bundled as a resource under .app/Contents/Resources/. Without this fallback the trait-based exclusion list (category=IgnoreForCI/OuterLoop/failing) is silently ignored, so PlatformSpecific/ActiveIssue/ConditionalFact-skipped tests run anyway and report as failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/AppleTestRunner/AppleTestRunner.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 1fa5437a1c1940..48b4e54e6a2582 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -164,7 +164,24 @@ protected override string IgnoredTraitsFilePath get { string path = Path.Combine(AppContext.BaseDirectory, "xunit-excludes.txt"); - return File.Exists(path) ? path : string.Empty; + if (File.Exists(path)) + { + return path; + } + + // For NativeAOT maccatalyst apps the binary lives under .app/Contents/MacOS/ but + // xunit-excludes.txt is bundled as a resource under .app/Contents/Resources/. + string? appBase = Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar)); + if (appBase is not null) + { + string resourcesPath = Path.Combine(appBase, "Resources", "xunit-excludes.txt"); + if (File.Exists(resourcesPath)) + { + return resourcesPath; + } + } + + return string.Empty; } } From a2a2d574b13811a3be7440af039847cff05f114f Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 29 Apr 2026 13:12:40 +0200 Subject: [PATCH 52/73] ActiveIssue tests failing on NativeAOT for System.Runtime.Tests ModuleTests.Name and ModuleTests.FullyQualifiedName behave like single-file under NativeAOT (no separate test .dll), and DoubleTests.ParsePatterns can't resolve its content-file test data when bundled into a NativeAOT app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System.Runtime.Tests/System/DoubleTests.cs | 1 + .../System.Runtime.Tests/System/Reflection/ModuleTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index e567324ba71741..0d6e18f47a08e3 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,6 +536,7 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index df758d8faca60c..9658b5ec062f55 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -81,7 +81,7 @@ public void CustomAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.IsNativeAot))] public void FullyQualifiedName() { #if SINGLE_FILE_TEST_RUNNER @@ -104,7 +104,7 @@ public void FullyQualifiedName() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.IsNativeAot))] public void Name() { #if SINGLE_FILE_TEST_RUNNER From b6fcf6894fe0be71a85a678b5669cbd5040296b4 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 29 Apr 2026 14:43:17 +0200 Subject: [PATCH 53/73] Split ActiveIssue into separate attributes (OR semantics) Multiple member names within a single [ActiveIssue] are AND'd by DiscovererHelpers.Evaluate, so combining IsBrowser+IsCoreCLR+IsNativeAot produced an impossible condition. Use a separate [ActiveIssue] for NativeAOT to OR with the existing browser-coreclr condition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/native/configurecompiler.cmake | 5 +++++ .../System.Runtime.Tests/System/Reflection/ModuleTests.cs | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index ace8fd5fe426f3..f71ce6cf23dfa8 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -678,6 +678,11 @@ if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_HOST_WASI) # clang 20 suppressions add_compile_options($<$:-Wno-nontrivial-memaccess>) + + # Xcode 26 / newer clang suppressions for iOS-like Apple builds + add_compile_options(-Wno-jump-misses-init) + add_compile_options(-Wno-implicit-int-enum-cast) + add_compile_options(-Wno-implicit-void-ptr-cast) else() add_compile_options(-Wno-uninitialized) add_compile_options(-Wno-strict-aliasing) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index 9658b5ec062f55..d2d3043812ab54 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -81,7 +81,8 @@ public void CustomAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void FullyQualifiedName() { #if SINGLE_FILE_TEST_RUNNER @@ -104,7 +105,8 @@ public void FullyQualifiedName() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR), nameof(PlatformDetection.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void Name() { #if SINGLE_FILE_TEST_RUNNER From fdf287188ab5183bdc6f7f5b434417425b27f7a2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 12:56:35 +0200 Subject: [PATCH 54/73] Drop unrelated Xcode 26 / clang warning suppressions These three -Wno-* options were unintentionally captured by 'git add -u' in b6fcf6894fe and are unrelated to enabling NativeAOT library tests on Apple mobile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/native/configurecompiler.cmake | 37 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index f71ce6cf23dfa8..7543194c58932c 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -350,8 +350,38 @@ elseif(CLR_CMAKE_HOST_APPLE) endif() endif() elseif(CLR_CMAKE_HOST_HAIKU) + # Haiku uses the GNU toolchain, which supports WHOLE_ARCHIVE, but only CMake 3.31.0+ recognizes this. + if(CMAKE_VERSION VERSION_LESS 3.31) + if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) + execute_process(COMMAND "${CMAKE_LINKER}" --help + OUTPUT_VARIABLE __linker_help + ERROR_VARIABLE __linker_help) + if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") + set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") + else() + set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") + endif() + unset(__linker_help) + endif() + if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) + set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" + "" + "LINKER:--pop-state") + else() + set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" + "" + "LINKER:--no-whole-archive") + endif() + set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) + set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) + endif() + # Haiku uses the GNU toolchain, which supports RESCAN, but only CMake 4.4.0+ recognizes this. + if(CMAKE_VERSION VERSION_LESS 4.4) + set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:--start-group" "LINKER:--end-group") + set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE) + endif() add_compile_options($<$:-Wa,--noexecstack>) - add_linker_flag("-Wl,--no-undefined") + add_linker_flag("-Wl,--build-id=sha1") endif() #------------------------------------ @@ -678,11 +708,6 @@ if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_HOST_WASI) # clang 20 suppressions add_compile_options($<$:-Wno-nontrivial-memaccess>) - - # Xcode 26 / newer clang suppressions for iOS-like Apple builds - add_compile_options(-Wno-jump-misses-init) - add_compile_options(-Wno-implicit-int-enum-cast) - add_compile_options(-Wno-implicit-void-ptr-cast) else() add_compile_options(-Wno-uninitialized) add_compile_options(-Wno-strict-aliasing) From 89277a00b0520d37f02f5c1d1fff95f25cb95cbc Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 13:00:37 +0200 Subject: [PATCH 55/73] Tighten comments in NativeAOT Apple mobile changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 37 +++++---------- eng/testing/xunit/xunit.console.targets | 5 +- .../tests/AppleTestRunner/AppleTestRunner.cs | 4 +- .../msbuild/apple/build/AppleBuild.targets | 4 +- .../apple/data/ProxyProjectForAOTOnHelix.proj | 47 +++++++------------ 5 files changed, 34 insertions(+), 63 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 056ad5e325de11..7321cd8c2c0d84 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,18 +3,9 @@ $(BundleTestAppTargets);BundleTestAppleApp - + true true @@ -31,17 +22,13 @@ Version="$(MicrosoftDotNetXHarnessTestRunnersXunitVersion)" /> - + - + @@ -124,11 +111,9 @@ Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" /> - + <_NativeAotHelixLinkInputs Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/*.a" /> <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.a" /> diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index f732bc810459b7..816b799d3dad17 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -53,9 +53,8 @@ - + $(RunScriptCommand) -xml $(TestResultsName) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 48b4e54e6a2582..c9ae9e3e9b5657 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -169,8 +169,8 @@ protected override string IgnoredTraitsFilePath return path; } - // For NativeAOT maccatalyst apps the binary lives under .app/Contents/MacOS/ but - // xunit-excludes.txt is bundled as a resource under .app/Contents/Resources/. + // On NativeAOT maccatalyst the binary lives in .app/Contents/MacOS/ but + // xunit-excludes.txt is bundled under .app/Contents/Resources/. string? appBase = Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar)); if (appBase is not null) { diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index ed0de8a073da80..a4333856af50fd 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -21,8 +21,8 @@ - + diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index ff44e2ecf2f026..0b9b7e9ab48e14 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -50,19 +50,16 @@ - + <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a - + <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix @@ -75,14 +72,9 @@ - + - + <_NativeAotHelixLinkLibs Include="$(_NativeAotLinkInputsDir)libbootstrapperdll.o" /> @@ -136,13 +127,11 @@ - + - + @@ -156,10 +145,8 @@ 127.0.0.1:9000,nosuspend,listen - + From f43aec463218730654b66f64978dcc0e8294212b Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 13:06:56 +0200 Subject: [PATCH 56/73] Drop EnableAggressiveTrimming from extra-platforms NativeAOT_Smoke legs Matches the runtime.yml ios_arm64 NativeAOT_Smoke leg, which does not pass this flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 2 +- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 16528c51f7916e..4b4c576ab3ee4a 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -116,7 +116,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 0759d7368689ec..c4c0136a8d2a3d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -111,7 +111,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 9d39878d1505d9..33cd9622cf30a5 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -148,7 +148,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: @@ -181,7 +181,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_Smoke_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAggressiveTrimming=true /p:EnableAppSandbox=true + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: From cebe85f4cbd88b7e1fd4b8264421895574550c8a Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 13:14:54 +0200 Subject: [PATCH 57/73] Drop unrelated isiOSLikeOnlyBuild parameter rename Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../runtime-extra-platforms-ioslikesimulator.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index c4c0136a8d2a3d..c3f077f1bf513c 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -55,7 +55,7 @@ jobs: buildConfig: Release runtimeFlavor: mono isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - iossimulator_arm64 variables: @@ -98,7 +98,7 @@ jobs: buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - iossimulator_x64 - iossimulator_arm64 @@ -168,7 +168,7 @@ jobs: buildConfig: Release runtimeFlavor: coreclr isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} platforms: - iossimulator_arm64 variables: From da04ba0169181802f7f5ea09524ba81a130d86d4 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 13:21:51 +0200 Subject: [PATCH 58/73] Drop dead rd.xml Copy targets and unused _AppleNativeAotCompileDependsOn The rd.xml Copy targets in tests.ioslike.targets shipped rd.xml into the Helix bundle, but ILC runs on the host (consuming @(RdXmlFile) from tests.singlefile.targets) and nothing on Helix reads the file. _AppleNativeAotCompileDependsOn switching is unreachable: library tests on Helix override _AotCompileTargetName to _NoOpNativeAotCompileOnHelix, so _AppleNativeAotCompile is never invoked there. Functional tests don't set SkipIlcCompile=true, so the substitution always resolves to IlcCompile, identical to the original. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 7 ------- src/mono/msbuild/apple/build/AppleBuild.props | 2 -- src/mono/msbuild/apple/build/AppleBuild.targets | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 7321cd8c2c0d84..4c630f1e25f79b 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -141,13 +141,6 @@ - - - <_PublishBundleFiles Include="@(BundleFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> diff --git a/src/mono/msbuild/apple/build/AppleBuild.props b/src/mono/msbuild/apple/build/AppleBuild.props index 80076e380df114..ec67cde3c84259 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.props @@ -36,8 +36,6 @@ <_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' == 'true'">_AppleNativeAotCompile <_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' != 'true'">_AppleAotCompile ComputeIlcCompileInputs;SetupOSSpecificProps;PrepareForILLink - <_AppleNativeAotCompileDependsOn Condition="'$(SkipIlcCompile)' != 'true'">IlcCompile - <_AppleNativeAotCompileDependsOn Condition="'$(SkipIlcCompile)' == 'true'">SetupOSSpecificProps <_ReadRuntimeComponentsManifestTargetName Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(UseMonoRuntime)' != 'false'">_MonoReadAvailableComponentsManifest Publish diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index a4333856af50fd..a9e431e4b66b55 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -285,7 +285,7 @@ + DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;IlcCompile;$(_IlcLibraryBuildDependsOn);_PublishNativeBinary" /> Date: Thu, 30 Apr 2026 13:30:35 +0200 Subject: [PATCH 59/73] Restore original xunit.console.targets comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/xunit/xunit.console.targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index 816b799d3dad17..e3b2fbfa916bb6 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -53,8 +53,7 @@ - + $(RunScriptCommand) -xml $(TestResultsName) From 7fb4f8d1ab41fbf4cfa27001badff2cb1246c93c Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 13:38:56 +0200 Subject: [PATCH 60/73] Remove explanatory comments and IsNativeAot ActiveIssue annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IsNativeAot ActiveIssue lines are reverted per request — the 3 tests (ModuleTests.Name, ModuleTests.FullyQualifiedName, DoubleTests.ParsePatterns) will now fail again on the NativeAOT smoke leg. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 4 ---- eng/testing/xunit/xunit.console.targets | 1 - .../System/DoubleTests.cs | 1 - .../System/Reflection/ModuleTests.cs | 2 -- .../msbuild/apple/build/AppleBuild.targets | 2 -- .../apple/data/ProxyProjectForAOTOnHelix.proj | 21 ++----------------- 6 files changed, 2 insertions(+), 29 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 4c630f1e25f79b..ea2b0b026ba89b 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -26,9 +26,6 @@ AppleAppBuilder-generated objc main (e.g. mono_ios_set_summary). --> - @@ -223,7 +220,6 @@ true true AppleTestRunner.dll - $(PublishDir) diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index e3b2fbfa916bb6..114b098b09acdd 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -53,7 +53,6 @@ - $(RunScriptCommand) -xml $(TestResultsName) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index 0d6e18f47a08e3..e567324ba71741 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,7 +536,6 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index d2d3043812ab54..df758d8faca60c 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -82,7 +82,6 @@ public void CustomAttributes() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void FullyQualifiedName() { #if SINGLE_FILE_TEST_RUNNER @@ -106,7 +105,6 @@ public void FullyQualifiedName() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void Name() { #if SINGLE_FILE_TEST_RUNNER diff --git a/src/mono/msbuild/apple/build/AppleBuild.targets b/src/mono/msbuild/apple/build/AppleBuild.targets index a9e431e4b66b55..c3ed3e2b04e254 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.targets +++ b/src/mono/msbuild/apple/build/AppleBuild.targets @@ -21,8 +21,6 @@ - diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 0b9b7e9ab48e14..d6e5badba0ada8 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -51,15 +51,13 @@ + .props import so $(AssemblyName) is available. --> <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a + fully rewrite AppleBuildDependsOn. --> <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix @@ -72,9 +70,6 @@ - - <_NativeAotHelixLinkLibs Include="$(_NativeAotLinkInputsDir)libbootstrapperdll.o" /> @@ -108,7 +101,6 @@ true AppleTestRunner.dll - $(OriginalPublishDir) @@ -127,13 +119,6 @@ - - - - - @@ -145,8 +130,6 @@ 127.0.0.1:9000,nosuspend,listen - From cbca90cfa9e811239627f9a27f1c961a5742dbb1 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 14:51:00 +0200 Subject: [PATCH 61/73] Drop AppleBuildDependsOn rewrite; rely on _AotCompileTargetName override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Directory.Build.props auto-import already builds the chain, and the proxy header at line 10 prepends the Helix-specific targets and appends _AfterAppleBuildOnHelix. Setting _AotCompileTargetName=_NoOpNativeAotCompileOnHelix is enough — the default chain expands $(_AotCompileTargetName) to it. The remaining default targets (_ScanAssembliesDecideLightweightMarshaler, $(_ProcessRuntimeComponentsForLibraryMode), _BuildNativeLibrary) are gated to no-op for NativeAOT. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 23 ++++++------------- eng/testing/xunit/xunit.console.targets | 1 + .../tests/AppleTestRunner/AppleTestRunner.cs | 4 ++-- .../apple/data/ProxyProjectForAOTOnHelix.proj | 6 +---- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index ea2b0b026ba89b..f0fd3ca6468087 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -3,9 +3,8 @@ $(BundleTestAppTargets);BundleTestAppleApp - + true true @@ -16,15 +15,10 @@ - - - + + - - + @@ -108,15 +102,12 @@ Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" /> - + <_NativeAotHelixLinkInputs Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/*.a" /> <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.a" /> <_NativeAotHelixLinkInputs Include="$(CoreCLRAotSdkDir)*.o" /> - + diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index 114b098b09acdd..e3b2fbfa916bb6 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -53,6 +53,7 @@ + $(RunScriptCommand) -xml $(TestResultsName) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index c9ae9e3e9b5657..040ba8b1050a05 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -169,8 +169,8 @@ protected override string IgnoredTraitsFilePath return path; } - // On NativeAOT maccatalyst the binary lives in .app/Contents/MacOS/ but - // xunit-excludes.txt is bundled under .app/Contents/Resources/. + // On NativeAOT maccatalyst the binary lives in .app/Contents/MacOS/ + // but xunit-excludes.txt is bundled under .app/Contents/Resources/. string? appBase = Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar)); if (appBase is not null) { diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index d6e5badba0ada8..177db22af59789 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -50,17 +50,13 @@ - + <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a - <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix - PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_NoOpNativeAotCompileOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix true From ff6997f871e2c7e59f0aeee580a3681517cdfd61 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 15:08:26 +0200 Subject: [PATCH 62/73] Consolidate NativeAOT-on-Helix proxy bits behind _NativeAotLibraryTestOnHelix - Single shorthand property gates all NativeAOT library-test additions. - Group the related PropertyGroup, ItemGroup, and Target adjacently. - Rename _NoOpNativeAotCompileOnHelix to _StageNativeAotLinkInputsOnHelix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../apple/data/ProxyProjectForAOTOnHelix.proj | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 177db22af59789..fa9d2b0086c97b 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -51,23 +51,24 @@ - - <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a + + <_NativeAotLibraryTestOnHelix Condition="'$(UseNativeAOTRuntime)' == 'true' and '$(_UseNativeAOTLibraryModeBundling)' != 'true' and '$(IncludesTestRunner)' != 'false'">true - - <_AotCompileTargetName>_NoOpNativeAotCompileOnHelix + + <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a + <_AotCompileTargetName>_StageNativeAotLinkInputsOnHelix true - + - + @@ -96,15 +97,14 @@ true - AppleTestRunner.dll - + AppleTestRunner.dll + $(OriginalPublishDir) $(TestRootDir)AppBundle\ - - + @@ -126,7 +126,7 @@ 127.0.0.1:9000,nosuspend,listen - + From bcddb8629bb10a9037390d6e3effd0c9fd4456dc Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 17:38:59 +0200 Subject: [PATCH 63/73] Fix NativeAOT_Smoke regression: rewire AppleBuildDependsOn AppleBuild.props eagerly expands $(_AotCompileTargetName) when defining AppleBuildDependsOn. The override of _AotCompileTargetName in the proxy therefore never reaches the chain, leaving _AppleNativeAotCompile (which depends on IlcCompile) in the dependency list. ILC then runs on Helix and crashes because the host build only emitted lib.a, not a .dll. Replace _AppleNativeAotCompile with _StageNativeAotLinkInputsOnHelix in AppleBuildDependsOn directly via String.Replace. This restores the chain shape that worked in build 1401875. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index fa9d2b0086c97b..ec90be4c6e4a33 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -59,6 +59,10 @@ <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a <_AotCompileTargetName>_StageNativeAotLinkInputsOnHelix true + + $(AppleBuildDependsOn.Replace('_AppleNativeAotCompile', '_StageNativeAotLinkInputsOnHelix')) From 67eca00d4ba47912961b2a16e8d5e1dbecec11a5 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 17:40:30 +0200 Subject: [PATCH 64/73] Remove AppleBuildDependsOn rewrite comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index ec90be4c6e4a33..1fb85596d924c9 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -59,9 +59,6 @@ <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a <_AotCompileTargetName>_StageNativeAotLinkInputsOnHelix true - $(AppleBuildDependsOn.Replace('_AppleNativeAotCompile', '_StageNativeAotLinkInputsOnHelix')) From 37d892efdea3f45a78f8d309b39f1d89c3b16f99 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 30 Apr 2026 20:26:21 +0200 Subject: [PATCH 65/73] Restore hand-written AppleBuildDependsOn chain The String.Replace approach produced a multi-line value that MSBuild collapsed into a single target name (MSB4057). Use the explicit single-line chain that previously worked in build 1401875. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index 1fb85596d924c9..ea26be7f519326 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -57,9 +57,8 @@ <_PrebuiltNativeAOTLib>$(OriginalPublishDir)lib$(AssemblyName).a - <_AotCompileTargetName>_StageNativeAotLinkInputsOnHelix true - $(AppleBuildDependsOn.Replace('_AppleNativeAotCompile', '_StageNativeAotLinkInputsOnHelix')) + PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_StageNativeAotLinkInputsOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix From db92fd46db375556496705bf7f3302dd9a20e0e2 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 5 May 2026 11:15:27 +0200 Subject: [PATCH 66/73] Skip 3 System.Runtime.Tests failing on NativeAOT Apple mobile Tracked under https://github.com/dotnet/runtime/issues/127786. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System.Runtime.Tests/System/DoubleTests.cs | 1 + .../tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index e567324ba71741..946ec2c12cda41 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -536,6 +536,7 @@ internal static string Reverse(string s) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/127786", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsNativeAot))] public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs index df758d8faca60c..757fa7c80a8ea1 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ModuleTests.cs @@ -82,6 +82,7 @@ public void CustomAttributes() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/127786", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsNativeAot))] public void FullyQualifiedName() { #if SINGLE_FILE_TEST_RUNNER @@ -105,6 +106,7 @@ public void FullyQualifiedName() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/123011", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/127786", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsNativeAot))] public void Name() { #if SINGLE_FILE_TEST_RUNNER From e2c4cf84576ce58d74a4471bd2ab3e52202d37ec Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 5 May 2026 16:28:55 +0200 Subject: [PATCH 67/73] Run full library test set on NativeAOT Apple mobile Drop /p:RunSmokeTestsOnly=true from the four NativeAOT Apple-mobile legs (ios-arm64, iossimulator, maccatalyst, maccatalyst AppSandbox) and rename the legs from AllSubsets_NativeAOT_Smoke to AllSubsets_NativeAOT. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 4 ++-- .../runtime-extra-platforms-ioslikesimulator.yml | 4 ++-- .../runtime-extra-platforms-maccatalyst.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 4b4c576ab3ee4a..3cf764e9369afb 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -115,8 +115,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index c3f077f1bf513c..0eea2e3a728d25 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -110,8 +110,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index 33cd9622cf30a5..e61d9af04f1d2f 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -147,8 +147,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_Smoke - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true + nameSuffix: AllSubsets_NativeAOT + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: @@ -180,8 +180,8 @@ jobs: value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_NativeAOT_Smoke_AppSandbox - buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true + nameSuffix: AllSubsets_NativeAOT_AppSandbox + buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true timeoutInMinutes: 180 # extra steps, run tests postBuildSteps: From b99d2d4f90bb5fbe371d4e35ddb67f17b5853919 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 5 May 2026 16:33:41 +0200 Subject: [PATCH 68/73] Apply DirectPInvoke=__Internal to all NativeAOT proxy paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Functional tests with custom Main (IncludesTestRunner=false) PInvoke into mono_ios_set_summary in the AppleAppBuilder-generated objc main. They run ILC on Helix via the proxy, so the proxy must emit DirectPInvoke __Internal for them too — not just for library tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj index ea26be7f519326..5070547f11d8c7 100644 --- a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -61,7 +61,7 @@ PrepareForAppleBuild;_PublishRuntimePack;_PrepareForAppleBuildAppOnHelix;_RunR2RCompilationOnHelix;_InitializeCommonProperties;_BeforeAppleBuild;_AppleResolveReferences;_StageNativeAotLinkInputsOnHelix;_AppleGenerateAppBundle;_AfterAppleBuild;_AfterAppleBuildOnHelix - + From 4eae8d69b2002e7656dec59dfc8b18160a109ed8 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 6 May 2026 11:45:12 +0200 Subject: [PATCH 69/73] Scope NativeAOT Apple-mobile additions to .NETCoreApp TFM Multi-targeted test projects (e.g. Microsoft.Extensions.Hosting.Abstractions.Tests targeting net481+net11.0) hit NU1202 because Microsoft.DotNet.XHarness.TestRunners.Xunit isn't compatible with .NETFramework. The smoke set (System.Runtime.Tests) is single-TFM so the issue surfaced only when the full library test set was enabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index f0fd3ca6468087..5db83011f8d277 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -14,7 +14,7 @@ true - + From 805311cb30014c4c8e4aac3cdf3ecfeb8d20bc52 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 7 May 2026 15:31:50 +0200 Subject: [PATCH 70/73] Fix NativeAOT build errors for full Apple-mobile test set - AppleTestRunner.GetTestAssemblies: suppress IL2026 since the Assembly.LoadFrom branch is unreachable on NativeAOT (s_testAssemblies is populated from AppDomain.CurrentDomain.GetAssemblies()). - src/libraries/tests.proj: exclude the ReflectionInvokeEmit and ReflectionInvokeInterpreted tests on Apple-mobile NativeAOT. They use runtimeconfig.template.json which PublishAot rejects, the Emit path is not supported on NativeAOT, and the interpreted path is already the NativeAOT default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Common/tests/AppleTestRunner/AppleTestRunner.cs | 3 +++ src/libraries/tests.proj | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index 040ba8b1050a05..c126ccaeaa5693 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -6,6 +6,7 @@ using System.Text; using System.IO; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -128,6 +129,8 @@ public SimpleTestRunner(bool verbose) } } + [UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode", + Justification = "On NativeAOT s_testAssemblies is populated from AppDomain.CurrentDomain.GetAssemblies() and the Assembly.LoadFrom branch is never taken.")] protected override IEnumerable GetTestAssemblies() { if (s_testAssemblies is not null) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 54c60bec4ca1c3..777aeee94b2442 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -338,6 +338,11 @@ + + + + + From 18e92136883790afeed77d1e7b3abe59339a4182 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 11 May 2026 14:34:18 +0200 Subject: [PATCH 71/73] Address remaining Apple-mobile NativeAOT build errors - AppleTestRunner.cs: enable nullable file-scoped so existing '?' annotations don't break test projects without project-wide nullable. - tests.ioslike.targets: set _SuppressNativeLibEventSourceWarning when publishing tests as NativeLib=Static (matches tests.android.targets). - src/libraries/tests.proj: extend Apple-mobile NativeAOT exclusions to System.Reflection.Tests Invoke{Emit,Interpreted} and exclude System.Formats.Cbor.Tests (F# generic recursion under ILC). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.ioslike.targets | 1 + src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs | 2 ++ src/libraries/tests.proj | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 5db83011f8d277..2507cf01105ad3 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -12,6 +12,7 @@ <_IsPublishing Condition="'$(_IsPublishing)' == ''">true Static true + <_SuppressNativeLibEventSourceWarning>true diff --git a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs index c126ccaeaa5693..78623ff27b7d2c 100644 --- a/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs +++ b/src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#nullable enable + using System; using System.Linq; using System.Text; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 777aeee94b2442..63566d076f1823 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -341,6 +341,10 @@ + + + + From 6a13e914aa20ab4a36bdfb01b77a9be657b38f36 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 12 May 2026 10:56:01 +0200 Subject: [PATCH 72/73] Bump Apple-mobile NativeAOT extra-platforms timeout to 240 minutes Build product (ILC of ~150 library test projects) was hitting the 180-minute AzDO job timeout on iossimulator/maccatalyst/tvos. 240 matches the timeout used by the corresponding CoreCLR full-set legs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../extra-platforms/runtime-extra-platforms-ioslike.yml | 2 +- .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- .../extra-platforms/runtime-extra-platforms-maccatalyst.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 3cf764e9369afb..5739147e58f822 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -117,7 +117,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true - timeoutInMinutes: 180 + timeoutInMinutes: 240 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index 0eea2e3a728d25..52917d8ae2aa3b 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -112,7 +112,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true - timeoutInMinutes: 180 + timeoutInMinutes: 240 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml index e61d9af04f1d2f..6db62a0f223262 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml @@ -149,7 +149,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true - timeoutInMinutes: 180 + timeoutInMinutes: 240 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml @@ -182,7 +182,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_NativeAOT_AppSandbox buildArgs: --cross -s clr.alljits+clr.tools+clr.nativeaotruntime+clr.nativeaotlibs+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:BuildTestsOnHelix=true /p:UseNativeAOTRuntime=true /p:RunAOTCompilation=false /p:ContinuousIntegrationBuild=true /p:EnableAppSandbox=true - timeoutInMinutes: 180 + timeoutInMinutes: 240 # extra steps, run tests postBuildSteps: - template: /eng/pipelines/libraries/helix.yml From 50686ad2ff4e31720ac4f1b442bb4bcb0a2a3ba7 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 12 May 2026 16:27:46 +0200 Subject: [PATCH 73/73] Drop F# IL3054 comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/tests.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 63566d076f1823..c25a59d132ee14 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -343,7 +343,6 @@ -