Repository navigation
[dotnet] Preserve parameter names in remote Windows iOS builds. Fixes #26680 - #26693
Conversation
Build a Debug iOS app from Windows with a trimmable library and inspect the linked assembly copied back from the Mac. Assert that constructor and method parameter names remain intact, matching the .NET SDK's debugger-friendly trimming behavior. Leave the Windows ILLink target unchanged so CI can demonstrate the regression before the fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
WindowsTest already imports System.Reflection.Metadata, which also defines AssemblyDefinition. Qualify the Cecil type used to inspect the linked fixture assembly so the regression test compiles without changing either existing namespace import. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handle a missing linked model explicitly so the test reports its assertion failure before inspecting methods. This also keeps the remote regression test aligned with the repository's nullable code conventions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The regression inspects linked parameter names directly, so the app only needs to root its constructor and method. Avoid reflection-based JSON serialization warnings that could fail the remote build before the intended metadata assertion runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Forward the SDK's KeepMetadata items and PreserveSymbolPaths setting to the remote ILLink task. Debug builds now retain parameter names in trimmed assemblies when driven from Windows, matching builds driven directly from the Mac; deterministic source path handling also stays consistent with the SDK target. The previously committed Pair-to-Mac regression test observed the missing constructor names on Windows CI before this fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Symbol-path preservation lacks regression coverage, and the PR description contradicts the implemented scope.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Fixes metadata loss in remote Windows iOS builds and adds regression coverage.
Changes:
- Forwards linker metadata and symbol-path settings.
- Adds a trimmable fixture and remote Windows parameter-name test.
| File | Description |
|---|---|
WindowsTest.cs |
Validates preserved parameter names. |
TrimmerMetadataLibrary.csproj |
Defines trimmable library. |
MetadataModel.cs |
Supplies parameter metadata. |
TrimmerMetadata.csproj |
Defines iOS test app. |
Program.cs |
Roots tested members. |
Xamarin.iOS.Common.After.targets |
Forwards omitted linker settings. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #816e54c] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 221 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
…s iOS builds. Fixes #26680 (#26852) ## Summary Fix Debug iOS builds driven from Windows through Pair to Mac stripping parameter names from trimmed assemblies. The Windows `_RunILLink` override now forwards `KeepMetadata="@(_TrimmerKeepMetadata)"` and `PreserveSymbolPaths="$(_TrimmerPreserveSymbolPaths)"` to the remote ILLink task, matching the .NET SDK target used by Mac-driven builds. This preserves parameter metadata needed by reflection-based consumers without changing the SDK's trimming policy. Add a remote Windows regression test that builds an iOS app referencing a trimmable library, then inspects the linked library copied back from the Mac and checks its constructor and method parameter names. Fixes #26680 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rolf Bjarne Kvinge <rokvin@microsoft.com> Backport of #26693. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
Fix Debug iOS builds driven from Windows through Pair to Mac stripping parameter names from trimmed assemblies. The Windows
_RunILLinkoverride now forwardsKeepMetadata="@(_TrimmerKeepMetadata)"andPreserveSymbolPaths="$(_TrimmerPreserveSymbolPaths)"to the remote ILLink task, matching the .NET SDK target used by Mac-driven builds. This preserves parameter metadata needed by reflection-based consumers without changing the SDK's trimming policy.Add a remote Windows regression test that builds an iOS app referencing a trimmable library, then inspects the linked library copied back from the Mac and checks its constructor and method parameter names.
Validation
The regression test first failed in Windows Pair-to-Mac CI on the missing constructor parameter names. After the fix, the Windows Integration Tests Dotnet tests job passed in build 15487813. The Windows MSBuild task project built locally with no warnings or errors; the remote-only test is discovered but skips on macOS. A newer CI run is pending.
Fixes #26680
🤖 Pull request created by Copilot