Skip to content

Enable NativeAOT library tests on Apple mobile platforms#125437

Draft
kotlarmilos wants to merge 42 commits intodotnet:mainfrom
kotlarmilos:enable-nativeaot-libs-tests-mobile
Draft

Enable NativeAOT library tests on Apple mobile platforms#125437
kotlarmilos wants to merge 42 commits intodotnet:mainfrom
kotlarmilos:enable-nativeaot-libs-tests-mobile

Conversation

@kotlarmilos
Copy link
Copy Markdown
Member

@kotlarmilos kotlarmilos commented Mar 11, 2026

Description

Replace NativeAOT runtime test legs with library test legs on iOS/tvOS devices, iOS/tvOS simulators, and Mac Catalyst.

Depends on dotnet/xharness#1554

Fixes #81075

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Apple “extra platforms” CI legs to validate NativeAOT on iOS/tvOS devices, iOS/tvOS simulators, and Mac Catalyst by running libraries tests (via Helix) instead of the minimal NativeAOT runtime SmokeTests, improving OS-specific coverage (crypto/networking/globalization) on mobile.

Changes:

  • Switch NativeAOT Apple-mobile legs from runtime SmokeTests submission to eng/pipelines/libraries/helix.yml submission of libraries tests.
  • Use eng/pipelines/libraries/helix-queues-setup.yml and pass NeedsToBuildAppsOnHelix=true for the new legs.
  • Update naming/args to use $(_runSmokeTestsOnlyArg) and fix path-evaluation variable naming in affected legs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml Replaces NativeAOT runtime SmokeTests legs with libraries test legs (including App Sandbox variant) using libraries Helix templates/queues.
eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml Replaces NativeAOT runtime SmokeTests on iOS/tvOS simulators with libraries tests using libraries Helix templates/queues.
eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml Adjusts NativeAOT iOS/tvOS device leg to use $(_runSmokeTestsOnlyArg) for libraries tests and removes the old NativeAOT runtime SmokeTests device leg.

You can also share your feedback on Copilot code review. Take the survey.

dotnet-maestro bot and others added 5 commits March 12, 2026 10:30
…60312.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
…60312.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
…60314.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
…60317.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
…60318.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
@kotlarmilos kotlarmilos marked this pull request as draft March 18, 2026 12:57
…bb6-53258cb4f260' into enable-nativeaot-libs-tests-mobile
Copilot AI review requested due to automatic review settings March 18, 2026 13:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@kotlarmilos kotlarmilos marked this pull request as ready for review April 9, 2026 11:07
@kotlarmilos kotlarmilos requested a review from steveisok as a code owner April 9, 2026 11:07
Copilot AI review requested due to automatic review settings April 9, 2026 11:07
@kotlarmilos
Copy link
Copy Markdown
Member Author

This PR stands up Native AOT library tests on Apple mobile. It replaces a subset of runtime tests that were not relevant for Apple mobile. Note it enables only System.Runtime.Tests. The full run revealed 66 failures tracked in #126697. I briefly went through some of the failures and they look trimming related.

The follow-up effort should bring these tests into the CI to improve testing coverage of Native AOT along with CoreCLR.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

…eInput handling in ProxyProjectForAOTOnHelix
@kotlarmilos kotlarmilos force-pushed the enable-nativeaot-libs-tests-mobile branch from 01d5d83 to a8eae52 Compare April 9, 2026 11:34
…ple mobile ActiveIssue annotations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 9, 2026 20:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

@kotlarmilos
Copy link
Copy Markdown
Member Author

@jkoritzinsky @matouskozak Please take a look again

}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67531", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot), nameof(PlatformDetection.IsAppleMobile))]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This issue does not look related to what the tests is testing.

Is this correct issue link?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Likely the same underlying problem as #126730 (comment)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, it is likely related to trimming. Let's try a different approach and trim on build machines.

@MichalStrehovsky
Copy link
Copy Markdown
Member

Actually looking at the changes here, all the trimming issues are likely caused by mismatch between how compilation would happen with regular publish vs what ProxyProjectForAOTOnHelix.proj sets up and we are ending up building different configurations.

Do we need to keep doing ProxyProjectForAOTOnHelix.proj? Why can't we let the publish happen on the build machines, like the other platforms?

@kotlarmilos
Copy link
Copy Markdown
Member Author

The only concern is build time on Helix machines. dotnet publish would include app bundling and signing, which is time consuming. However, you are correct. it should be done on build machines, and going forward this approach would only cause problems, needing to match dotnet publish with what we do on Helix.

Let's try to split trimming and publish, and do trimming and ILC on build machines and app bundling on Helix.

@steveisok
Copy link
Copy Markdown
Member

Let's try to split trimming and publish, and do trimming and ILC on build machines and app bundling on Helix.

Worth a try but chances are good you'll timeout. Depends on how much extra time it adds on the build step.

@MichalStrehovsky
Copy link
Copy Markdown
Member

Worth a try but chances are good you'll timeout. Depends on how much extra time it adds on the build step.

We use a 6 hour timeout for the libraries legs in native AOT testing. In practice it's less than that, but this accounts for Helix delays as well. I just checked a recent ARM64 mac outerloop leg build: it was about 3 hours to build the product and tests (including AOT compiling them). The Build product leg of the maccatalyst leg in this PR was 50 minutes (but we also didn't build all the tests, only System.Runtime, so it's not representative).

It will take longer, but not LLVM-longer. But in return we get compat with all the switches the tests might be setting (trimming settings are not the only things we sometimes tweak per test project - it's also things like invariant globalization and bunch of others that we can set at compile time - root causing the failing tests to a missing compile-time switch can be pretty annoying).

@kotlarmilos kotlarmilos marked this pull request as draft April 13, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Enable building/running libraries tests on iOS simulator and device with NativeAOT

7 participants