swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.74k stars 1.34k forks source link

[SR-6392] Dependency resolution conflict only shows one dependency #4915

Open swift-ci opened 6 years ago

swift-ci commented 6 years ago
Previous ID SR-6392
Radar rdar://problem/40206348
Original Reporter charliecrisp (JIRA User)
Type Bug

Attachment: Download

Environment macOS High Sierra, using Docker with docker-compose. In this case, the Kitura and Kitura-CredentialsHTTP dependencies could not be resolved.
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 224dea18ac952c4f30acacc668d17dda

Issue Description:

When there are conflicting dependencies in `Package.swift`, `swift build` will give the following error, which only gives one of the conflicting dependencies.

error: dependency graph is unresolvable; found these conflicting requirements:
Dependencies:
 https://github.com/IBM-Swift/Kitura.git @ 1.7.9..<1.8.0
abertelrud commented 6 years ago

This reproduces outside of Docker as well. And in fact, this looks like a known limitation of the current package dependency resolution machinery: the “transitive incompatible dependency” section of the `testDiagnostics()` unit test in the `DependencyResolverTests.swift` source file asserts that there is one dependency reported in the diagnostic, even though two different versions are involved.

This seems non-trivial to fix, so this probably comes down to a need to improve the diagnostic output of dependency resolution rather than a fix for a specific bug in the code.

gwynne commented 6 years ago

Also running into this. Would love to see a fix.

swift-ci commented 6 years ago

Comment by mark wang (JIRA)

i also running into this. would love to see a fix.

aciidgh commented 6 years ago

@swift-ci create

swift-ci commented 5 years ago

Comment by Tabor Kelly (JIRA)

                        /^\
           /         (/^\)     /
      \   ( \         \ /     ( \     /^\
     / )   \ |        _|_      \ |   |/^\|
    | /    _|_        | |      _|_    \ /
    _|_    | |        | |      | |    _|_
    | |    | |        | |      | |    | |
    | |    | |    ****| |******| |    | |
    | |****| |****    | |      | |****| |
   *| |    | |                 | |    | |*****
 *  | |   H  A  P  P  Y               | |      *
*                                               *
| *            B  I  R  T  H  D  A  Y  !      * |
|  *****                                 *****  |
|@      **********             **********      @|
| @   @           *************           @   @ |
|  @@@ @    @                       @    @ @@@  |
|       @@@@ @      @       @      @ @@@@       |
 *            @@@@@@ @     @ @@@@@@            *
  *                   @@@@@                   *
   *****                                 *****
        **********             **********
                  *************

It would be great to get this bug fixed.