# SwiftPM seems to be cloning unnecessary dependencies

**URL:** <https://forums.swift.org/t/swiftpm-seems-to-be-cloning-unnecessary-dependencies/77169>\
**Category:** Package Manager\
**Tags:** packagemanager\
**Created:** [January 13, 2025, 3:23pm UTC](https://forums.swift.org/t/swiftpm-seems-to-be-cloning-unnecessary-dependencies/77169 "2025-01-13T15:23:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [January 13, 2025, 3:23pm UTC](https://forums.swift.org/t/swiftpm-seems-to-be-cloning-unnecessary-dependencies/77169/1 "2025-01-13T15:23:54Z")

</div>

it looks like (on Swift 6.0.3 at least) that SwiftPM eagerly clones all transitive package dependencies if just one product from that package is included in the build, even if that product depends on none of those repositories.

this means if product A in the root package depends on product B from swift-b, and something else in swift-b (like a test or an overlay) depends on swift-c, that the entire history for swift-c will be downloaded during the build for A.

is this a known issue with SwiftPM?

---

<div class="post-metadata">

**Author:** ![ssly](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ssly/32/34148_2.png) [@ssly](https://forums.swift.org/u/ssly)\
**Post date:** [February 25, 2025, 10:26am UTC](https://forums.swift.org/t/swiftpm-seems-to-be-cloning-unnecessary-dependencies/77169/2 "2025-02-25T10:26:12Z")

</div>

Yes, I hope it can be optimized in the future.
