[clr-ios] Disable R2R IL-body stripping for library tests that need IL at run time#130360
Merged
kotlarmilos merged 1 commit intoJul 9, 2026
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>
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Contributor
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
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jul 8, 2026
Open
Member
Author
|
Tests pass on Apple mobile with no InvalidProgramException / NullReferenceException:
|
jakobbotsch
approved these changes
Jul 9, 2026
Member
Author
|
/ba-g non-related extra platforms failures |
kotlarmilos
added a commit
that referenced
this pull request
Jul 13, 2026
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.