[msbuild] Don't pass symbol file to strip when _ExportSymbolsExplicitly=false. Fixes #24582.#24800
[msbuild] Don't pass symbol file to strip when _ExportSymbolsExplicitly=false. Fixes #24582.#24800rolfbjarne wants to merge 1 commit intomainfrom
Conversation
…ly=false. Fixes #24582. When _ExportSymbolsExplicitly is false, the linker uses -u flags instead of -exported_symbols_list, so mtouch-symbols.list is not transferred to the remote Mac. Don't pass it to strip either, since the file won't exist. Fixes #24582. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a build failure on Windows when building iOS apps with _ExportSymbolsExplicitly=false. The issue occurred because the strip tool tried to access mtouch-symbols.list which wasn't transferred to the remote Mac when symbol export is handled via -u linker flags instead of -exported_symbols_list.
Changes:
- Added conditional logic to only pass the symbols file to strip when symbols are exported explicitly
- Added a Windows remote test to verify the fix works correctly
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Added condition to only set SymbolFile metadata when _ExportSymbolsExplicitly is true |
| tests/dotnet/UnitTests/WindowsTest.cs | Added StripTest to verify build succeeds with _ExportSymbolsExplicitly=false |
✅ [CI Build #c1a8618] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #c1a8618] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #c1a8618] Build passed (Build macOS tests) ✅Pipeline on Agent |
✅ 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 |
🔥 [CI Build #c1a8618] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 155 tests passed. Failures❌ monotouch tests (iOS)1 tests failed, 10 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
When _ExportSymbolsExplicitly is false, the linker uses -u flags instead of
-exported_symbols_list, so mtouch-symbols.list is not transferred to the
remote Mac. Don't pass it to strip either, since the file won't exist.
Fixes #24582.