Uh oh!
There was an error while loading. Please reload this page.
[clr-ios] Disable R2R IL-body stripping for library tests that need IL at run time - #130360
Conversation
…L at run time The Apple mobile CoreCLR library test apps are published as a composite ReadyToRun image with IL bodies stripped, which the SDK turns on by default for iOS-like runtime identifiers. A stripped body is replaced with an invalid stub, so any test that needs the real IL at run time fails. System.Runtime.Loader.Tests, System.Reflection.DispatchProxy.Tests and System.Xml.XmlSerializer.ReflectionOnly.Tests load assemblies into collectible AssemblyLoadContext instances, which cannot use the R2R native code and recompile from IL, so they throw InvalidProgramException. System.Reflection.Metadata.Tests reads a stripped method body directly and throws BadImageFormatException. Forward PublishReadyToRunStripILBodies through the _ApplePropertyNames allowlist in tests.ioslike.targets and set it to false on these four test projects, leaving stripping on for every other Apple mobile CoreCLR test app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
Pull request overview
This PR updates the Apple mobile (“ioslike”) CoreCLR library test publish pipeline to preserve IL bodies for a small set of test projects that require IL at runtime, by explicitly disabling ReadyToRun IL-body stripping and ensuring that setting is forwarded through the Helix proxy-project property allowlist.
Changes:
- Set
PublishReadyToRunStripILBodies=falsein four library test projects that need IL bodies at runtime. - Add
PublishReadyToRunStripILBodiesto the_ApplePropertyNamesallowlist ineng/testing/tests.ioslike.targetsso the Helix AOT/proxy build sees the project-level setting.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj | Disables R2R IL-body stripping for this test project. |
| src/libraries/System.Reflection.Metadata/tests/System.Reflection.Metadata.Tests.csproj | Disables R2R IL-body stripping for this test project. |
| src/libraries/System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj | Disables R2R IL-body stripping for this test project. |
| src/libraries/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj | Disables R2R IL-body stripping for this test project. |
| eng/testing/tests.ioslike.targets | Allows PublishReadyToRunStripILBodies to flow into the Helix proxy project via _ApplePropertyNames. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 0
kotlarmilos
commented
Jul 8, 2026
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kotlarmilos
commented
Jul 9, 2026
Tests pass on Apple mobile with no InvalidProgramException / NullReferenceException:
|
kotlarmilos
commented
Jul 9, 2026
/ba-g non-related extra platforms failures |
Uh oh!
There was an error while loading. Please reload this page.
…eed IL at run time (#130468) ## Description Follow-up to #130360. The SDK strips IL bodies from the Apple mobile CoreCLR composite ReadyToRun image by default, replacing each body with an invalid stub, so any test that needs the real IL at run time fails. Three more projects hit this: `System.Runtime.Extensions.Tests` (`AppDomainTests.ExecuteAssembly` invokes a stripped entry point, `InvalidProgramException`), `System.IO.Hashing.Tests` (`Crc64ParameterSet.ForwardCrc64.InitializeVectorized`, a `Vector128` intrinsic fallback), and `System.Diagnostics.StackTrace.Tests` (the runtime-async `V2Methods.Quuux` in `ToString_Async`). This sets `PublishReadyToRunStripILBodies` to `false` on those three test projects, which #130360 already forwards through the `_ApplePropertyNames` allowlist, leaving stripping on for every other Apple mobile CoreCLR test app. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…L at run time (#130360) ## Description The Apple mobile CoreCLR library test apps are published as a composite ReadyToRun image with IL bodies stripped, which the SDK turns on by default for iOS-like runtime identifiers. A stripped body is replaced with an invalid stub, so any test that needs the real IL at run time fails. `System.Runtime.Loader.Tests`, `System.Reflection.DispatchProxy.Tests`, and `System.Xml.XmlSerializer.ReflectionOnly.Tests` load assemblies into collectible `AssemblyLoadContext` instances, which cannot use the R2R native code and recompile from IL, so they throw `InvalidProgramException`; `System.Reflection.Metadata.Tests` reads a stripped method body directly and throws `BadImageFormatException`. The on-Helix AOT build reads only the properties forwarded through the `_ApplePropertyNames` allowlist in `tests.ioslike.targets`, so this change adds `PublishReadyToRunStripILBodies` to that allowlist and sets it to `false` on these four test projects, leaving stripping on for every other Apple mobile CoreCLR test app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eed IL at run time (#130468) ## Description Follow-up to #130360. The SDK strips IL bodies from the Apple mobile CoreCLR composite ReadyToRun image by default, replacing each body with an invalid stub, so any test that needs the real IL at run time fails. Three more projects hit this: `System.Runtime.Extensions.Tests` (`AppDomainTests.ExecuteAssembly` invokes a stripped entry point, `InvalidProgramException`), `System.IO.Hashing.Tests` (`Crc64ParameterSet.ForwardCrc64.InitializeVectorized`, a `Vector128` intrinsic fallback), and `System.Diagnostics.StackTrace.Tests` (the runtime-async `V2Methods.Quuux` in `ToString_Async`). This sets `PublishReadyToRunStripILBodies` to `false` on those three test projects, which #130360 already forwards through the `_ApplePropertyNames` allowlist, leaving stripping on for every other Apple mobile CoreCLR test app. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
The Apple mobile CoreCLR library test apps are published as a composite ReadyToRun image with IL bodies stripped, which the SDK turns on by default for iOS-like runtime identifiers. A stripped body is replaced with an invalid stub, so any test that needs the real IL at run time fails.
System.Runtime.Loader.Tests,System.Reflection.DispatchProxy.Tests, andSystem.Xml.XmlSerializer.ReflectionOnly.Testsload assemblies into collectibleAssemblyLoadContextinstances, which cannot use the R2R native code and recompile from IL, so they throwInvalidProgramException;System.Reflection.Metadata.Testsreads a stripped method body directly and throwsBadImageFormatException.The on-Helix AOT build reads only the properties forwarded through the
_ApplePropertyNamesallowlist intests.ioslike.targets, so this change addsPublishReadyToRunStripILBodiesto that allowlist and sets it tofalseon these four test projects, leaving stripping on for every other Apple mobile CoreCLR test app.