[mobile] Enable NativeAOT library tests on Apple mobile platforms#125437
[mobile] Enable NativeAOT library tests on Apple mobile platforms#125437kotlarmilos wants to merge 98 commits into
Conversation
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>
There was a problem hiding this comment.
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.ymlsubmission of libraries tests. - Use
eng/pipelines/libraries/helix-queues-setup.ymland passNeedsToBuildAppsOnHelix=truefor 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.
…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
…bb6-53258cb4f260' into enable-nativeaot-libs-tests-mobile
There was a problem hiding this comment.
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.
|
Azure Pipelines successfully started running 1 pipeline(s). |
| <TrimmerRootAssembly Include="Microsoft.DotNet.XUnitExtensions" /> | ||
| <TrimmerRootAssembly Include="xunit.core" /> | ||
| <TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.xunit.xml" /> |
There was a problem hiding this comment.
What breaks without this? With "Is this needed?" I meant that I don't understand the platform difference here. Rooting less stuff means faster CI and faster compile times and being closer to user scenarios.
There was a problem hiding this comment.
Desktop NativeAOT uses TrimMode=partial, so xunit aren't trimmable packages and stay intact. Mobile NativeAOT uses TrimMode=link to match the shipping configuration.
AppleTestRunner: set CurrentDirectory to AppContext.BaseDirectory at
startup. On the Mono path mono_ios_runtime_init redirects CWD to the
bundle root; on NativeAOT we don't have that fixup, so test data
shipped alongside the test assemblies (via Content/CopyToOutputDirectory)
isn't reachable via relative paths and DirectoryNotFoundException is
thrown for paths like '/TestData/...', '/UncompressedTestFiles/...'.
This fixes ~10 'test data not bundled' failures across:
Microsoft.Bcl.Cryptography, Microsoft.Extensions.Hosting.Unit,
System.Data.DataSetExtensions, System.Diagnostics.FileVersionInfo,
System.IO.Compression{,.Brotli,.ZipFile}, System.IO.Packaging,
System.Net.HttpListener, System.Net.NetworkInformation.Functional,
System.Resources.ResourceManager.
tests.proj: drop those exclusions, drop the tvos-only entries that
were excluded due to device infra flakes (PACKAGE_INSTALLATION_FAILURE,
APP_NOT_SIGNED, APP_LAUNCH_TIMEOUT - see helix job
328c0bc1-9e81-4725-9804-11cf937fe8c0 in build 1428144). Keep only the
4 real failure categories: EventSource tests requiring EventSourceSupport=true
(2) and Apple-mobile behavioural differences (2).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The desktop NativeAOT smoke set (11 projects, incl. System.IO.FileSystem and System.IO.Compression) was previously gated only on TestNativeAot. Now that tests.proj derives TestNativeAot for Apple-mobile, this set started running on the Apple-mobile NativeAOT_Smoke legs and surfaced preexisting failures (e.g. FileSystem UnixFileMode SetUser/SetGroup denied by iOS sandbox). Add 'TargetsAppleMobile != true' to keep the Apple-mobile smoke leg at the existing 'System.Runtime.Tests + iOS functional tests' set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Mac Catalyst bundles binaries in .app/Contents/MacOS but test content (via Content/CopyToOutputDirectory) lands in .app/Contents/Resources. chdir(AppContext.BaseDirectory) lands in MacOS where the data isn't, so paths like 'ZLibTestData/foo' still resolve to a missing path. Detect the sibling Resources directory and chdir there when present; iOS/tvOS/simulators stay on AppContext.BaseDirectory. Confirmed via build 1429871 that the chdir-only fix made System.IO.Compression.Tests pass on iossim (1451/1451) but failed on maccatalyst because of this layout difference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Address @jkotas review feedback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Replace the blanket .json exclusion in the NativeAOT bundler path with specific publish-metadata suffixes (.deps.json, .runtimeconfig.json, .runtimeconfig.dev.json). Content files like appSettings.json now flow through to the .app/ bundle, fixing CanConfigureAppConfigurationFromFile and similar tests in Microsoft.Extensions.Hosting.Unit.Tests on iOS, tvOS, and MacCatalyst NativeAOT. The .dll exclusion is left in place because NativeAOT publish output contains ILC intermediate .dll files that legitimately shouldn't be bundled; separating content .dll from intermediate .dll requires a broader publish-folder refactor (per the existing TODO). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
Enables NativeAOT library tests on Apple mobile in extra platforms by wiring the trim+ILC step on the host build leg and consuming the produced static library in
AppleAppBuilderlibrary mode on the Helix.Build flow
NativeLib=Static+CustomNativeMain=true, producinglib<TestAssembly>.aplus the staged ILC link inputs.eng/testing/tests.ioslike.targetsis updated to setTestNativeAot/TestSingleFile/PublishAotUsingRuntimePackand to opt into_SuppressNativeLibEventSourceWarningfor the static-library path.src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.projno longer re-runs ILC on the agent. It detects the prebuilt static library via the new_NativeAotLibraryTestOnHelixproperty, replaces_AppleNativeAotCompilein$(AppleBuildDependsOn)with_StageNativeAotLinkInputsOnHelix, and unconditionally addsDirectPInvoke __Internalso the AppleAppBuilder-generated objc symbols (mono_ios_set_summary, …) are statically resolved by ILC.Pipelines
runtime.ymlkeeps the existingAllSubsets_NativeAOT_Smokelegs for iOS device + maccatalyst arm64, runsSystem.Runtime.Testsplus iOS functional tests.eng/pipelines/extra-platforms/runtime-extra-platforms-{ioslike,ioslikesimulator,maccatalyst}.ymladdAllSubsets_NativeAOT[_AppSandbox]legs. They run a curated subset of library tests: System.Runtime, System.Collections, System.Linq, System.Threading, System.Threading.Tasks, System.Net.Http.Functional.Depends on dotnet/xharness#1554
Fixes #81075