Xcode ↔ Swift Package Manager: Conflict Resolution for Shared Dependencies
0 reputation · 14 Jan 2024, 16:32 UTC
Xcode ↔ Swift Package Manager: Conflict Resolution for Shared Dependencies
In a workspace that imports two Swift packages, each declaring a dependency on a different major version of the same third‑party library, Xcode’s resolver consistently selects the highest available version. This behavior is not documented in the public Xcode or Swift Package Manager guides, and it can lead to binary incompatibilities that only surface at runtime.
Before attempting any optimization, a developer would like to quantify how much time the resolver consumes during the build. The Instruments Build Time template isolates the dependency‑resolution phase, but the exact contribution of network latency versus algorithmic complexity remains unclear.
Given this uncertainty, the following questions need clarification:
- What criteria does Xcode use to pick a version when two packages request different major versions of the same dependency?
- Can the selection be overridden or influenced via Xcode settings or the
Package.swiftmanifest? - What is the most reliable way to isolate and measure the resolver’s runtime with Instruments before applying any performance tweaks?