You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a package that has conditionally-included dependencies (such as dependencies that are pulled in iff a Package Trait is enabled), Planner will try to resolve them unconditionally. If the dependency isn't actually pulled in by SwiftPM, then, Planner will fail here:
throwStringError("Could not find package containing product '\(productName)'")
}
To repro: try adding a dependency on https://github.com/pointfreeco/swift-structured-queries @ v0.11.0. We end up with the error Could not find package containing product 'Tagged', because Planner doesn't know that the Tagged dependency is only required when the StructuredQueriesTagged trait is enabled (and in this case the trait is disabled.)
observe that Tagged is listed as a dependency without any extra qualification regarding traits, even though the actual Package.swift has a condition on the dependency.
We do get this information when replacing swift package describe with swift package dump-package so maybe there's a world where we switch to the latter. However describe is a more stable format and is generally preferable to consume from my experience, so we might need to take some sort of mixed/hybrid approach here. dump-package output:
I couldn't reproduce this with Swift 6.4 (Xcode 27) on current main (d802c71): planning succeeds for a package that depends on swift-structured-queries 0.11.0. SwiftPM 6.4's describe no longer lists trait-gated dependencies when the trait is off (StructuredQueriesCore now reports only IssueReporting), and swift-tagged isn't resolved at all, so Planner never looks for Tagged. I've only tested macOS, but since the Linux install guide now requires 6.4 too, this may be safe to close.
Activity
kabiroberai commentedon Aug 10, 2025
This might not be trivial to fix. Running
revelas
observe that
Taggedis listed as a dependency without any extra qualification regarding traits, even though the actual Package.swift has a condition on the dependency.We do get this information when replacing
swift package describewithswift package dump-packageso maybe there's a world where we switch to the latter. Howeverdescribeis a more stable format and is generally preferable to consume from my experience, so we might need to take some sort of mixed/hybrid approach here.dump-packageoutput:chintan100 commentedon Oct 9, 2026
I couldn't reproduce this with Swift 6.4 (Xcode 27) on current
main(d802c71): planning succeeds for a package that depends on swift-structured-queries 0.11.0. SwiftPM 6.4'sdescribeno longer lists trait-gated dependencies when the trait is off (StructuredQueriesCorenow reports onlyIssueReporting), and swift-tagged isn't resolved at all, soPlannernever looks forTagged. I've only tested macOS, but since the Linux install guide now requires 6.4 too, this may be safe to close.