Skip to content

[msbuild] Don't pass symbol file to strip when _ExportSymbolsExplicitly=false. Fixes #24582.#24800

Open
rolfbjarne wants to merge 1 commit intomainfrom
dev/rolf/strip-exported-symbols
Open

[msbuild] Don't pass symbol file to strip when _ExportSymbolsExplicitly=false. Fixes #24582.#24800
rolfbjarne wants to merge 1 commit intomainfrom
dev/rolf/strip-exported-symbols

Conversation

@rolfbjarne
Copy link
Member

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.

…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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c1a8618] Build passed (Build packages) ✅

Pipeline on Agent
Hash: c1a861810d7724f15153d6e5b37f1c2e5b952007 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #c1a8618] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: c1a861810d7724f15153d6e5b37f1c2e5b952007 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c1a8618] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: c1a861810d7724f15153d6e5b37f1c2e5b952007 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: c1a861810d7724f15153d6e5b37f1c2e5b952007 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [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

  • monotouch-test/iOS - simulator/Release (NativeAOT, ARM64): Crashed

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: c1a861810d7724f15153d6e5b37f1c2e5b952007 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip exited with code 1 can't open mtouch-symbols.list when setting _ExportSymbolsExplicitly=false

4 participants