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
Provide context necessary to resolve identity conflict. (#8390)
Update error messaging to be a bit more clear where the conflict of
identities is coming from.
### Motivation:
#8311 — when multiple packages share the same identity (for example:
`gh/swiftlang/swift-driver` and `gh/apple/swift-driver` share the same
identity `swift-driver`) then the error doesn't help to resolve the
conflict. It is particularly confusing when the conflicting package is
pulled from transitive dependencies. I wanted to offer more context to
resolve these types of conflicts, particularly:
- how the conflict is introduced in relation to the root package
- itemize all paths for both sides of the conflict, so that users can
better understand how to approach resolution, but not overwhelm the
error message with too many details
### Modifications:
- Rephrase error message for clarity, add a suggestion to work with
maintainers of transitive dependencies.
- Reconstruct the dependency chains from roots to the conflicting
packages.
### Result:
Before:
`'swift-build': 'swift-build' dependency on
'https://github.com/swiftlang/swift-driver.git' conflicts with
dependency on 'https://github.com/apple/swift-driver.git' which has the
same identity 'swift-driver'.`
After:
`Conflicting identity for swift-driver: dependency
'github.com/swiftlang/swift-driver' and dependency
'github.com/apple/swift-driver' both point to the same package identity
'swift-driver'. The dependencies are introduced through the following
chains: (A)
/users/yy/pub/swift-package-manager->github.com/swiftlang/swift-build->github.com/swiftlang/swift-driver
(B) /users/yy/pub/swift-package-manager->github.com/apple/swift-driver.
If there are multiple chains that lead to the same dependency, only the
first chain is shown here. To see all chains use debug output option. To
resolve the conflict, coordinate with the maintainer of the package that
introduces the conflicting dependency.
`
Plus also debug logs:
`debug: 'swift-build': Conflicting identity for swift-driver: chains of
dependencies for https://github.com/swiftlang/swift-driver.git:
[[/users/yy/pub/swift-package-manager, github.com/swiftlang/swift-build,
github.com/swiftlang/swift-driver]]`
`debug: 'swift-build': Conflicting identity for swift-driver: chains of
dependencies for https://github.com/apple/swift-driver.git:
[[/users/yy/pub/swift-package-manager, github.com/apple/swift-driver]]`
0 commit comments