[msbuild] Fix getting an x64 simulator if asked to build for x64.#25614
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the GetAvailableDevices MSBuild task so that simulator device selection respects an explicitly requested RuntimeIdentifier (notably enabling correct x64 simulator selection when the build is targeting x64), instead of always preferring the host’s “best” simulator architecture.
Changes:
- When a simulator device reports multiple runtime identifiers (arm64 + x64), prefer the task’s
RuntimeIdentifiervalue if provided. - Otherwise, keep the existing host-architecture-based selection (
CanRunArm64) for simulator runtime identifier metadata.
| if (!string.IsNullOrEmpty (RuntimeIdentifier)) { | ||
| d.Item.SetMetadata ("RuntimeIdentifier", RuntimeIdentifier); | ||
| } else { | ||
| d.Item.SetMetadata ("RuntimeIdentifier", d.RuntimeIdentifiers.Single (v => v.Contains ("arm64") == CanRunArm64)); | ||
| } |
… and multi-arch simulators. Add a test that verifies the behavior when RuntimeIdentifier is set on the task and the simulator runtime supports both arm64 and x64 architectures. This covers the fix from the previous commit where setting RuntimeIdentifier explicitly selects the correct RID for multi-arch simulators. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
✅ [PR Build #45d47cf] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #45d47cf] Build passed (Build packages) ✅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 |
✅ [PR Build #45d47cf] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #45d47cf] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 193 tests passed 🎉 Tests counts✅ cecil: 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 |
No description provided.