[msbuild] Use GetFileSystemEntries for remote-safe XCFramework dSYM discovery - #26296
[msbuild] Use GetFileSystemEntries for remote-safe XCFramework dSYM discovery#26296rolfbjarne wants to merge 1 commit into
Conversation
…iscovery The _ComputeXCFrameworkDSyms target filtered xcframework dSYM candidates with the MSBuild Exists() function. Exists() evaluates on the MSBuild host, which is wrong for remote builds (Windows -> Mac): the dSYMs live on the Mac, not the Windows host, so the check never found them and the dSYMs were not copied into the archive. Use the remote-capable GetFileSystemEntries task (already used elsewhere in this file) to discover which *.dSYM directories actually exist under the computed dSYMs directory on the build machine, and copy only those. The discovered directory name matches the DSymName metadata used for the copy destination, so the _XCFrameworkDSymToCopy item shape (and _CopyXCFrameworkDSyms) is unchanged. Also guard GetFileSystemEntries against non-existent directories, since a framework's dSYMs directory may not exist. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ce0e670-fdae-4771-9cc5-68668bd95576
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.
Pull request overview
This PR updates the MSBuild logic that discovers and copies pre-existing XCFramework dSYM bundles so that it works correctly in remote-build scenarios (Windows MSBuild host building on a connected Mac), where MSBuild’s Exists(...) would otherwise check the wrong machine.
Changes:
- Replaced host-evaluated
Exists(...)checks with the remote-capableGetFileSystemEntriestask for XCFramework*.dSYMdiscovery. - Adjusted metadata shaping so
_CopyXCFrameworkDSymscontinues to work with the discovered entries. - Hardened
GetFileSystemEntriesto skip missing directories instead of failing, and updated a misleading comment.
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 | Switches XCFramework dSYM discovery from Exists(...) to GetFileSystemEntries to work correctly for remote builds. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetFileSystemEntries.cs | Skips non-existent input directories to avoid failures when optional directories (like dSYMs/) are missing. |
✅ 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 #963a8c3] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 203 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Addresses a code review comment from #26292.
Problem
The
_ComputeXCFrameworkDSymstarget inmsbuild/Xamarin.Shared/Xamarin.Shared.targetsfiltered xcframework dSYM candidates using the MSBuildExists(...)function:Exists(...)evaluates on the MSBuild host using host path semantics. For remote builds (Windows → macOS, e.g. Hot Restart / remote Mac builds) this is wrong: the files live on the Mac, not the Windows host, so the check never finds them and the xcframework dSYMs are not copied into the archive. The old comment even claimed the target "only runs on macOS", which is misleading.Fix
Use the existing remote-capable
GetFileSystemEntriestask (already used elsewhere in the same file) to discover which*.dSYMdirectories actually exist under the computeddSYMsdirectory on the build machine (the Mac), and copy only those — instead of relying on the host-sideExists(...)function.DSymNamemetadata used for the copy destination, so the_XCFrameworkDSymToCopyitem shape (Identity = source dSYM path,DSymNamemetadata) is preserved and_CopyXCFrameworkDSymskeeps working unchanged.GetFileSystemEntriesnow skips non-existent directories, since a framework'sdSYMsdirectory may not exist.🤖 Pull request created by Copilot