Conversation
…platforms Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/e2f3da2e-9a15-4070-88f0-5ba5d47cedfc Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Tagging subscribers to this area: @dotnet/interop-contrib |
There was a problem hiding this comment.
Pull request overview
This PR fixes Apple (tvOS arm64) CoreCLR runtime failures caused by ILLink trimming Swift interop types from System.Private.CoreLib by ensuring TARGET_APPLE is present in the CoreLib MSBuild DefineConstants used to generate the runtime ILLink root descriptor.
Changes:
- Add
TARGET_APPLEtoDefineConstantswhenIsApplePlatformistruesocorelib.h#ifdef TARGET_APPLEblocks are included during descriptor generation.
🤖 Copilot Code Review — PR #126652Note This review was generated by GitHub Copilot. Holistic AssessmentMotivation: Justified and well-traced regression fix. PR #125083 added Approach: Correct and minimal. Adding Summary: ✅ LGTM. Single-line MSBuild fix that restores the missing Detailed Findings✅ Correctness — Fix addresses root causeVerified the regression chain: ✅ Platform coverage —
|
|
/ba-g other runtime-extra-platforms failures are being worked on |
TypeLoadException: Could not load type 'System.Runtime.InteropServices.Swift.SwiftSelf' from assembly 'System.Private.CoreLib'on tvos_arm64 CoreCLR. The Swift interop types (SwiftSelf,SwiftError,SwiftIndirectResult) were being trimmed fromSystem.Private.CoreLib.dllby ILLink on Apple builds.The
CreateRuntimeRootILLinkDescriptorFiletask generates the ILLink root descriptor by processingcorelib.hwithDefineConstants="$(DefineConstants);FOR_ILLINK". Sincecorelib.hgates the Swift type definitions behind#ifdef TARGET_APPLE, andTARGET_APPLEwas absent from the C#DefineConstants, the task didn't emit preservation roots for these types. ILLink then trimmed them as unreachable, causingCoreLibBinder::GetClass(CLASS__SWIFT_SELF)to throw at runtime.Fixes #126557